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

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

Issue 7809013: Remove Animation When "Resuming" Window in Lion (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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
« chrome/browser/ui/browser.cc ('K') | « chrome/browser/ui/browser.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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() {
« chrome/browser/ui/browser.cc ('K') | « chrome/browser/ui/browser.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698