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

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

Issue 4090011: Fix bug with context menus in incognito mode. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: manifest fix Created 10 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
Index: chrome/browser/extensions/extension_menu_manager.cc
diff --git a/chrome/browser/extensions/extension_menu_manager.cc b/chrome/browser/extensions/extension_menu_manager.cc
index 9ddb0f0e051a4a9c8e391e74d5d3f663e347dc99..eae74f6697f65cf3bc81d28c9c1939a8a25be5a3 100644
--- a/chrome/browser/extensions/extension_menu_manager.cc
+++ b/chrome/browser/extensions/extension_menu_manager.cc
@@ -389,9 +389,9 @@ void ExtensionMenuManager::ExecuteCommand(
ListValue args;
DictionaryValue* properties = new DictionaryValue();
- properties->SetInteger("menuItemId", item->id().second);
+ properties->SetInteger("menuItemId", item->id().uid);
if (item->parent_id())
- properties->SetInteger("parentMenuItemId", item->parent_id()->second);
+ properties->SetInteger("parentMenuItemId", item->parent_id()->uid);
switch (params.media_type) {
case WebKit::WebContextMenuData::MediaTypeImage:
@@ -471,3 +471,36 @@ bool ExtensionMenuManager::HasAllowedScheme(const GURL& url) {
URLPattern pattern(kAllowedSchemes);
return pattern.SetScheme(url.scheme());
}
+
+ExtensionMenuItem::Id::Id()
+ : profile(NULL), uid(0) {
+}
+
+ExtensionMenuItem::Id::Id(Profile* profile, std::string extension_id, int uid)
+ : profile(profile), extension_id(extension_id), uid(uid) {
+}
+
+ExtensionMenuItem::Id::~Id() {
+}
+
+bool ExtensionMenuItem::Id::operator==(const Id& other) const {
+ return (profile == other.profile &&
+ extension_id == other.extension_id &&
+ uid == other.uid);
+}
+
+bool ExtensionMenuItem::Id::operator!=(const Id& other) const {
+ return !(*this == other);
+}
+
+bool ExtensionMenuItem::Id::operator<(const Id& other) const {
+ if (profile < other.profile)
+ return true;
+ if (profile == other.profile) {
+ if (extension_id < other.extension_id)
+ return true;
+ if (extension_id == other.extension_id)
+ return uid < other.uid;
+ }
+ return false;
+}
« no previous file with comments | « chrome/browser/extensions/extension_menu_manager.h ('k') | chrome/browser/extensions/extension_menu_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698