| 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 fc6a80b5b6c3f3f599e3e13e92912fab4753f539..b50b29203f8b02ce1c24893914f99f4a158bd695 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_matcher.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,
|
| @@ -178,21 +178,16 @@ class RenderViewContextMenu : public ui::SimpleMenuModel::Delegate,
|
| ui::Accelerator* accelerator) = 0;
|
| virtual void AppendPlatformEditableItems();
|
|
|
| - // 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::ContextMenuMatcher extension_items_;
|
|
|
| // 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;
|
|
|
| @@ -202,11 +197,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;
|
| @@ -231,20 +224,6 @@ class RenderViewContextMenu : public ui::SimpleMenuModel::Delegate,
|
| void AppendSpeechInputOptionsSubMenu();
|
| 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).
|
|
|