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

Unified Diff: chrome/browser/ui/cocoa/tabs/tab_strip_drag_controller.mm

Issue 7809013: Remove Animation When "Resuming" Window in Lion (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: drag and const. 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/tabs/tab_strip_drag_controller.mm
diff --git a/chrome/browser/ui/cocoa/tabs/tab_strip_drag_controller.mm b/chrome/browser/ui/cocoa/tabs/tab_strip_drag_controller.mm
index 1a92665d0bc26cebc3141010be147c47ec5b5c6d..25ee897ecc8cc5e9986466d405760c7a3414a148 100644
--- a/chrome/browser/ui/cocoa/tabs/tab_strip_drag_controller.mm
+++ b/chrome/browser/ui/cocoa/tabs/tab_strip_drag_controller.mm
@@ -264,9 +264,11 @@ const NSTimeInterval kTearDuration = 0.333;
// Disable window animation before calling |orderFront:| when detatching
// to a new window.
- NSWindowAnimationBehavior savedAnimationBehavior = 0;
+ NSWindowAnimationBehavior savedAnimationBehavior;
+ bool didSaveAnimationBehavior = false;
if ([dragWindow_ respondsToSelector:@selector(animationBehavior)] &&
[dragWindow_ respondsToSelector:@selector(setAnimationBehavior:)]) {
+ didSaveAnimationBehavior = true;
savedAnimationBehavior = [dragWindow_ animationBehavior];
[dragWindow_ setAnimationBehavior:NSWindowAnimationBehaviorNone];
}
@@ -285,11 +287,9 @@ const NSTimeInterval kTearDuration = 0.333;
tearTime_ = [NSDate timeIntervalSinceReferenceDate];
tearOrigin_ = sourceWindowFrame_.origin;
- // Restore window animation behavior
- if ([dragWindow_ respondsToSelector:@selector(animationBehavior)] &&
- [dragWindow_ respondsToSelector:@selector(setAnimationBehavior:)]) {
+ // Restore window animation behavior.
+ if (didSaveAnimationBehavior)
[dragWindow_ setAnimationBehavior:savedAnimationBehavior];
- }
}
// TODO(pinkerton): http://crbug.com/25682 demonstrates a way to get here by

Powered by Google App Engine
This is Rietveld 408576698