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

Unified Diff: chrome/common/extensions/permissions/chrome_permission_message_provider.cc

Issue 236113002: Suppress tabs permission warning if there is already a browsingHistory warning. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 8 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/extensions/permissions/chrome_permission_message_provider.cc
diff --git a/chrome/common/extensions/permissions/chrome_permission_message_provider.cc b/chrome/common/extensions/permissions/chrome_permission_message_provider.cc
index f0c415d5f79b70d1c8f4d86d16a28c3d99da7408..e3c007023f3197c72f7e8e9393d94ae7f71593ab 100644
--- a/chrome/common/extensions/permissions/chrome_permission_message_provider.cc
+++ b/chrome/common/extensions/permissions/chrome_permission_message_provider.cc
@@ -73,6 +73,19 @@ PermissionMessages::iterator FindMessageByID(PermissionMessages& messages,
return messages.end();
}
+void SuppressMessage(PermissionMessages& messages,
+ int suppressing_message,
+ int suppressed_message) {
+ // If there is a warning for browsing history, don't show the warning for tabs
+ // permission because the texts are very similar.
+ PermissionMessages::iterator suppressed =
+ FindMessageByID(messages, suppressed_message);
+ if (suppressed != messages.end() &&
+ FindMessageByID(messages, suppressing_message) != messages.end()) {
+ messages.erase(suppressed);
+ }
+}
+
} // namespace
ChromePermissionMessageProvider::ChromePermissionMessageProvider() {
@@ -114,6 +127,12 @@ PermissionMessages ChromePermissionMessageProvider::GetPermissionMessages(
messages.erase(override_bookmarks_ui);
}
+ SuppressMessage(messages,
+ PermissionMessage::kBookmarks,
+ PermissionMessage::kOverrideBookmarksUI);
+ SuppressMessage(messages,
+ PermissionMessage::kBrowsingHistory,
Devlin 2014/04/11 23:18:56 I think I'd rather have BrowsingHistory suppressed
meacer 2014/04/11 23:49:53 I actually think the scary one is browsing history
+ PermissionMessage::kTabs);
return messages;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698