diff options
Diffstat (limited to 'webkit/glue')
-rw-r--r-- | webkit/glue/plugins/webview_plugin.cc | 10 | ||||
-rw-r--r-- | webkit/glue/plugins/webview_plugin.h | 6 |
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); |