Index: chrome/browser/extensions/extension_context_menu_model.h |
diff --git a/chrome/browser/extensions/extension_context_menu_model.h b/chrome/browser/extensions/extension_context_menu_model.h |
index 4685b6c9f42def7fe89997d542f87f85b64a12f7..ef18d1cbc6aadbb5909655d5979d16874c507af3 100644 |
--- a/chrome/browser/extensions/extension_context_menu_model.h |
+++ b/chrome/browser/extensions/extension_context_menu_model.h |
@@ -8,7 +8,9 @@ |
#include <string> |
#include "base/memory/scoped_ptr.h" |
+#include "chrome/browser/extensions/context_menu_matcher.h" |
#include "chrome/browser/extensions/extension_uninstall_dialog.h" |
+#include "chrome/browser/extensions/menu_manager.h" |
#include "ui/base/models/simple_menu_model.h" |
class Browser; |
@@ -35,6 +37,11 @@ class ExtensionContextMenuModel |
INSPECT_POPUP |
}; |
+ enum ActionType { |
Yoyo Zhou
2014/06/27 23:37:57
This should definitely have a default 'none' (NO_A
gpdavis
2014/06/28 00:05:41
I was under the impression that this class was spe
gpdavis
2014/06/30 21:11:11
Ah, you're right. The second constructor is calle
|
+ BROWSER_ACTION = 0, |
+ PAGE_ACTION |
+ }; |
+ |
// Delegate to handle showing an ExtensionAction popup. |
class PopupDelegate { |
public: |
@@ -95,9 +102,24 @@ class ExtensionContextMenuModel |
// The delegate which handles the 'inspect popup' menu command (or NULL). |
PopupDelegate* delegate_; |
+ ActionType action_type_; |
+ |
// Keeps track of the extension uninstall dialog. |
scoped_ptr<extensions::ExtensionUninstallDialog> extension_uninstall_dialog_; |
+ // Menu matcher for extensions context menu items. |
Yoyo Zhou
2014/06/27 23:37:57
This should be more specific - these are the ones
gpdavis
2014/06/30 21:11:11
Done.
|
+ extensions::ContextMenuMatcher extension_items_; |
+ |
+ void AppendExtensionItems(); |
Yoyo Zhou
2014/06/27 23:37:57
Private functions should go above members.
gpdavis
2014/06/30 21:11:11
Done.
|
+ |
+ // Determines whether this context menu was created for a browser action or |
+ // a page action. |
+ ActionType GetActionType(const extensions::Extension* extension); |
+ |
+ // Matches extensions menu items by ActionType. |
+ static bool MenuItemMatchesContext(ActionType type, |
+ const extensions::MenuItem* item); |
+ |
DISALLOW_COPY_AND_ASSIGN(ExtensionContextMenuModel); |
}; |