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

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

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.h
diff --git a/chrome/browser/extensions/extension_menu_manager.h b/chrome/browser/extensions/extension_menu_manager.h
index 4455ee1a16cc6c56d78a8c18b108ada2efb0e9f7..c8224d11dd70d3990bbb94822624b787f68faa83 100644
--- a/chrome/browser/extensions/extension_menu_manager.h
+++ b/chrome/browser/extensions/extension_menu_manager.h
@@ -33,9 +33,20 @@ class ExtensionMenuItem {
// A list of ExtensionMenuItem's.
typedef std::vector<ExtensionMenuItem*> List;
- // An Id is a pair of |extension id|, |int| where the |int| is unique per
- // extension.
- typedef std::pair<std::string, int> Id;
+ // An Id uniquely identifies a context menu item registered by an extension.
+ struct Id {
+ Id();
+ Id(Profile* profile, std::string extension_id, int uid);
+ ~Id();
+
+ bool operator==(const Id& other) const;
+ bool operator!=(const Id& other) const;
+ bool operator<(const Id& other) const;
+
+ Profile* profile;
+ std::string extension_id;
+ int uid;
+ };
// For context menus, these are the contexts where an item can appear.
enum Context {
@@ -93,7 +104,7 @@ class ExtensionMenuItem {
virtual ~ExtensionMenuItem();
// Simple accessor methods.
- const std::string& extension_id() const { return id_.first; }
+ const std::string& extension_id() const { return id_.extension_id; }
const std::string& title() const { return title_; }
const List& children() { return children_; }
const Id& id() const { return id_; }
« no previous file with comments | « chrome/browser/extensions/extension_event_router.cc ('k') | chrome/browser/extensions/extension_menu_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698