summaryrefslogtreecommitdiffstats
path: root/webkit
diff options
context:
space:
mode:
authorstuartmorgan@chromium.org <stuartmorgan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-26 01:40:02 +0000
committerstuartmorgan@chromium.org <stuartmorgan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-26 01:40:02 +0000
commit673590a92d94c9fac62a3984f31e89461bde5054 (patch)
tree75e9e80eba5ddb7c91421d893b92b6fcd15a66c1 /webkit
parent037c70024e20282ce23b5e6297bea87b795c8dec (diff)
downloadchromium_src-673590a92d94c9fac62a3984f31e89461bde5054.zip
chromium_src-673590a92d94c9fac62a3984f31e89461bde5054.tar.gz
chromium_src-673590a92d94c9fac62a3984f31e89461bde5054.tar.bz2
Fix order of calls in Mac plugin HandleInputEvent
Restore the pre-reorganization order of these calls, since they make more sense this way. Probably not actually the cause of bug 32749, but it's *possible* that events were getting in at the wrong time and causing the plugin to behave badly. BUG=32749 TEST=none Review URL: http://codereview.chromium.org/556015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@37079 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r--webkit/glue/plugins/webplugin_delegate_impl_mac.mm24
1 files changed, 14 insertions, 10 deletions
diff --git a/webkit/glue/plugins/webplugin_delegate_impl_mac.mm b/webkit/glue/plugins/webplugin_delegate_impl_mac.mm
index f7ef0af..205c874 100644
--- a/webkit/glue/plugins/webplugin_delegate_impl_mac.mm
+++ b/webkit/glue/plugins/webplugin_delegate_impl_mac.mm
@@ -818,12 +818,13 @@ bool WebPluginDelegateImpl::HandleInputEvent(const WebInputEvent& event,
DCHECK(windowless_) << "events should only be received in windowless mode";
DCHECK(cursor != NULL);
- // if we do not currently have focus and this is a mouseDown, trigger a
- // notification that we are taking the keyboard focus. We can't just key
- // off of incoming calls to SetFocus, since WebKit may already think we
- // have it if we were the most recently focused element on our parent tab.
- if (event.type == WebInputEvent::MouseDown && !have_focus_)
- SetFocus();
+#ifndef NP_NO_CARBON
+ if (instance()->event_model() == NPEventModelCarbon &&
+ !cg_context_.context) {
+ // If we somehow get an event before we've set up the plugin window, bail.
+ return false;
+ }
+#endif
if (WebInputEventIsWebMouseEvent(event)) {
// Make sure we update our plugin location tracking before we send the
@@ -836,12 +837,15 @@ bool WebPluginDelegateImpl::HandleInputEvent(const WebInputEvent& event,
current_windowless_cursor_.GetCursorInfo(cursor);
}
+ // if we do not currently have focus and this is a mouseDown, trigger a
+ // notification that we are taking the keyboard focus. We can't just key
+ // off of incoming calls to SetFocus, since WebKit may already think we
+ // have it if we were the most recently focused element on our parent tab.
+ if (event.type == WebInputEvent::MouseDown && !have_focus_)
+ SetFocus();
+
#ifndef NP_NO_CARBON
if (instance()->event_model() == NPEventModelCarbon) {
- // If we somehow get an event before we've set up the plugin window, bail.
- if (!cg_context_.context)
- return false;
-
if (event.type == WebInputEvent::MouseMove) {
return true; // The recurring OnNull will send null events.
}