summaryrefslogtreecommitdiffstats
path: root/chrome/browser/ui/cocoa/browser_window_cocoa.mm
diff options
context:
space:
mode:
authorwez@chromium.org <wez@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-12 22:24:27 +0000
committerwez@chromium.org <wez@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-12 22:24:27 +0000
commit60f9429c9d7f084d2371d2a81a6eaaeba69bcf54 (patch)
treeb926b117510682b9ea2a8bee4825611871684814 /chrome/browser/ui/cocoa/browser_window_cocoa.mm
parent4f77d88ca1dd30123e23d505e8344073236b891b (diff)
downloadchromium_src-60f9429c9d7f084d2371d2a81a6eaaeba69bcf54.zip
chromium_src-60f9429c9d7f084d2371d2a81a6eaaeba69bcf54.tar.gz
chromium_src-60f9429c9d7f084d2371d2a81a6eaaeba69bcf54.tar.bz2
Revert 120593 - Ensure the previously active browser window gets the focus after a browser window is closed on OSX.
Also cleaned up extra orderOut: call since browser shutdown process has improved since that line was added. See crbug 23959 for history. This CL appears to cause regression issue 117621. BUG=112038,117621 TEST=Manually open tabbed windows and panels and close them. Watch focus go back to last active window. Review URL: http://codereview.chromium.org/9310075 TBR=jennb@chromium.org Review URL: https://chromiumcodereview.appspot.com/9692016 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@126247 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/ui/cocoa/browser_window_cocoa.mm')
-rw-r--r--chrome/browser/ui/cocoa/browser_window_cocoa.mm14
1 files changed, 12 insertions, 2 deletions
diff --git a/chrome/browser/ui/cocoa/browser_window_cocoa.mm b/chrome/browser/ui/cocoa/browser_window_cocoa.mm
index 084f376..11ac7e4 100644
--- a/chrome/browser/ui/cocoa/browser_window_cocoa.mm
+++ b/chrome/browser/ui/cocoa/browser_window_cocoa.mm
@@ -154,10 +154,20 @@ void BrowserWindowCocoa::Close() {
// If there is an overlay window, we contain a tab being dragged between
// windows. Don't hide the window as it makes the UI extra confused. We can
// still close the window, as that will happen when the drag completes.
- if ([controller_ overlayWindow])
+ if ([controller_ overlayWindow]) {
[controller_ deferPerformClose];
- else
+ } else {
+ // Make sure we hide the window immediately. Even though performClose:
+ // calls orderOut: eventually, it leaves the window on-screen long enough
+ // that we start to see tabs shutting down. http://crbug.com/23959
+ // TODO(viettrungluu): This is kind of bad, since |-performClose:| calls
+ // |-windowShouldClose:| (on its delegate, which is probably the
+ // controller) which may return |NO| causing the window to not be closed,
+ // thereby leaving a hidden window. In fact, our window-closing procedure
+ // involves a (indirect) recursion on |-performClose:|, which is also bad.
+ [window() orderOut:controller_];
[window() performClose:controller_];
+ }
}
void BrowserWindowCocoa::Activate() {