| 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 <memory> | 9 #include <memory> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 bool is_checked); | 75 bool is_checked); |
| 76 | 76 |
| 77 // RenderViewContextMenuBase: | 77 // RenderViewContextMenuBase: |
| 78 bool IsCommandIdChecked(int command_id) const override; | 78 bool IsCommandIdChecked(int command_id) const override; |
| 79 bool IsCommandIdEnabled(int command_id) const override; | 79 bool IsCommandIdEnabled(int command_id) const override; |
| 80 void ExecuteCommand(int command_id, int event_flags) override; | 80 void ExecuteCommand(int command_id, int event_flags) override; |
| 81 void AddSpellCheckServiceItem(bool is_checked) override; | 81 void AddSpellCheckServiceItem(bool is_checked) override; |
| 82 | 82 |
| 83 protected: | 83 protected: |
| 84 Profile* GetProfile(); | 84 Profile* GetProfile(); |
| 85 Browser* GetBrowser() const; |
| 85 | 86 |
| 86 // Returns a (possibly truncated) version of the current selection text | 87 // Returns a (possibly truncated) version of the current selection text |
| 87 // suitable for putting in the title of a menu item. | 88 // suitable for putting in the title of a menu item. |
| 88 base::string16 PrintableSelectionText(); | 89 base::string16 PrintableSelectionText(); |
| 89 | 90 |
| 90 // Helper function to escape "&" as "&&". | 91 // Helper function to escape "&" as "&&". |
| 91 void EscapeAmpersands(base::string16* text); | 92 void EscapeAmpersands(base::string16* text); |
| 92 | 93 |
| 93 #if BUILDFLAG(ENABLE_EXTENSIONS) | 94 #if BUILDFLAG(ENABLE_EXTENSIONS) |
| 94 extensions::ContextMenuMatcher extension_items_; | 95 extensions::ContextMenuMatcher extension_items_; |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 197 void ExecProtocolHandlerSettings(int event_flags); | 198 void ExecProtocolHandlerSettings(int event_flags); |
| 198 | 199 |
| 199 // Writes the specified text/url to the system clipboard | 200 // Writes the specified text/url to the system clipboard |
| 200 void WriteURLToClipboard(const GURL& url); | 201 void WriteURLToClipboard(const GURL& url); |
| 201 | 202 |
| 202 void MediaPlayerActionAt(const gfx::Point& location, | 203 void MediaPlayerActionAt(const gfx::Point& location, |
| 203 const blink::WebMediaPlayerAction& action); | 204 const blink::WebMediaPlayerAction& action); |
| 204 void PluginActionAt(const gfx::Point& location, | 205 void PluginActionAt(const gfx::Point& location, |
| 205 const blink::WebPluginAction& action); | 206 const blink::WebPluginAction& action); |
| 206 | 207 |
| 207 Browser* GetBrowser() const; | |
| 208 | |
| 209 // Returns a list of registered ProtocolHandlers that can handle the clicked | 208 // Returns a list of registered ProtocolHandlers that can handle the clicked |
| 210 // on URL. | 209 // on URL. |
| 211 ProtocolHandlerRegistry::ProtocolHandlerList GetHandlersForLinkUrl(); | 210 ProtocolHandlerRegistry::ProtocolHandlerList GetHandlersForLinkUrl(); |
| 212 | 211 |
| 213 // The destination URL to use if the user tries to search for or navigate to | 212 // The destination URL to use if the user tries to search for or navigate to |
| 214 // a text selection. | 213 // a text selection. |
| 215 GURL selection_navigation_url_; | 214 GURL selection_navigation_url_; |
| 216 | 215 |
| 217 ui::SimpleMenuModel profile_link_submenu_model_; | 216 ui::SimpleMenuModel profile_link_submenu_model_; |
| 218 std::vector<base::FilePath> profile_link_paths_; | 217 std::vector<base::FilePath> profile_link_paths_; |
| (...skipping 24 matching lines...) Expand all Loading... |
| 243 | 242 |
| 244 // In the case of a MimeHandlerView this will point to the WebContents that | 243 // In the case of a MimeHandlerView this will point to the WebContents that |
| 245 // embeds the MimeHandlerViewGuest. Otherwise this will be the same as | 244 // embeds the MimeHandlerViewGuest. Otherwise this will be the same as |
| 246 // |source_web_contents_|. | 245 // |source_web_contents_|. |
| 247 content::WebContents* const embedder_web_contents_; | 246 content::WebContents* const embedder_web_contents_; |
| 248 | 247 |
| 249 DISALLOW_COPY_AND_ASSIGN(RenderViewContextMenu); | 248 DISALLOW_COPY_AND_ASSIGN(RenderViewContextMenu); |
| 250 }; | 249 }; |
| 251 | 250 |
| 252 #endif // CHROME_BROWSER_RENDERER_CONTEXT_MENU_RENDER_VIEW_CONTEXT_MENU_H_ | 251 #endif // CHROME_BROWSER_RENDERER_CONTEXT_MENU_RENDER_VIEW_CONTEXT_MENU_H_ |
| OLD | NEW |