| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_RENDERER_CONTEXT_MENU_RENDER_VIEW_CONTEXT_MENU_H_ | 5 #ifndef CHROME_BROWSER_RENDERER_CONTEXT_MENU_RENDER_VIEW_CONTEXT_MENU_H_ |
| 6 #define CHROME_BROWSER_RENDERER_CONTEXT_MENU_RENDER_VIEW_CONTEXT_MENU_H_ | 6 #define CHROME_BROWSER_RENDERER_CONTEXT_MENU_RENDER_VIEW_CONTEXT_MENU_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 namespace blink { | 44 namespace blink { |
| 45 struct WebMediaPlayerAction; | 45 struct WebMediaPlayerAction; |
| 46 struct WebPluginAction; | 46 struct WebPluginAction; |
| 47 } | 47 } |
| 48 | 48 |
| 49 class RenderViewContextMenu : public RenderViewContextMenuBase { | 49 class RenderViewContextMenu : public RenderViewContextMenuBase { |
| 50 public: | 50 public: |
| 51 RenderViewContextMenu(content::RenderFrameHost* render_frame_host, | 51 RenderViewContextMenu(content::RenderFrameHost* render_frame_host, |
| 52 const content::ContextMenuParams& params); | 52 const content::ContextMenuParams& params); |
| 53 | 53 |
| 54 virtual ~RenderViewContextMenu(); | 54 ~RenderViewContextMenu() override; |
| 55 | 55 |
| 56 // SimpleMenuModel::Delegate: | 56 // SimpleMenuModel::Delegate: |
| 57 virtual bool IsCommandIdChecked(int command_id) const override; | 57 bool IsCommandIdChecked(int command_id) const override; |
| 58 virtual bool IsCommandIdEnabled(int command_id) const override; | 58 bool IsCommandIdEnabled(int command_id) const override; |
| 59 virtual void ExecuteCommand(int command_id, int event_flags) override; | 59 void ExecuteCommand(int command_id, int event_flags) override; |
| 60 | 60 |
| 61 protected: | 61 protected: |
| 62 Profile* GetProfile(); | 62 Profile* GetProfile(); |
| 63 extensions::ContextMenuMatcher extension_items_; | 63 extensions::ContextMenuMatcher extension_items_; |
| 64 | 64 |
| 65 private: | 65 private: |
| 66 friend class RenderViewContextMenuTest; | 66 friend class RenderViewContextMenuTest; |
| 67 friend class RenderViewContextMenuPrefsTest; | 67 friend class RenderViewContextMenuPrefsTest; |
| 68 | 68 |
| 69 static bool IsDevToolsURL(const GURL& url); | 69 static bool IsDevToolsURL(const GURL& url); |
| 70 static bool IsInternalResourcesURL(const GURL& url); | 70 static bool IsInternalResourcesURL(const GURL& url); |
| 71 static bool ExtensionContextAndPatternMatch( | 71 static bool ExtensionContextAndPatternMatch( |
| 72 const content::ContextMenuParams& params, | 72 const content::ContextMenuParams& params, |
| 73 const extensions::MenuItem::ContextList& contexts, | 73 const extensions::MenuItem::ContextList& contexts, |
| 74 const extensions::URLPatternSet& target_url_patterns); | 74 const extensions::URLPatternSet& target_url_patterns); |
| 75 static bool MenuItemMatchesParams(const content::ContextMenuParams& params, | 75 static bool MenuItemMatchesParams(const content::ContextMenuParams& params, |
| 76 const extensions::MenuItem* item); | 76 const extensions::MenuItem* item); |
| 77 | 77 |
| 78 // RenderViewContextMenuBase: | 78 // RenderViewContextMenuBase: |
| 79 virtual void InitMenu() override; | 79 void InitMenu() override; |
| 80 virtual void RecordShownItem(int id) override; | 80 void RecordShownItem(int id) override; |
| 81 virtual void RecordUsedItem(int id) override; | 81 void RecordUsedItem(int id) override; |
| 82 #if defined(ENABLE_PLUGINS) | 82 #if defined(ENABLE_PLUGINS) |
| 83 virtual void HandleAuthorizeAllPlugins() override; | 83 void HandleAuthorizeAllPlugins() override; |
| 84 #endif | 84 #endif |
| 85 virtual void NotifyMenuShown() override; | 85 void NotifyMenuShown() override; |
| 86 virtual void NotifyURLOpened(const GURL& url, | 86 void NotifyURLOpened(const GURL& url, |
| 87 content::WebContents* new_contents) override; | 87 content::WebContents* new_contents) override; |
| 88 | 88 |
| 89 // Gets the extension (if any) associated with the WebContents that we're in. | 89 // Gets the extension (if any) associated with the WebContents that we're in. |
| 90 const extensions::Extension* GetExtension() const; | 90 const extensions::Extension* GetExtension() const; |
| 91 | 91 |
| 92 void AppendDeveloperItems(); | 92 void AppendDeveloperItems(); |
| 93 void AppendDevtoolsForUnpackedExtensions(); | 93 void AppendDevtoolsForUnpackedExtensions(); |
| 94 void AppendLinkItems(); | 94 void AppendLinkItems(); |
| 95 void AppendImageItems(); | 95 void AppendImageItems(); |
| 96 void AppendAudioItems(); | 96 void AppendAudioItems(); |
| 97 void AppendCanvasItems(); | 97 void AppendCanvasItems(); |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 | 155 |
| 156 #if defined(ENABLE_FULL_PRINTING) | 156 #if defined(ENABLE_FULL_PRINTING) |
| 157 // An observer that disables menu items when print preview is active. | 157 // An observer that disables menu items when print preview is active. |
| 158 scoped_ptr<PrintPreviewContextMenuObserver> print_preview_menu_observer_; | 158 scoped_ptr<PrintPreviewContextMenuObserver> print_preview_menu_observer_; |
| 159 #endif | 159 #endif |
| 160 | 160 |
| 161 DISALLOW_COPY_AND_ASSIGN(RenderViewContextMenu); | 161 DISALLOW_COPY_AND_ASSIGN(RenderViewContextMenu); |
| 162 }; | 162 }; |
| 163 | 163 |
| 164 #endif // CHROME_BROWSER_RENDERER_CONTEXT_MENU_RENDER_VIEW_CONTEXT_MENU_H_ | 164 #endif // CHROME_BROWSER_RENDERER_CONTEXT_MENU_RENDER_VIEW_CONTEXT_MENU_H_ |
| OLD | NEW |