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

Unified Diff: content/renderer/render_view_impl.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
Index: content/renderer/render_view_impl.h
diff --git a/content/renderer/render_view_impl.h b/content/renderer/render_view_impl.h
index bf3aba06a16238e78b2501113b74821a3dd60190..1e5ca8705bd2daa512e38cfd1840be391b391da6 100644
--- a/content/renderer/render_view_impl.h
+++ b/content/renderer/render_view_impl.h
@@ -720,8 +720,9 @@ class RenderViewImpl : public RenderWidget,
virtual int GetEnabledBindings() const OVERRIDE;
virtual bool GetContentStateImmediately() const OVERRIDE;
virtual float GetFilteredTimePerFrame() const OVERRIDE;
- virtual void ShowContextMenu(WebKit::WebFrame* frame,
- const WebKit::WebContextMenuData& data) OVERRIDE;
+ virtual int ShowContextMenu(
+ content::ContextMenuClient* client,
+ const content::ContextMenuParams& params) OVERRIDE;
virtual WebKit::WebPageVisibilityState GetVisibilityState() const OVERRIDE;
virtual void RunModalAlertDialog(WebKit::WebFrame* frame,
const WebKit::WebString& message) OVERRIDE;
@@ -1340,6 +1341,20 @@ class RenderViewImpl : public RenderWidget,
size_t selection_text_offset_;
ui::Range selection_range_;
+ // External context menu requests we're waiting for. "Internal"
+ // (WebKit-originated) context menu events will have an ID of 0 and will not
+ // be in this map.
+ //
+ // We don't want to add internal ones since some of the "special" page
+ // handlers in the browser process just ignore the context menu requests so
+ // avoid showing context menus, and so this will cause right clicks to leak
+ // entries in this map. Most users of the custom context menu (e.g. Pepper
+ // plugins) are normally only on "regular" pages and the regular pages will
+ // always respond properly to the request, so we don't have to worry so
+ // much about leaks.
+ IDMap<content::ContextMenuClient, IDMapExternalPointer>
+ pending_context_menus_;
+
// View ----------------------------------------------------------------------
// Cache the preferred size of the page in order to prevent sending the IPC

Powered by Google App Engine
This is Rietveld 408576698