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

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

Issue 98583009: Back out r240455 on the trunk. It caused http://crbug.com/328776. (Closed) Base URL: svn://svn.chromium.org/chrome/
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: trunk/src/chrome/browser/ui/cocoa/extensions/extension_popup_controller.mm
===================================================================
--- trunk/src/chrome/browser/ui/cocoa/extensions/extension_popup_controller.mm (revision 240945)
+++ trunk/src/chrome/browser/ui/cocoa/extensions/extension_popup_controller.mm (working copy)
@@ -340,17 +340,20 @@
windowOrigin.y -= NSHeight(frame) - offsets.height;
frame.origin = windowOrigin;
- // 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.
+ // 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.
NSWindow* window = [self window];
- id animator = [window animator];
- [NSAnimationContext beginGrouping];
- [[NSAnimationContext currentContext] setDuration:kAnimationDuration];
- [animator setAlphaValue:1.0];
- [animator setFrame:frame display:YES];
- [NSAnimationContext endGrouping];
+ 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];
+ }
// 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