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; |
+} |