Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2375)

Unified Diff: chrome/browser/ui/cocoa/browser_window_controller.mm

Issue 7621061: Restoring a session should restore window minimization state (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Pushing MAC_OS_X_VERSION_10_7 defines back down into .mm files. Created 9 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/cocoa/browser_window_controller.mm
diff --git a/chrome/browser/ui/cocoa/browser_window_controller.mm b/chrome/browser/ui/cocoa/browser_window_controller.mm
index 7f5f04e56bfef1dc5d93516058ab3024021eb7c4..6a42b3aa763e55fc7724f21044684bc934834371 100644
--- a/chrome/browser/ui/cocoa/browser_window_controller.mm
+++ b/chrome/browser/ui/cocoa/browser_window_controller.mm
@@ -223,7 +223,7 @@ enum {
browser_.reset(browser);
ownsBrowser_ = ownIt;
NSWindow* window = [self window];
- windowShim_.reset(new BrowserWindowCocoa(browser, self, window));
+ windowShim_.reset(new BrowserWindowCocoa(browser, self));
// Create the bar visibility lock set; 10 is arbitrary, but should hopefully
// be big enough to hold all locks that'll ever be needed.
@@ -614,6 +614,8 @@ enum {
// Called when we have been minimized.
- (void)windowDidMiniaturize:(NSNotification *)notification {
+ [self saveWindowPositionIfNeeded];
+
// Let the selected RenderWidgetHostView know, so that it can tell plugins.
if (TabContents* contents = browser_->GetSelectedTabContents()) {
if (RenderWidgetHostView* rwhv = contents->GetRenderWidgetHostView())
@@ -1763,6 +1765,8 @@ enum {
// Delegate method called when window is resized.
- (void)windowDidResize:(NSNotification*)notification {
+ [self saveWindowPositionIfNeeded];
+
// Resize (and possibly move) the status bubble. Note that we may get called
// when the status bubble does not exist.
if (statusBubble_) {
@@ -1803,6 +1807,8 @@ enum {
// |-windowWillMove:|, which is called less frequently than |-windowDidMove|
// instead.)
- (void)windowDidMove:(NSNotification*)notification {
+ [self saveWindowPositionIfNeeded];
+
NSWindow* window = [self window];
NSRect windowFrame = [window frame];
NSRect workarea = [[window screen] visibleFrame];

Powered by Google App Engine
This is Rietveld 408576698