Commit f3bf215c authored by eroman's avatar eroman Committed by Commit bot

Re-land: Fix Website Settings crash with Plugins ASK setting.

This reverts commit 09eafe73.

TBR=tommycli@chromium.org
NOTRY=true

Review URL: https://codereview.chromium.org/790123003

Cr-Commit-Position: refs/heads/master@{#309573}
parent ddea131f
...@@ -308,6 +308,9 @@ are declared in build/common.gypi. ...@@ -308,6 +308,9 @@ are declared in build/common.gypi.
<message name="IDS_WEBSITE_SETTINGS_BUTTON_TEXT_BLOCKED_BY_POLICY" desc="The Website Settings popup contains several buttons for opening dropdown menus and changing site permissions. This is the text of such a button if the permission controlled by the button is set to block and managed by policy."> <message name="IDS_WEBSITE_SETTINGS_BUTTON_TEXT_BLOCKED_BY_POLICY" desc="The Website Settings popup contains several buttons for opening dropdown menus and changing site permissions. This is the text of such a button if the permission controlled by the button is set to block and managed by policy.">
Blocked by policy Blocked by policy
</message> </message>
<message name="IDS_WEBSITE_SETTINGS_BUTTON_TEXT_ASK_BY_POLICY" desc="The Website Settings popup contains several buttons for opening dropdown menus and changing site permissions. This is the text of such a button if the permission controlled by the button is set to ask and managed by policy.">
Ask by policy
</message>
<message name="IDS_WEBSITE_SETTINGS_BUTTON_TEXT_ALLOWED_BY_EXTENSION" desc="The Website Settings popup contains several buttons for opening dropdown menus and changing site permissions. This is the text of such a button if the permission controlled by the button is set to allow and managed by an extension."> <message name="IDS_WEBSITE_SETTINGS_BUTTON_TEXT_ALLOWED_BY_EXTENSION" desc="The Website Settings popup contains several buttons for opening dropdown menus and changing site permissions. This is the text of such a button if the permission controlled by the button is set to allow and managed by an extension.">
Allowed by extension Allowed by extension
</message> </message>
...@@ -320,6 +323,9 @@ are declared in build/common.gypi. ...@@ -320,6 +323,9 @@ are declared in build/common.gypi.
<message name="IDS_WEBSITE_SETTINGS_BUTTON_TEXT_BLOCKED_BY_USER" desc="The Website Settings popup contains several buttons for opening dropdown menus and changing site permissions. This is the text of such a button if the permission controlled by the button was explicitly set to block by the user."> <message name="IDS_WEBSITE_SETTINGS_BUTTON_TEXT_BLOCKED_BY_USER" desc="The Website Settings popup contains several buttons for opening dropdown menus and changing site permissions. This is the text of such a button if the permission controlled by the button was explicitly set to block by the user.">
Blocked by you Blocked by you
</message> </message>
<message name="IDS_WEBSITE_SETTINGS_BUTTON_TEXT_ASK_BY_USER" desc="The Website Settings popup contains several buttons for opening dropdown menus and changing site permissions. This is the text of such a button if the permission controlled by the button was explicitly set to ask by the user.">
Ask by you
</message>
<message name="IDS_WEBSITE_SETTINGS_BUTTON_TEXT_ALLOWED_BY_DEFAULT" desc="The Website Settings popup contains several buttons for opening dropdown menus and changing site permissions. This is the text of such a button if the permission controlled by the button is set to the default setting and the default settings is allow."> <message name="IDS_WEBSITE_SETTINGS_BUTTON_TEXT_ALLOWED_BY_DEFAULT" desc="The Website Settings popup contains several buttons for opening dropdown menus and changing site permissions. This is the text of such a button if the permission controlled by the button is set to the default setting and the default settings is allow.">
Allowed by default Allowed by default
</message> </message>
...@@ -422,6 +428,9 @@ are declared in build/common.gypi. ...@@ -422,6 +428,9 @@ are declared in build/common.gypi.
<message name="IDS_WEBSITE_SETTINGS_MENU_ITEM_BLOCK" desc="The text of the menu item of a permissions menu on the Website Settings UI that sets the setting to allow."> <message name="IDS_WEBSITE_SETTINGS_MENU_ITEM_BLOCK" desc="The text of the menu item of a permissions menu on the Website Settings UI that sets the setting to allow.">
Always block on this site Always block on this site
</message> </message>
<message name="IDS_WEBSITE_SETTINGS_MENU_ITEM_ASK" desc="The text of the menu item of a permissions menu on the Website Settings UI that sets the setting to ask.">
Always ask on this site
</message>
<message name="IDS_WEBSITE_SETTINGS_PERMISSION_TYPE" desc="The label that is used to display permission types in the Website Settings popup. "> <message name="IDS_WEBSITE_SETTINGS_PERMISSION_TYPE" desc="The label that is used to display permission types in the Website Settings popup. ">
<ph name="PERMISSION_TYPE_LABEL">$1<ex>Plugins</ex></ph>: <ph name="PERMISSION_TYPE_LABEL">$1<ex>Plugins</ex></ph>:
</message> </message>
......
...@@ -46,6 +46,12 @@ PermissionMenuModel::PermissionMenuModel( ...@@ -46,6 +46,12 @@ PermissionMenuModel::PermissionMenuModel(
AddCheckItem(CONTENT_SETTING_ALLOW, label); AddCheckItem(CONTENT_SETTING_ALLOW, label);
} }
if (permission_.type == CONTENT_SETTINGS_TYPE_PLUGINS) {
label = l10n_util::GetStringUTF16(
IDS_WEBSITE_SETTINGS_MENU_ITEM_ASK);
AddCheckItem(CONTENT_SETTING_ASK, label);
}
if (permission_.type != CONTENT_SETTINGS_TYPE_FULLSCREEN) { if (permission_.type != CONTENT_SETTINGS_TYPE_FULLSCREEN) {
label = l10n_util::GetStringUTF16( label = l10n_util::GetStringUTF16(
IDS_WEBSITE_SETTINGS_MENU_ITEM_BLOCK); IDS_WEBSITE_SETTINGS_MENU_ITEM_BLOCK);
......
...@@ -21,7 +21,7 @@ const int kPermissionButtonTextIDPolicyManaged[] = { ...@@ -21,7 +21,7 @@ const int kPermissionButtonTextIDPolicyManaged[] = {
kInvalidResourceID, kInvalidResourceID,
IDS_WEBSITE_SETTINGS_BUTTON_TEXT_ALLOWED_BY_POLICY, IDS_WEBSITE_SETTINGS_BUTTON_TEXT_ALLOWED_BY_POLICY,
IDS_WEBSITE_SETTINGS_BUTTON_TEXT_BLOCKED_BY_POLICY, IDS_WEBSITE_SETTINGS_BUTTON_TEXT_BLOCKED_BY_POLICY,
kInvalidResourceID, IDS_WEBSITE_SETTINGS_BUTTON_TEXT_ASK_BY_POLICY,
kInvalidResourceID, kInvalidResourceID,
kInvalidResourceID}; kInvalidResourceID};
static_assert(arraysize(kPermissionButtonTextIDPolicyManaged) == static_assert(arraysize(kPermissionButtonTextIDPolicyManaged) ==
...@@ -48,7 +48,7 @@ const int kPermissionButtonTextIDUserManaged[] = { ...@@ -48,7 +48,7 @@ const int kPermissionButtonTextIDUserManaged[] = {
kInvalidResourceID, kInvalidResourceID,
IDS_WEBSITE_SETTINGS_BUTTON_TEXT_ALLOWED_BY_USER, IDS_WEBSITE_SETTINGS_BUTTON_TEXT_ALLOWED_BY_USER,
IDS_WEBSITE_SETTINGS_BUTTON_TEXT_BLOCKED_BY_USER, IDS_WEBSITE_SETTINGS_BUTTON_TEXT_BLOCKED_BY_USER,
kInvalidResourceID, IDS_WEBSITE_SETTINGS_BUTTON_TEXT_ASK_BY_USER,
kInvalidResourceID, kInvalidResourceID,
kInvalidResourceID}; kInvalidResourceID};
static_assert(arraysize(kPermissionButtonTextIDUserManaged) == static_assert(arraysize(kPermissionButtonTextIDUserManaged) ==
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment