summaryrefslogtreecommitdiffstats
path: root/chrome/renderer/webplugin_delegate_proxy.cc
diff options
context:
space:
mode:
authorstuartmorgan@chromium.org <stuartmorgan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-05 23:10:31 +0000
committerstuartmorgan@chromium.org <stuartmorgan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-05 23:10:31 +0000
commit7d3c02c0eaf7d4cf7becfe869c6b4030ded6293a (patch)
tree83cb9e4813a07021c771e625d036a5d0a9188dfe /chrome/renderer/webplugin_delegate_proxy.cc
parentf3692bc59a04276845ae33f0d2e98f4738b38525 (diff)
downloadchromium_src-7d3c02c0eaf7d4cf7becfe869c6b4030ded6293a.zip
chromium_src-7d3c02c0eaf7d4cf7becfe869c6b4030ded6293a.tar.gz
chromium_src-7d3c02c0eaf7d4cf7becfe869c6b4030ded6293a.tar.bz2
Update Mac plugins for SetFocus changes, and remove old workaround messages
Now that WebKit is sending unfocus events, rework Mac plugins to correctly track plugin focus as a function of WebKit element focus and window-level view focus. Remove message plumbing for the old workarounds that were used to partially simulate focus switching for Mac plugins. Windows and Linux will currently ignore the new focus loss notifications so their behavior is unchanged. BUG=32721 TEST=Mac plugins should stop reacting to keyboard events once another control on the page, or the omnibox, is focused. They should also regain keyboard focus when switching back to their tab if they had it when the tab was hidden. Review URL: http://codereview.chromium.org/1736007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@46516 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer/webplugin_delegate_proxy.cc')
-rw-r--r--chrome/renderer/webplugin_delegate_proxy.cc15
1 files changed, 12 insertions, 3 deletions
diff --git a/chrome/renderer/webplugin_delegate_proxy.cc b/chrome/renderer/webplugin_delegate_proxy.cc
index 5ff3e68..2a54c6d 100644
--- a/chrome/renderer/webplugin_delegate_proxy.cc
+++ b/chrome/renderer/webplugin_delegate_proxy.cc
@@ -939,8 +939,8 @@ void WebPluginDelegateProxy::DidFinishLoadWithReason(
instance_id_, url, reason, notify_id));
}
-void WebPluginDelegateProxy::SetFocus() {
- Send(new PluginMsg_SetFocus(instance_id_));
+void WebPluginDelegateProxy::SetFocus(bool focused) {
+ Send(new PluginMsg_SetFocus(instance_id_, focused));
}
bool WebPluginDelegateProxy::HandleInputEvent(
@@ -968,7 +968,16 @@ int WebPluginDelegateProxy::GetProcessId() {
void WebPluginDelegateProxy::SetWindowFocus(bool window_has_focus) {
IPC::Message* msg = new PluginMsg_SetWindowFocus(instance_id_,
window_has_focus);
- // Make sure visibility events are delivered in the right order relative to
+ // Make sure focus events are delivered in the right order relative to
+ // sync messages they might interact with (Paint, HandleEvent, etc.).
+ msg->set_unblock(true);
+ Send(msg);
+}
+
+void WebPluginDelegateProxy::SetContentAreaFocus(bool has_focus) {
+ IPC::Message* msg = new PluginMsg_SetContentAreaFocus(instance_id_,
+ has_focus);
+ // Make sure focus events are delivered in the right order relative to
// sync messages they might interact with (Paint, HandleEvent, etc.).
msg->set_unblock(true);
Send(msg);