Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1108)

Unified Diff: content/public/renderer/render_view.h

Issue 11083002: Allow custom context menus to be requested. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/public/renderer/context_menu_client.h ('k') | content/public/renderer/render_view_observer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/public/renderer/render_view.h
diff --git a/content/public/renderer/render_view.h b/content/public/renderer/render_view.h
index 164acee29017ee78d562ff66fc79686b531a3a8a..222119f85bf51a310a70afcdfbf94de576d75882 100644
--- a/content/public/renderer/render_view.h
+++ b/content/public/renderer/render_view.h
@@ -38,7 +38,9 @@ struct WebPluginInfo;
namespace content {
+class ContextMenuClient;
class RenderViewVisitor;
+struct ContextMenuParams;
class CONTENT_EXPORT RenderView : public IPC::Sender {
public:
@@ -108,10 +110,17 @@ class CONTENT_EXPORT RenderView : public IPC::Sender {
// Filtered time per frame based on UpdateRect messages.
virtual float GetFilteredTimePerFrame() const = 0;
- // Shows a context menu with commands relevant to a specific element on
- // the given frame. Additional context data is supplied.
- virtual void ShowContextMenu(WebKit::WebFrame* frame,
- const WebKit::WebContextMenuData& data) = 0;
+ // Shows a context menu with the given information. The given client will
+ // be called with the result. The client pointer is owned by the caller and
+ // must remain valid as long as the RenderView is alive.
+ //
+ // The request ID will be returned by this function. This is passed to the
+ // client functions for identification.
+ //
+ // Note: if you end up having clients outliving the RenderView, we should add
+ // a CancelContextMenuCallback function that takes a request id.
+ virtual int ShowContextMenu(ContextMenuClient* client,
+ const ContextMenuParams& params) = 0;
// Returns the current visibility of the WebView.
virtual WebKit::WebPageVisibilityState GetVisibilityState() const = 0;
« no previous file with comments | « content/public/renderer/context_menu_client.h ('k') | content/public/renderer/render_view_observer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698