summaryrefslogtreecommitdiffstats
path: root/chrome_frame/chrome_frame_plugin.h
diff options
context:
space:
mode:
authortwiz@google.com <twiz@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-07 20:34:42 +0000
committertwiz@google.com <twiz@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-07 20:34:42 +0000
commit01e79d8ddbff216a0a0c63f9cb20912c7bde48e1 (patch)
tree4115fb40bf83e012f30144c07136a1e3fd1d411b /chrome_frame/chrome_frame_plugin.h
parent445c603af13b1df1b6dfa311688354e1f6c85dd2 (diff)
downloadchromium_src-01e79d8ddbff216a0a0c63f9cb20912c7bde48e1.zip
chromium_src-01e79d8ddbff216a0a0c63f9cb20912c7bde48e1.tar.gz
chromium_src-01e79d8ddbff216a0a0c63f9cb20912c7bde48e1.tar.bz2
Simple change to the focus-stealing behaviour of CF in response to WM_NOTIFYPARENT messages. The hosted CF instance may have spawned a pop-up window. We do not want that pop-up window to lose focus/or dismiss itself when interacting with the CF instance as a result of the SetFocus(...) call here. To prevent this problem, we compare the root owner windows of the focus and plugin windows, instead of just testing !IsChild.
Reviewer note: The semantics of comparing root owner windows are slightly different from before. Will this modified test be safe for the purposes of the original test? BUG=None TEST=None Review URL: http://codereview.chromium.org/2063009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@58749 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame/chrome_frame_plugin.h')
-rw-r--r--chrome_frame/chrome_frame_plugin.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/chrome_frame/chrome_frame_plugin.h b/chrome_frame/chrome_frame_plugin.h
index d334ab3..9f3e0ac 100644
--- a/chrome_frame/chrome_frame_plugin.h
+++ b/chrome_frame/chrome_frame_plugin.h
@@ -178,7 +178,14 @@ END_MSG_MAP()
// browser that we now have the focus.
HWND focus = ::GetFocus();
HWND plugin_window = GetWindow();
- if (focus != plugin_window && !IsChild(plugin_window, focus)) {
+
+ // The Chrome-Frame instance may have launched a popup which currently
+ // has focus. Because experimental extension popups are top-level
+ // windows, we have to check that the focus has shifted to a window
+ // that does not share the same GA_ROOTOWNER as the plugin.
+ if (focus != plugin_window &&
+ ::GetAncestor(plugin_window, GA_ROOTOWNER) !=
+ ::GetAncestor(focus, GA_ROOTOWNER)) {
ignore_setfocus_ = true;
SetFocus(plugin_window);
ignore_setfocus_ = false;