summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordarin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-22 21:34:52 +0000
committerdarin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-22 21:34:52 +0000
commit6a9210a9f8e6416ac2b6f016ce9465ce0e8479c5 (patch)
tree82e703af53b60f9a1c0d527a661c27a158c03bbb
parented0cd3234ce8cbfdbf98a824d4a8f868734c5f86 (diff)
downloadchromium_src-6a9210a9f8e6416ac2b6f016ce9465ce0e8479c5.zip
chromium_src-6a9210a9f8e6416ac2b6f016ce9465ce0e8479c5.tar.gz
chromium_src-6a9210a9f8e6416ac2b6f016ce9465ce0e8479c5.tar.bz2
Swallow context menu events dispatched to a NPAPI plugin so that
WebKit prevents the default context menu from being rendered. Depends on: https://bugs.webkit.org/show_bug.cgi?id=42808 R=stuartmorgan BUG=48129 TEST=none Review URL: http://codereview.chromium.org/2858065 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@53389 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--webkit/glue/plugins/webplugin_impl.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/webkit/glue/plugins/webplugin_impl.cc b/webkit/glue/plugins/webplugin_impl.cc
index 1660ede..d93cf1e 100644
--- a/webkit/glue/plugins/webplugin_impl.cc
+++ b/webkit/glue/plugins/webplugin_impl.cc
@@ -340,6 +340,10 @@ bool WebPluginImpl::acceptsInputEvents() {
bool WebPluginImpl::handleInputEvent(
const WebInputEvent& event, WebCursorInfo& cursor_info) {
+ // Swallow context menu events in order to suppress the default context menu.
+ if (event.type == WebInputEvent::ContextMenu)
+ return true;
+
return delegate_->HandleInputEvent(event, &cursor_info);
}