summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorstuartmorgan@chromium.org <stuartmorgan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-12 15:17:43 +0000
committerstuartmorgan@chromium.org <stuartmorgan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-12 15:17:43 +0000
commitd52b1d76428d4b0ee86888bc9dc15f2c5275fbaf (patch)
tree9cf13fbd6ea768739b7c9c0059444983d1fe3c50
parent61883442b46722b70143e7982f5723a5e34e341b (diff)
downloadchromium_src-d52b1d76428d4b0ee86888bc9dc15f2c5275fbaf.zip
chromium_src-d52b1d76428d4b0ee86888bc9dc15f2c5275fbaf.tar.gz
chromium_src-d52b1d76428d4b0ee86888bc9dc15f2c5275fbaf.tar.bz2
Add focus-loss messages for Windows and Linux plugins
BUG=None TEST=Focus a windowless plugin, then click on another element on the page; the plugin should no longer have focus. Review URL: http://codereview.chromium.org/2924001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@52082 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--webkit/glue/plugins/webplugin_delegate_impl_gtk.cc4
-rw-r--r--webkit/glue/plugins/webplugin_delegate_impl_win.cc4
2 files changed, 2 insertions, 6 deletions
diff --git a/webkit/glue/plugins/webplugin_delegate_impl_gtk.cc b/webkit/glue/plugins/webplugin_delegate_impl_gtk.cc
index 71df073..18b1504 100644
--- a/webkit/glue/plugins/webplugin_delegate_impl_gtk.cc
+++ b/webkit/glue/plugins/webplugin_delegate_impl_gtk.cc
@@ -487,12 +487,10 @@ void WebPluginDelegateImpl::WindowlessSetWindow() {
void WebPluginDelegateImpl::SetFocus(bool focused) {
DCHECK(instance()->windowless());
- if (!focused)
- return;
NPEvent np_event = {0};
XFocusChangeEvent &event = np_event.xfocus;
- event.type = FocusIn;
+ event.type = focused ? FocusIn : FocusOut;
event.display = GDK_DISPLAY();
// Same values as Firefox. .serial and .window stay 0.
event.mode = -1;
diff --git a/webkit/glue/plugins/webplugin_delegate_impl_win.cc b/webkit/glue/plugins/webplugin_delegate_impl_win.cc
index 87bb088..09184ab 100644
--- a/webkit/glue/plugins/webplugin_delegate_impl_win.cc
+++ b/webkit/glue/plugins/webplugin_delegate_impl_win.cc
@@ -1050,11 +1050,9 @@ void WebPluginDelegateImpl::WindowlessSetWindow() {
void WebPluginDelegateImpl::SetFocus(bool focused) {
DCHECK(instance()->windowless());
- if (!focused)
- return;
NPEvent focus_event;
- focus_event.event = WM_SETFOCUS;
+ focus_event.event = focused ? WM_SETFOCUS : WM_KILLFOCUS;
focus_event.wParam = 0;
focus_event.lParam = 0;