summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrsesek@chromium.org <rsesek@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-10 18:59:25 +0000
committerrsesek@chromium.org <rsesek@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-10 18:59:25 +0000
commitb3609133aeaafa1b57d8a7ca9e90c5f91e982211 (patch)
tree92a512f6a2011cdd7851b14a3f4f6a9dcdd322e9
parent6a22f4f49dea0d632319da665482cf925785b19b (diff)
downloadchromium_src-b3609133aeaafa1b57d8a7ca9e90c5f91e982211.zip
chromium_src-b3609133aeaafa1b57d8a7ca9e90c5f91e982211.tar.gz
chromium_src-b3609133aeaafa1b57d8a7ca9e90c5f91e982211.tar.bz2
Merge 84655 - [Mac] Mark BrowserWindowController's window as non-restorable.
BUG=79113 TEST=On FutureCat, browse around for a few minutes, opening multiple tabs and switching applications. Try to quit Chromium. It quits. Review URL: http://codereview.chromium.org/6971002 TBR=rsesek@chromium.org Review URL: http://codereview.chromium.org/7001002 git-svn-id: svn://svn.chromium.org/chrome/branches/742/src@84830 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/ui/cocoa/browser_window_controller.mm14
1 files changed, 11 insertions, 3 deletions
diff --git a/chrome/browser/ui/cocoa/browser_window_controller.mm b/chrome/browser/ui/cocoa/browser_window_controller.mm
index 6441e3b..d0bfe00 100644
--- a/chrome/browser/ui/cocoa/browser_window_controller.mm
+++ b/chrome/browser/ui/cocoa/browser_window_controller.mm
@@ -140,7 +140,7 @@
// and if it's set we continue to constrain the resize.
-@interface NSWindow(NSPrivateApis)
+@interface NSWindow (NSPrivateApis)
// Note: These functions are private, use -[NSObject respondsToSelector:]
// before calling them.
@@ -150,13 +150,14 @@
@end
-// 10.7 adds public APIs for full-screen support. Provide the declaration so it
-// can be called below when building with the 10.5 SDK.
+// Provide the forward-declarations of new 10.7 SDK symbols so they can be
+// called when building with the 10.5 SDK.
#if !defined(MAC_OS_X_VERSION_10_7) || \
MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_7
@interface NSWindow (LionSDKDeclarations)
- (void)toggleFullScreen:(id)sender;
+- (void)setRestorable:(BOOL)flag;
@end
enum {
@@ -260,6 +261,13 @@ enum {
if ([window respondsToSelector:@selector(setBottomCornerRounded:)])
[window setBottomCornerRounded:NO];
+ // Lion will attempt to automagically save and restore the UI. This
+ // functionality appears to be leaky (or at least interacts badly with our
+ // architecture) and thus BrowserWindowController never gets released. This
+ // prevents the browser from being able to quit <http://crbug.com/79113>.
+ if ([window respondsToSelector:@selector(setRestorable:)])
+ [window setRestorable:NO];
+
// Get the most appropriate size for the window, then enforce the
// minimum width and height. The window shim will handle flipping
// the coordinates for us so we can use it to save some code.