diff options
author | stuartmorgan@chromium.org <stuartmorgan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-01 22:02:49 +0000 |
---|---|---|
committer | stuartmorgan@chromium.org <stuartmorgan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-01 22:02:49 +0000 |
commit | f5b8436168143bc0a5900380d7dd6415f3c85e8a (patch) | |
tree | 37a1b0fe4c0629c0a3d94489b04fe102d57aee0a /webkit | |
parent | 5b855a6b9d61b10f8635cce0e187a1c162b5b428 (diff) | |
download | chromium_src-f5b8436168143bc0a5900380d7dd6415f3c85e8a.zip chromium_src-f5b8436168143bc0a5900380d7dd6415f3c85e8a.tar.gz chromium_src-f5b8436168143bc0a5900380d7dd6415f3c85e8a.tar.bz2 |
Consume Char events in Mac plugins
BUG=39546
TEST=Press space bar while a plugin has focus on a page that can scroll down. The page should not scroll.
Review URL: http://codereview.chromium.org/1570008
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@43391 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r-- | webkit/glue/plugins/webplugin_delegate_impl_mac.mm | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/webkit/glue/plugins/webplugin_delegate_impl_mac.mm b/webkit/glue/plugins/webplugin_delegate_impl_mac.mm index bf74453..90acc5f 100644 --- a/webkit/glue/plugins/webplugin_delegate_impl_mac.mm +++ b/webkit/glue/plugins/webplugin_delegate_impl_mac.mm @@ -1122,8 +1122,13 @@ bool WebPluginDelegateImpl::PlatformHandleInputEvent( NPEventModel event_model = instance()->event_model(); scoped_ptr<PluginWebEventConverter> event_converter( PluginWebEventConverterFactory::CreateConverterForModel(event_model)); - if (!(event_converter.get() && event_converter->InitWithEvent(event))) + if (!(event_converter.get() && event_converter->InitWithEvent(event))) { + // Silently consume any keyboard event types that we don't handle, so that + // they don't fall through to the page. + if (WebInputEvent::isKeyboardEventType(event.type)) + return true; return false; + } void* plugin_event = event_converter->plugin_event(); if (fabsf(zoom_level - 1.0) > kEpsilon) |