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

Unified Diff: chrome/browser/ui/cocoa/extensions/extension_popup_controller.mm

Issue 111493003: [Mac] Always animate extension popup window size changes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/cocoa/extensions/extension_popup_controller.mm
diff --git a/chrome/browser/ui/cocoa/extensions/extension_popup_controller.mm b/chrome/browser/ui/cocoa/extensions/extension_popup_controller.mm
index fbe53392e8ed34dbd233fe9c12feb29b8243bc9a..9b3ed95b0d54b7085d4608cab3ae47c319213170 100644
--- a/chrome/browser/ui/cocoa/extensions/extension_popup_controller.mm
+++ b/chrome/browser/ui/cocoa/extensions/extension_popup_controller.mm
@@ -340,20 +340,17 @@ class DevtoolsNotificationBridge : public content::NotificationObserver {
windowOrigin.y -= NSHeight(frame) - offsets.height;
frame.origin = windowOrigin;
- // Is the window still animating in? If so, then cancel that and create a new
- // animation setting the opacity and new frame value. Otherwise the current
- // animation will continue after this frame is set, reverting the frame to
- // what it was when the animation started.
+ // In case the window is animating already, change its size by creating a
+ // new animation setting the opacity and new frame value. Otherwise, a
+ // preexisting animation would continue after the frame is set, reverting
+ // the frame to what it was when the animation started.
NSWindow* window = [self window];
- if ([window isVisible] && [[window animator] alphaValue] < 1.0) {
- [NSAnimationContext beginGrouping];
- [[NSAnimationContext currentContext] setDuration:kAnimationDuration];
- [[window animator] setAlphaValue:1.0];
- [[window animator] setFrame:frame display:YES];
- [NSAnimationContext endGrouping];
- } else {
- [window setFrame:frame display:YES];
- }
+ id animator = [window animator];
+ [NSAnimationContext beginGrouping];
+ [[NSAnimationContext currentContext] setDuration:kAnimationDuration];
+ [animator setAlphaValue:1.0];
+ [animator setFrame:frame display:YES];
+ [NSAnimationContext endGrouping];
// A NSViewFrameDidChangeNotification won't be sent until the extension view
// content is loaded. The window is hidden on init, so show it the first time
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698