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

Unified Diff: chrome/browser/extensions/menu_manager.cc

Issue 11226037: Incognito-allowed package apps produce duplicate items in context menu (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: fixed unittest Created 8 years, 2 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 | « chrome/browser/extensions/menu_manager.h ('k') | chrome/browser/extensions/menu_manager_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/menu_manager.cc
diff --git a/chrome/browser/extensions/menu_manager.cc b/chrome/browser/extensions/menu_manager.cc
index 26f7793b03da6aeab69337974a451571598c5270..79849cd36d0482340200d706349f5cd5d09c1206 100644
--- a/chrome/browser/extensions/menu_manager.cc
+++ b/chrome/browser/extensions/menu_manager.cc
@@ -809,6 +809,24 @@ const SkBitmap& MenuManager::GetIconForExtension(
return icon_manager_.GetIcon(extension_id);
}
+void MenuManager::RemoveAllIncognitoContextItems() {
+ // Get all context menu items with "incognito" set to "split".
+ std::set<MenuItem::Id> items_to_remove;
+ std::map<MenuItem::Id, MenuItem*>::const_iterator iter;
+ for (iter = items_by_id_.begin();
+ iter != items_by_id_.end();
+ ++iter) {
+ if (iter->first.incognito)
+ items_to_remove.insert(iter->first);
+ }
+
+ std::set<MenuItem::Id>::iterator remove_iter;
+ for (remove_iter = items_to_remove.begin();
+ remove_iter != items_to_remove.end();
+ ++remove_iter)
+ RemoveContextMenuItem(*remove_iter);
+}
+
MenuItem::Id::Id()
: incognito(false), extension_id(""), uid(0), string_uid("") {
}
« no previous file with comments | « chrome/browser/extensions/menu_manager.h ('k') | chrome/browser/extensions/menu_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698