diff options
author | stuartmorgan@chromium.org <stuartmorgan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-24 14:39:42 +0000 |
---|---|---|
committer | stuartmorgan@chromium.org <stuartmorgan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-24 14:39:42 +0000 |
commit | 32c5626f902813453bc20ff0bf8449f88d443141 (patch) | |
tree | 99f5d23e16ba5fd0c77c54dc64d2077edc3835cd | |
parent | 434c0eb886cf13bcaa77652c9bfb104dc04f5e9e (diff) | |
download | chromium_src-32c5626f902813453bc20ff0bf8449f88d443141.zip chromium_src-32c5626f902813453bc20ff0bf8449f88d443141.tar.gz chromium_src-32c5626f902813453bc20ff0bf8449f88d443141.tar.bz2 |
Explicitly don't handle scroll events to Carbon plugins
The Carbon NPAPI event model doesn't have a concept of scroll wheel events; tweak the handling logic and logging so that scrolls over Carbon plugins don't generate tons of warning spew.
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/1207002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@42466 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | webkit/glue/plugins/webplugin_delegate_impl_mac.mm | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/webkit/glue/plugins/webplugin_delegate_impl_mac.mm b/webkit/glue/plugins/webplugin_delegate_impl_mac.mm index b789dda9..5996d33 100644 --- a/webkit/glue/plugins/webplugin_delegate_impl_mac.mm +++ b/webkit/glue/plugins/webplugin_delegate_impl_mac.mm @@ -914,14 +914,16 @@ static bool NPEventFromWebKeyboardEvent(const WebKeyboardEvent& event, static bool NPEventFromWebInputEvent(const WebInputEvent& event, NPEvent* np_event) { np_event->when = TickCount(); - if (WebInputEventIsWebMouseEvent(event)) { + if (event.type == WebInputEvent::MouseWheel) { + return false; // Carbon NPAPI event model has no "mouse wheel" concept. + } else if (WebInputEventIsWebMouseEvent(event)) { return NPEventFromWebMouseEvent(*static_cast<const WebMouseEvent*>(&event), np_event); } else if (WebInputEventIsWebKeyboardEvent(event)) { return NPEventFromWebKeyboardEvent( *static_cast<const WebKeyboardEvent*>(&event), np_event); } - DLOG(WARNING) << "unknown event type" << event.type; + DLOG(WARNING) << "unknown event type " << event.type; return false; } #endif // !NP_NO_CARBON @@ -1186,20 +1188,16 @@ bool WebPluginDelegateImpl::PlatformHandleInputEvent( #ifndef NP_NO_CARBON case NPEventModelCarbon: { NPEvent np_event = {0}; - if (!NPEventFromWebInputEvent(event, &np_event)) { - LOG(WARNING) << "NPEventFromWebInputEvent failed"; + if (!NPEventFromWebInputEvent(event, &np_event)) return false; - } ret = instance()->NPP_HandleEvent(&np_event) != 0; break; } #endif case NPEventModelCocoa: { NPCocoaEvent np_cocoa_event; - if (!NPCocoaEventFromWebInputEvent(event, &np_cocoa_event)) { - LOG(WARNING) << "NPCocoaEventFromWebInputEvent failed"; + if (!NPCocoaEventFromWebInputEvent(event, &np_cocoa_event)) return false; - } // Keep track of whether or not we are in a drag that started outside the // plugin; if we are, filter out drag-related events (and convert the end |