Chromium Code Reviews| Index: chrome/browser/tab_contents/render_view_context_menu.h |
| diff --git a/chrome/browser/tab_contents/render_view_context_menu.h b/chrome/browser/tab_contents/render_view_context_menu.h |
| index d215e98f8e0c413c523494392e2dd6c1c2f0ca00..00a5d0b6f4e5d90655b6b819151beba2192fdae4 100644 |
| --- a/chrome/browser/tab_contents/render_view_context_menu.h |
| +++ b/chrome/browser/tab_contents/render_view_context_menu.h |
| @@ -14,6 +14,7 @@ |
| #include "base/observer_list.h" |
| #include "base/string16.h" |
| #include "chrome/browser/custom_handlers/protocol_handler_registry.h" |
| +#include "chrome/browser/extensions/context_menu_manager.h" |
| #include "chrome/browser/extensions/menu_manager.h" |
| #include "chrome/browser/tab_contents/render_view_context_menu_observer.h" |
| #include "content/public/common/context_menu_params.h" |
| @@ -127,7 +128,6 @@ class RenderViewContextMenuProxy { |
| class RenderViewContextMenu : public ui::SimpleMenuModel::Delegate, |
| public RenderViewContextMenuProxy { |
| public: |
| - static const size_t kMaxExtensionItemTitleLength; |
| static const size_t kMaxSelectionTextLength; |
| RenderViewContextMenu(content::WebContents* web_contents, |
| @@ -177,21 +177,16 @@ class RenderViewContextMenu : public ui::SimpleMenuModel::Delegate, |
| int command_id, |
| ui::Accelerator* accelerator) = 0; |
| - // Attempts to get an MenuItem given the id of a context menu item. |
| - extensions::MenuItem* GetExtensionMenuItem(int id) const; |
| - |
| content::ContextMenuParams params_; |
| content::WebContents* source_web_contents_; |
| Profile* profile_; |
| ui::SimpleMenuModel menu_model_; |
| + extensions::ContextMenuManager menu_manager_; |
|
asargent_no_longer_on_chrome
2012/09/10 20:25:20
nit: let's name this variable extension_items_ or
Marijn Kruisselbrink
2012/09/10 23:16:57
Done.
|
| // True if we are showing for an external tab contents. The default is false. |
| bool external_; |
| - // Maps the id from a context menu item to the MenuItem's internal id. |
| - std::map<int, extensions::MenuItem::Id> extension_item_map_; |
| - |
| private: |
| friend class RenderViewContextMenuTest; |
| @@ -201,11 +196,9 @@ class RenderViewContextMenu : public ui::SimpleMenuModel::Delegate, |
| const content::ContextMenuParams& params, |
| extensions::MenuItem::ContextList contexts, |
| const URLPatternSet& target_url_patterns); |
| - static extensions::MenuItem::List GetRelevantExtensionItems( |
| - const extensions::MenuItem::List& items, |
| + static bool MenuItemMatchesParams( |
| const content::ContextMenuParams& params, |
| - Profile* profile, |
| - bool can_cross_incognito); |
| + const extensions::MenuItem* item); |
| // Gets the extension (if any) associated with the WebContents that we're in. |
| const extensions::Extension* GetExtension() const; |
| @@ -232,20 +225,6 @@ class RenderViewContextMenu : public ui::SimpleMenuModel::Delegate, |
| void AppendBidiSubMenu(); |
| void AppendProtocolHandlerSubMenu(); |
| - // This is a helper function to append items for one particular extension. |
| - // The |index| parameter is used for assigning id's, and is incremented for |
| - // each item actually added. |
| - void AppendExtensionItems(const std::string& extension_id, int* index); |
| - |
| - // Used for recursively adding submenus of extension items. |
| - void RecursivelyAppendExtensionItems( |
| - const std::vector<extensions::MenuItem*>& items, |
| - bool can_cross_incognito, |
| - ui::SimpleMenuModel* menu_model, |
| - int* index); |
| - // This will set the icon on the most recently-added item in the menu_model_. |
| - void SetExtensionIcon(const std::string& extension_id); |
| - |
| // Opens the specified URL string in a new tab. The |frame_id| specifies the |
| // frame in which the context menu was displayed, or 0 if the menu action is |
| // independent of that frame (e.g. protocol handler settings). |