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

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

Issue 12315069: Mac: Update zoom bubble UI (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: address review comments Created 7 years, 10 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/info_bubble_window.mm
diff --git a/chrome/browser/ui/cocoa/info_bubble_window.mm b/chrome/browser/ui/cocoa/info_bubble_window.mm
index 31bcc3c0bcb952f60770a775657d842dd89bb6ed..a0b0270522a3152239bdd42f7bd591184320b6a3 100644
--- a/chrome/browser/ui/cocoa/info_bubble_window.mm
+++ b/chrome/browser/ui/cocoa/info_bubble_window.mm
@@ -96,6 +96,7 @@ class AppNotificationBridge : public content::NotificationObserver {
@synthesize delayOnClose = delayOnClose_;
@synthesize canBecomeKeyWindow = canBecomeKeyWindow_;
+@synthesize enableAnimations = enableAnimations_;
- (id)initWithContentRect:(NSRect)contentRect
styleMask:(NSUInteger)aStyle
@@ -111,6 +112,7 @@ class AppNotificationBridge : public content::NotificationObserver {
[self setHasShadow:YES];
delayOnClose_ = YES;
canBecomeKeyWindow_ = YES;
+ enableAnimations_ = YES;
notificationBridge_.reset(new AppNotificationBridge(self));
// Start invisible. Will be made visible when ordered front.
@@ -158,7 +160,8 @@ class AppNotificationBridge : public content::NotificationObserver {
// Apply animations to hide self.
[NSAnimationContext beginGrouping];
[[NSAnimationContext currentContext]
- gtm_setDuration:kOrderOutAnimationDuration
+ gtm_setDuration:enableAnimations_ ? kOrderOutAnimationDuration :
+ kMinimumTimeInterval
eventMask:NSLeftMouseUpMask];
[[self animator] setAlphaValue:0.0];
[NSAnimationContext endGrouping];
@@ -207,7 +210,8 @@ class AppNotificationBridge : public content::NotificationObserver {
[NSAnimationContext beginGrouping];
// The star currently triggers on mouse down, not mouse up.
[[NSAnimationContext currentContext]
- gtm_setDuration:kOrderInAnimationDuration
+ gtm_setDuration:enableAnimations_ ? kOrderInAnimationDuration :
+ kMinimumTimeInterval
eventMask:NSLeftMouseUpMask|NSLeftMouseDownMask];
[[self animator] setAlphaValue:1.0];
[[self animator] setFrame:frame display:YES];

Powered by Google App Engine
This is Rietveld 408576698