summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorstuartmorgan@chromium.org <stuartmorgan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-20 23:35:09 +0000
committerstuartmorgan@chromium.org <stuartmorgan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-20 23:35:09 +0000
commitbd937f834e75316e6cb240459a1782e2a7b9a980 (patch)
treeb70c318d84bc44090821357aa22ce4fd22289031
parent0f288ef9c27aa95841d5e457fbefb3201fd68749 (diff)
downloadchromium_src-bd937f834e75316e6cb240459a1782e2a7b9a980.zip
chromium_src-bd937f834e75316e6cb240459a1782e2a7b9a980.tar.gz
chromium_src-bd937f834e75316e6cb240459a1782e2a7b9a980.tar.bz2
Merge 45105 - Make Mac plugin _setWindowNumber: interception more focused
We interpose _setWindowNumber: because at the point where we intercept modal dialogs the window ID (which we need to pass to the browser process) hasn't been set yet. However, it also causes some falsepositives. This narrows our _setWindowNumber: handling so that it only happens for the next call after we've caught an explicit windowshowing call too early to get a window number. BUG=41936 TEST=Pluginopened windows (Flash fullscreen, Gmail attachments, etc.) should continue to change focus correctly. Review URL: http://codereview.chromium.org/1727001 TBR=stuartmorgan@chromium.org Review URL: http://codereview.chromium.org/1710002 git-svn-id: svn://svn.chromium.org/chrome/branches/375/src@45121 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/plugin/plugin_interpose_util_mac.mm13
1 files changed, 10 insertions, 3 deletions
diff --git a/chrome/plugin/plugin_interpose_util_mac.mm b/chrome/plugin/plugin_interpose_util_mac.mm
index e410ec1..10f1639 100644
--- a/chrome/plugin/plugin_interpose_util_mac.mm
+++ b/chrome/plugin/plugin_interpose_util_mac.mm
@@ -115,16 +115,20 @@ static void OnPluginWindowClosed(const WindowInfo& window_info) {
window_info.bounds);
}
+static BOOL g_waiting_for_window_number = NO;
+
static void OnPluginWindowShown(const WindowInfo& window_info, BOOL is_modal) {
// The window id is 0 if it has never been shown (including while it is the
// process of being shown for the first time); when that happens, we'll catch
// it in _setWindowNumber instead.
static BOOL s_pending_display_is_modal = NO;
if (window_info.window_id == 0) {
+ g_waiting_for_window_number = YES;
if (is_modal)
s_pending_display_is_modal = YES;
return;
}
+ g_waiting_for_window_number = NO;
if (s_pending_display_is_modal) {
is_modal = YES;
s_pending_display_is_modal = NO;
@@ -193,11 +197,14 @@ static void OnPluginWindowShown(const WindowInfo& window_info, BOOL is_modal) {
}
- (void)chromePlugin_setWindowNumber:(NSInteger)num {
- if (num > 0 && ![self chromePlugin_isPopupMenuWindow])
+ if (!g_waiting_for_window_number || num <= 0) {
+ [self chromePlugin_setWindowNumber:num];
+ return;
+ }
+ if (![self chromePlugin_isPopupMenuWindow])
mac_plugin_interposing::SwitchToPluginProcess();
[self chromePlugin_setWindowNumber:num];
- if (num > 0)
- OnPluginWindowShown(WindowInfo(self), NO);
+ OnPluginWindowShown(WindowInfo(self), NO);
}
@end