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

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

Issue 2884813003: [subresource_filter] Add custom strings/behavior on Desktop Page Info (Closed)
Patch Set: raymes review Created 3 years, 7 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
Index: chrome/browser/ui/page_info/permission_menu_model.cc
diff --git a/chrome/browser/ui/page_info/permission_menu_model.cc b/chrome/browser/ui/page_info/permission_menu_model.cc
index 3100323110c31c87ff98f2bdc1143d1926813bae..8b81362200d8d3276b7864446fa121999b08094a 100644
--- a/chrome/browser/ui/page_info/permission_menu_model.cc
+++ b/chrome/browser/ui/page_info/permission_menu_model.cc
@@ -70,7 +70,12 @@ PermissionMenuModel::PermissionMenuModel(Profile* profile,
effective_default_setting, permission_.source);
}
- AddCheckItem(CONTENT_SETTING_DEFAULT, label);
+ bool subresource_filter_permission =
+ permission_.type == CONTENT_SETTINGS_TYPE_SUBRESOURCE_FILTER;
+
+ // The subresource filter permission does not display the default menu item.
+ if (!subresource_filter_permission)
+ AddCheckItem(CONTENT_SETTING_DEFAULT, label);
// Retrieve the string to show for allowing the permission.
// Notifications does not support CONTENT_SETTING_ALLOW in incognito.
@@ -89,6 +94,10 @@ PermissionMenuModel::PermissionMenuModel(Profile* profile,
profile, permission_.type, CONTENT_SETTING_ALLOW,
effective_default_setting, permission_.source);
}
+
+ if (subresource_filter_permission)
+ label = l10n_util::GetStringUTF16(IDS_PAGE_INFO_SUBRESOURCE_FILTER_ALLOW);
raymes 2017/05/17 00:39:12 Let's move this up above the if (ui::MaterialDesi
Charlie Harrison 2017/05/17 14:06:07 Done. I'm keeping the string the same until we rea
+
AddCheckItem(CONTENT_SETTING_ALLOW, label);
}
@@ -104,6 +113,8 @@ PermissionMenuModel::PermissionMenuModel(Profile* profile,
// Retrieve the string to show for blocking the permission.
label = l10n_util::GetStringUTF16(IDS_PAGE_INFO_MENU_ITEM_BLOCK);
+ if (subresource_filter_permission)
+ label = l10n_util::GetStringUTF16(IDS_PAGE_INFO_SUBRESOURCE_FILTER_BLOCK);
if (ui::MaterialDesignController::IsSecondaryUiMaterial()) {
label = PageInfoUI::PermissionActionToUIString(
profile, info.type, CONTENT_SETTING_BLOCK, effective_default_setting,

Powered by Google App Engine
This is Rietveld 408576698