Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5643)

Unified Diff: chrome/browser/ui/website_settings/permission_menu_model.cc

Issue 2732963005: Views/Permissions: Use shorter strings for site setting drop downs. (Closed)
Patch Set: Change all references to |info| in the constructor to references to |permission_| to be consistent. Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/ui/website_settings/website_settings_ui.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/website_settings/permission_menu_model.cc
diff --git a/chrome/browser/ui/website_settings/permission_menu_model.cc b/chrome/browser/ui/website_settings/permission_menu_model.cc
index 2828c7794e27a189cfad904b21bdac84be5c0a9e..7051df98cbe7b3c3e43d69fb7bdbe8addde4aa1a 100644
--- a/chrome/browser/ui/website_settings/permission_menu_model.cc
+++ b/chrome/browser/ui/website_settings/permission_menu_model.cc
@@ -27,6 +27,7 @@ PermissionMenuModel::PermissionMenuModel(
DCHECK(!callback_.is_null());
base::string16 label;
+ // Retrieve the string to show for the default setting for this permission.
ContentSetting effective_default_setting = permission_.default_setting;
#if BUILDFLAG(ENABLE_PLUGINS)
@@ -68,12 +69,13 @@ PermissionMenuModel::PermissionMenuModel(
// of simply setting a shorter label on the menubutton.
if (ui::MaterialDesignController::IsSecondaryUiMaterial()) {
label = WebsiteSettingsUI::PermissionActionToUIString(
- profile, info.type, info.setting, effective_default_setting,
- info.source);
+ profile, permission_.type, CONTENT_SETTING_DEFAULT,
+ effective_default_setting, permission_.source);
}
AddCheckItem(CONTENT_SETTING_DEFAULT, label);
+ // Retrieve the string to show for allowing the permission.
// Notifications does not support CONTENT_SETTING_ALLOW in incognito.
bool allow_disabled_for_notifications =
permission_.is_incognito &&
@@ -86,6 +88,11 @@ PermissionMenuModel::PermissionMenuModel(
(!is_media_permission || content::IsOriginSecure(url))) {
label = l10n_util::GetStringUTF16(
IDS_WEBSITE_SETTINGS_MENU_ITEM_ALLOW);
+ if (ui::MaterialDesignController::IsSecondaryUiMaterial()) {
+ label = WebsiteSettingsUI::PermissionActionToUIString(
+ profile, permission_.type, CONTENT_SETTING_ALLOW,
+ effective_default_setting, permission_.source);
+ }
AddCheckItem(CONTENT_SETTING_ALLOW, label);
}
@@ -99,7 +106,13 @@ PermissionMenuModel::PermissionMenuModel(
AddCheckItem(CONTENT_SETTING_DETECT_IMPORTANT_CONTENT, label);
}
+ // Retrieve the string to show for blocking the permission.
label = l10n_util::GetStringUTF16(IDS_WEBSITE_SETTINGS_MENU_ITEM_BLOCK);
+ if (ui::MaterialDesignController::IsSecondaryUiMaterial()) {
+ label = WebsiteSettingsUI::PermissionActionToUIString(
+ profile, info.type, CONTENT_SETTING_BLOCK, effective_default_setting,
+ info.source);
+ }
AddCheckItem(CONTENT_SETTING_BLOCK, label);
}
« no previous file with comments | « no previous file | chrome/browser/ui/website_settings/website_settings_ui.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698