summaryrefslogtreecommitdiffstats
path: root/webkit/glue/plugins
diff options
context:
space:
mode:
authorcevans@chromium.org <cevans@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-12-09 05:24:30 +0000
committercevans@chromium.org <cevans@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-12-09 05:24:30 +0000
commit6a8b86ceacdc6060a788f8be5c09ba9d643ee5e1 (patch)
tree6058cb9ca68405fefc1499f907870995c487d7bb /webkit/glue/plugins
parentce1c3f726da89df5e0a947f824f8f00cab485866 (diff)
downloadchromium_src-6a8b86ceacdc6060a788f8be5c09ba9d643ee5e1.zip
chromium_src-6a8b86ceacdc6060a788f8be5c09ba9d643ee5e1.tar.gz
chromium_src-6a8b86ceacdc6060a788f8be5c09ba9d643ee5e1.tar.bz2
Implement a useful context menu for the blocked plug-in frame:
- Offers option to run plugin (clickjack-proof). - Offers option to hide blocking placeholder. - Retains Inspect Element; it's also useful to see the <embed>. BUG=NONE TEST=NONE Review URL: http://codereview.chromium.org/5639004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@68719 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue/plugins')
-rw-r--r--webkit/glue/plugins/webview_plugin.cc10
-rw-r--r--webkit/glue/plugins/webview_plugin.h6
2 files changed, 16 insertions, 0 deletions
diff --git a/webkit/glue/plugins/webview_plugin.cc b/webkit/glue/plugins/webview_plugin.cc
index 31403fe..e0f80e3 100644
--- a/webkit/glue/plugins/webview_plugin.cc
+++ b/webkit/glue/plugins/webview_plugin.cc
@@ -9,6 +9,7 @@
#include "third_party/WebKit/WebKit/chromium/public/WebCursorInfo.h"
#include "third_party/WebKit/WebKit/chromium/public/WebElement.h"
#include "third_party/WebKit/WebKit/chromium/public/WebFrame.h"
+#include "third_party/WebKit/WebKit/chromium/public/WebInputEvent.h"
#include "third_party/WebKit/WebKit/chromium/public/WebPluginContainer.h"
#include "third_party/WebKit/WebKit/chromium/public/WebSize.h"
#include "third_party/WebKit/WebKit/chromium/public/WebURL.h"
@@ -30,6 +31,7 @@ using WebKit::WebDragOperationsMask;
using WebKit::WebFrame;
using WebKit::WebImage;
using WebKit::WebInputEvent;
+using WebKit::WebMouseEvent;
using WebKit::WebPlugin;
using WebKit::WebPluginContainer;
using WebKit::WebPoint;
@@ -143,6 +145,14 @@ void WebViewPlugin::updateGeometry(
bool WebViewPlugin::handleInputEvent(const WebInputEvent& event,
WebCursorInfo& cursor) {
+ if (event.type == WebInputEvent::ContextMenu) {
+ if (delegate_) {
+ const WebMouseEvent& mouse_event =
+ reinterpret_cast<const WebMouseEvent&>(event);
+ delegate_->ShowContextMenu(mouse_event);
+ }
+ return true;
+ }
current_cursor_ = cursor;
bool handled = web_view_->handleInputEvent(event);
cursor = current_cursor_;
diff --git a/webkit/glue/plugins/webview_plugin.h b/webkit/glue/plugins/webview_plugin.h
index 95f32a5..ac89c85 100644
--- a/webkit/glue/plugins/webview_plugin.h
+++ b/webkit/glue/plugins/webview_plugin.h
@@ -17,6 +17,9 @@
#include "third_party/WebKit/WebKit/chromium/public/WebURLResponse.h"
#include "third_party/WebKit/WebKit/chromium/public/WebViewClient.h"
+namespace WebKit {
+class WebMouseEvent;
+}
struct WebPreferences;
// This class implements the WebPlugin interface by forwarding drawing and
@@ -39,6 +42,9 @@ class WebViewPlugin: public WebKit::WebPlugin, public WebKit::WebViewClient,
// Called before the WebViewPlugin is destroyed. The delegate should delete
// itself here.
virtual void WillDestroyPlugin() = 0;
+
+ // Called upon a context menu event.
+ virtual void ShowContextMenu(const WebKit::WebMouseEvent&) = 0;
};
explicit WebViewPlugin(Delegate* delegate);