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

Unified Diff: webkit/api/src/WebPluginContainerImpl.cpp

Issue 269084: Allow keyboard input to work in Mac plugins.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 2 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 | « webkit/api/src/WebInputEventConversion.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/api/src/WebPluginContainerImpl.cpp
===================================================================
--- webkit/api/src/WebPluginContainerImpl.cpp (revision 29397)
+++ webkit/api/src/WebPluginContainerImpl.cpp (working copy)
@@ -350,11 +350,23 @@
containingFrame->document()->setFocusedNode(m_element);
}
+ WebCursorInfo cursorInfo;
+ bool handled = m_webPlugin->handleInputEvent(webEvent, cursorInfo);
+#if !PLATFORM(DARWIN)
// TODO(pkasting): http://b/1119691 This conditional seems exactly
- // backwards, but it matches Safari's code, and if I reverse it, giving
- // focus to a transparent (windowless) plugin fails.
- WebCursorInfo cursorInfo;
- if (!m_webPlugin->handleInputEvent(webEvent, cursorInfo))
+ // backwards, but if I reverse it, giving focus to a transparent
+ // (windowless) plugin fails.
+ handled = !handled;
+ // TODO(awalker): oddly, the above is not true in Mac builds. Looking
+ // at Apple's corresponding code for Mac and Windows (PluginViewMac and
+ // PluginViewWin), setDefaultHandled() gets called when handleInputEvent()
+ // returns true, which then indicates to WebCore that the plugin wants to
+ // swallow the event--which is what we want. Calling setDefaultHandled()
+ // fixes several Mac Chromium bugs, but does indeed prevent windowless plugins
+ // from getting focus in Windows builds, as pkasting notes above. So for
+ // now, we only do so in Mac builds.
+#endif
+ if (handled)
event->setDefaultHandled();
// A windowless plugin can change the cursor in response to a mouse move
@@ -369,9 +381,13 @@
if (webEvent.type == WebInputEvent::Undefined)
return;
+ WebCursorInfo cursor_info;
+ bool handled = m_webPlugin->handleInputEvent(webEvent, cursor_info);
+#if !PLATFORM(DARWIN)
// TODO(pkasting): http://b/1119691 See above.
- WebCursorInfo cursor_info;
- if (!m_webPlugin->handleInputEvent(webEvent, cursor_info))
+ handled = !handled;
+#endif
+ if (handled)
event->setDefaultHandled();
}
« no previous file with comments | « webkit/api/src/WebInputEventConversion.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698