Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(19)

Unified Diff: webkit/glue/plugins/webplugin_delegate_impl_mac.mm

Issue 2811006: Always report keypresses in plugins as handled on the Mac (Closed)
Patch Set: Created 10 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/glue/plugins/webplugin_delegate_impl_mac.mm
diff --git a/webkit/glue/plugins/webplugin_delegate_impl_mac.mm b/webkit/glue/plugins/webplugin_delegate_impl_mac.mm
index e0f479e79d9944248b5c4672d8aa6d6d3c19d76b..ce09fdb186c600b1ede3f93ba69e0c8f5b0ff070 100644
--- a/webkit/glue/plugins/webplugin_delegate_impl_mac.mm
+++ b/webkit/glue/plugins/webplugin_delegate_impl_mac.mm
@@ -620,12 +620,19 @@ bool WebPluginDelegateImpl::PlatformHandleInputEvent(
}
bool handled = instance()->NPP_HandleEvent(plugin_event) != 0;
+ // Plugins don't give accurate information about whether or not they handled
+ // events, so browsers on the Mac ignore the return value.
+ // Scroll events are the exception, since the Cocoa spec defines a meaning
+ // for the return value.
if (WebInputEvent::isMouseEventType(event.type)) {
- // Plugins are not good about giving accurate information about whether or
- // not they handled events, and other browsers on the Mac generally ignore
- // the return value. We may need to expand this to other input types, but
- // we'll need to be careful about things like Command-keys.
handled = true;
+ } else if (WebInputEvent::isKeyboardEventType(event.type)) {
+ // For Command-key events, trust the return value since eating all menu
+ // shortcuts is not ideal.
+ // TODO(stuartmorgan): Implement the advanced key handling spec, and trust
+ // trust the key event return value from plugins that implement it.
+ if (!(event.modifiers & WebInputEvent::MetaKey))
+ handled = true;
}
return handled;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698