| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_TAB_CONTENTS_RENDER_VIEW_CONTEXT_MENU_H_ | 5 #ifndef CHROME_BROWSER_TAB_CONTENTS_RENDER_VIEW_CONTEXT_MENU_H_ |
| 6 #define CHROME_BROWSER_TAB_CONTENTS_RENDER_VIEW_CONTEXT_MENU_H_ | 6 #define CHROME_BROWSER_TAB_CONTENTS_RENDER_VIEW_CONTEXT_MENU_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <map> | 9 #include <map> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 class TabContents; | 29 class TabContents; |
| 30 class SpellingMenuObserver; | 30 class SpellingMenuObserver; |
| 31 class SpellCheckerSubMenuObserver; | 31 class SpellCheckerSubMenuObserver; |
| 32 | 32 |
| 33 namespace gfx { | 33 namespace gfx { |
| 34 class Point; | 34 class Point; |
| 35 } | 35 } |
| 36 | 36 |
| 37 namespace WebKit { | 37 namespace WebKit { |
| 38 struct WebMediaPlayerAction; | 38 struct WebMediaPlayerAction; |
| 39 struct WebPluginAction; |
| 39 } | 40 } |
| 40 | 41 |
| 41 // An interface that controls a RenderViewContextMenu instance from observers. | 42 // An interface that controls a RenderViewContextMenu instance from observers. |
| 42 // This interface is designed mainly for controlling the instance while showing | 43 // This interface is designed mainly for controlling the instance while showing |
| 43 // so we can add a context-menu item that takes long time to create its text, | 44 // so we can add a context-menu item that takes long time to create its text, |
| 44 // such as retrieving the item text from a server. The simplest usage is: | 45 // such as retrieving the item text from a server. The simplest usage is: |
| 45 // 1. Adding an item with temporary text; | 46 // 1. Adding an item with temporary text; |
| 46 // 2. Posting a background task that creates the item text, and; | 47 // 2. Posting a background task that creates the item text, and; |
| 47 // 3. Calling UpdateMenuItem() in the callback function. | 48 // 3. Calling UpdateMenuItem() in the callback function. |
| 48 // The following snippet describes the simple usage that updates a context-menu | 49 // The following snippet describes the simple usage that updates a context-menu |
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 236 | 237 |
| 237 // Launch the inspector targeting a point in the RenderView | 238 // Launch the inspector targeting a point in the RenderView |
| 238 void Inspect(int x, int y); | 239 void Inspect(int x, int y); |
| 239 | 240 |
| 240 // Writes the specified text/url to the system clipboard | 241 // Writes the specified text/url to the system clipboard |
| 241 void WriteURLToClipboard(const GURL& url); | 242 void WriteURLToClipboard(const GURL& url); |
| 242 | 243 |
| 243 void MediaPlayerActionAt(const gfx::Point& location, | 244 void MediaPlayerActionAt(const gfx::Point& location, |
| 244 const WebKit::WebMediaPlayerAction& action); | 245 const WebKit::WebMediaPlayerAction& action); |
| 245 | 246 |
| 247 void PluginAction(const WebKit::WebPluginAction& action); |
| 248 |
| 246 bool IsDevCommandEnabled(int id) const; | 249 bool IsDevCommandEnabled(int id) const; |
| 247 | 250 |
| 248 // Returns a list of registered ProtocolHandlers that can handle the clicked | 251 // Returns a list of registered ProtocolHandlers that can handle the clicked |
| 249 // on URL. | 252 // on URL. |
| 250 ProtocolHandlerRegistry::ProtocolHandlerList GetHandlersForLinkUrl(); | 253 ProtocolHandlerRegistry::ProtocolHandlerList GetHandlersForLinkUrl(); |
| 251 | 254 |
| 252 // Returns a (possibly truncated) version of the current selection text | 255 // Returns a (possibly truncated) version of the current selection text |
| 253 // suitable or putting in the title of a menu item. | 256 // suitable or putting in the title of a menu item. |
| 254 string16 PrintableSelectionText(); | 257 string16 PrintableSelectionText(); |
| 255 | 258 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 272 // An observer that disables menu items when print preview is active. | 275 // An observer that disables menu items when print preview is active. |
| 273 scoped_ptr<PrintPreviewContextMenuObserver> print_preview_menu_observer_; | 276 scoped_ptr<PrintPreviewContextMenuObserver> print_preview_menu_observer_; |
| 274 | 277 |
| 275 // Our observers. | 278 // Our observers. |
| 276 mutable ObserverList<RenderViewContextMenuObserver> observers_; | 279 mutable ObserverList<RenderViewContextMenuObserver> observers_; |
| 277 | 280 |
| 278 DISALLOW_COPY_AND_ASSIGN(RenderViewContextMenu); | 281 DISALLOW_COPY_AND_ASSIGN(RenderViewContextMenu); |
| 279 }; | 282 }; |
| 280 | 283 |
| 281 #endif // CHROME_BROWSER_TAB_CONTENTS_RENDER_VIEW_CONTEXT_MENU_H_ | 284 #endif // CHROME_BROWSER_TAB_CONTENTS_RENDER_VIEW_CONTEXT_MENU_H_ |
| OLD | NEW |