diff options
author | darin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-20 07:11:33 +0000 |
---|---|---|
committer | darin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-20 07:11:33 +0000 |
commit | e325901c4335f18194ee4c03f6f768e5b9fb74ee (patch) | |
tree | 685c8daf56854f9f5f3c12be1fd14c75982a95d6 | |
parent | 6ac97bf5fb39946a9c224ddb07f233dc2c3eb66a (diff) | |
download | chromium_src-e325901c4335f18194ee4c03f6f768e5b9fb74ee.zip chromium_src-e325901c4335f18194ee4c03f6f768e5b9fb74ee.tar.gz chromium_src-e325901c4335f18194ee4c03f6f768e5b9fb74ee.tar.bz2 |
Add WebPlugin::acceptsInputEvents method.
This allows us to restore a windowless_ check that used to exist in
webplugin_impl.cc prior to r23797. The goal of this change is to not
handle input events for windowed plugins.
R=hbono
BUG=none
TEST=pending/plugins/iframe-shims.htm
Review URL: http://codereview.chromium.org/173114
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23808 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | webkit/api/public/WebPlugin.h | 1 | ||||
-rw-r--r-- | webkit/api/src/WebPluginContainerImpl.cpp | 3 | ||||
-rw-r--r-- | webkit/glue/webplugin_impl.cc | 4 | ||||
-rw-r--r-- | webkit/glue/webplugin_impl.h | 1 |
4 files changed, 9 insertions, 0 deletions
diff --git a/webkit/api/public/WebPlugin.h b/webkit/api/public/WebPlugin.h index 4c264d4..616af74 100644 --- a/webkit/api/public/WebPlugin.h +++ b/webkit/api/public/WebPlugin.h @@ -59,6 +59,7 @@ namespace WebKit { virtual void updateFocus(bool) = 0; virtual void updateVisibility(bool) = 0; + virtual bool acceptsInputEvents() = 0; virtual bool handleInputEvent(const WebInputEvent&, WebCursorInfo&) = 0; virtual void didReceiveResponse(const WebURLResponse&) = 0; diff --git a/webkit/api/src/WebPluginContainerImpl.cpp b/webkit/api/src/WebPluginContainerImpl.cpp index 3d60e25..19eae91 100644 --- a/webkit/api/src/WebPluginContainerImpl.cpp +++ b/webkit/api/src/WebPluginContainerImpl.cpp @@ -155,6 +155,9 @@ void WebPluginContainerImpl::hide() void WebPluginContainerImpl::handleEvent(Event* event) { + if (!m_webPlugin->acceptsInputEvents()) + return; + // The events we pass are defined at: // http://devedge-temp.mozilla.org/library/manuals/2002/plugin/1.0/structures5.html#1000000 // Don't take the documentation as truth, however. There are many cases diff --git a/webkit/glue/webplugin_impl.cc b/webkit/glue/webplugin_impl.cc index 4376881..4581daf 100644 --- a/webkit/glue/webplugin_impl.cc +++ b/webkit/glue/webplugin_impl.cc @@ -362,6 +362,10 @@ void WebPluginImpl::updateVisibility(bool visible) { webview->delegate()->DidMovePlugin(move); } +bool WebPluginImpl::acceptsInputEvents() { + return windowless_; +} + bool WebPluginImpl::handleInputEvent( const WebInputEvent& event, WebCursorInfo& cursor_info) { return delegate_->HandleInputEvent(event, &cursor_info); diff --git a/webkit/glue/webplugin_impl.h b/webkit/glue/webplugin_impl.h index bd58c0a..b64fa48 100644 --- a/webkit/glue/webplugin_impl.h +++ b/webkit/glue/webplugin_impl.h @@ -92,6 +92,7 @@ class WebPluginImpl : public WebPlugin, const WebKit::WebVector<WebKit::WebRect>& cut_outs); virtual void updateFocus(bool focused); virtual void updateVisibility(bool visible); + virtual bool acceptsInputEvents(); virtual bool handleInputEvent( const WebKit::WebInputEvent& event, WebKit::WebCursorInfo& cursor_info); virtual void didReceiveResponse(const WebKit::WebURLResponse& response); |