summaryrefslogtreecommitdiffstats
path: root/chrome/renderer/render_view.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/render_view.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/render_view.cc')
-rw-r--r--chrome/renderer/render_view.cc10
1 files changed, 6 insertions, 4 deletions
diff --git a/chrome/renderer/render_view.cc b/chrome/renderer/render_view.cc
index da1bea90..d3c1744 100644
--- a/chrome/renderer/render_view.cc
+++ b/chrome/renderer/render_view.cc
@@ -4801,13 +4801,15 @@ void RenderView::OnWasRestored(bool needs_repainting) {
void RenderView::OnSetFocus(bool enable) {
RenderWidget::OnSetFocus(enable);
- // RenderWidget's call to setFocus can cause the underlying webview's
- // activation state to change just like a call to setIsActive.
- if (enable && webview() && webview()->isActive()) {
+ if (webview() && webview()->isActive()) {
std::set<WebPluginDelegateProxy*>::iterator plugin_it;
for (plugin_it = plugin_delegates_.begin();
plugin_it != plugin_delegates_.end(); ++plugin_it) {
- (*plugin_it)->SetWindowFocus(true);
+ // RenderWidget's call to setFocus can cause the underlying webview's
+ // activation state to change just like a call to setIsActive.
+ if (enable)
+ (*plugin_it)->SetWindowFocus(true);
+ (*plugin_it)->SetContentAreaFocus(enable);
}
}
}