| Index: chrome/browser/ui/cocoa/browser_window_cocoa.mm
|
| diff --git a/chrome/browser/ui/cocoa/browser_window_cocoa.mm b/chrome/browser/ui/cocoa/browser_window_cocoa.mm
|
| index 9ad67b9fb8c781684f130528a948488e5681b892..1bd77651f4ef8cc91e337dbdfdb3e2d86685dd28 100644
|
| --- a/chrome/browser/ui/cocoa/browser_window_cocoa.mm
|
| +++ b/chrome/browser/ui/cocoa/browser_window_cocoa.mm
|
| @@ -93,31 +93,37 @@ void BrowserWindowCocoa::Show() {
|
| // the previous browser instead if we don't explicitly set it here.
|
| BrowserList::SetLastActive(browser_);
|
|
|
| - ui::WindowShowState show_state = browser_->GetSavedWindowShowState();
|
| - if (show_state == ui::SHOW_STATE_MINIMIZED) {
|
| - // Turn off swishing when restoring minimized windows. When creating
|
| - // windows from nibs it is necessary to |orderFront:| prior to |orderOut:|
|
| - // then |miniaturize:| when restoring windows in the minimized state.
|
| - NSWindowAnimationBehavior savedAnimationBehavior = 0;
|
| + bool is_session_restore = browser_->is_session_restore();
|
| + NSWindowAnimationBehavior savedAnimationBehavior = 0;
|
| + if (is_session_restore) {
|
| + // Turn off swishing when restoring windows.
|
| if ([window() respondsToSelector:@selector(animationBehavior)] &&
|
| [window() respondsToSelector:@selector(setAnimationBehavior:)]) {
|
| savedAnimationBehavior = [window() animationBehavior];
|
| [window() setAnimationBehavior:NSWindowAnimationBehaviorNone];
|
| }
|
| + }
|
|
|
| - [window() makeKeyAndOrderFront:controller_];
|
| + [window() makeKeyAndOrderFront:controller_];
|
|
|
| + // When creating windows from nibs it is necessary to |makeKeyAndOrderFront:|
|
| + // prior to |orderOut:| then |miniaturize:| when restoring windows in the
|
| + // minimized state.
|
| + if (browser_->GetSavedWindowShowState() == ui::SHOW_STATE_MINIMIZED) {
|
| [window() orderOut:controller_];
|
| [window() miniaturize:controller_];
|
| + }
|
|
|
| + if (is_session_restore) {
|
| // Restore window animation behavior.
|
| if ([window() respondsToSelector:@selector(animationBehavior)] &&
|
| [window() respondsToSelector:@selector(setAnimationBehavior:)]) {
|
| [window() setAnimationBehavior:savedAnimationBehavior];
|
| }
|
| - } else {
|
| - [window() makeKeyAndOrderFront:controller_];
|
| }
|
| +
|
| + // Once the window has been shown, clear the session restore flag.
|
| + browser_->set_is_session_restore(false);
|
| }
|
|
|
| void BrowserWindowCocoa::ShowInactive() {
|
|
|