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

Unified Diff: chrome/browser/ui/cocoa/animation_utils.h

Issue 7331042: fix for 27454 - Fade out close button state on mouse exit (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix up rsesek nits Created 9 years, 5 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
« no previous file with comments | « chrome/app/nibs/TabView.xib ('k') | chrome/browser/ui/cocoa/hover_button.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/cocoa/animation_utils.h
diff --git a/chrome/browser/ui/cocoa/animation_utils.h b/chrome/browser/ui/cocoa/animation_utils.h
index 3a34e0eb8a8d09f4d3da9fb996c7055382a6696d..5ed7ffa09fa895e20e1d10d239bf8406c405bf15 100644
--- a/chrome/browser/ui/cocoa/animation_utils.h
+++ b/chrome/browser/ui/cocoa/animation_utils.h
@@ -31,5 +31,32 @@ class WithNoAnimation {
}
};
+// Disables actions within a scope.
+class ScopedCAActionDisabler {
+ public:
+ ScopedCAActionDisabler() {
+ [CATransaction begin];
+ [CATransaction setValue:[NSNumber numberWithBool:YES]
+ forKey:kCATransactionDisableActions];
+ }
+
+ ~ScopedCAActionDisabler() {
+ [CATransaction commit];
+ }
+};
+
+// Sets a duration on actions within a scope.
+class ScopedCAActionSetDuration {
+ public:
+ explicit ScopedCAActionSetDuration(NSTimeInterval duration) {
+ [CATransaction begin];
+ [CATransaction setValue:[NSNumber numberWithFloat:duration]
+ forKey:kCATransactionAnimationDuration];
+ }
+
+ ~ScopedCAActionSetDuration() {
+ [CATransaction commit];
+ }
+};
#endif // CHROME_BROWSER_UI_COCOA_ANIMATION_UTILS_H
« no previous file with comments | « chrome/app/nibs/TabView.xib ('k') | chrome/browser/ui/cocoa/hover_button.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698