diff options
author | dmaclach@chromium.org <dmaclach@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-07-13 04:37:59 +0000 |
---|---|---|
committer | dmaclach@chromium.org <dmaclach@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-07-13 04:37:59 +0000 |
commit | 6860c2d6f8a791ee041e6eda85d5c9a67b033998 (patch) | |
tree | 408427a0f4ac81a3e2daf365e3166c0af3587a52 /chrome/browser/ui/cocoa/animation_utils.h | |
parent | be9d9c8af20532001eff248886578d4ab844707d (diff) | |
download | chromium_src-6860c2d6f8a791ee041e6eda85d5c9a67b033998.zip chromium_src-6860c2d6f8a791ee041e6eda85d5c9a67b033998.tar.gz chromium_src-6860c2d6f8a791ee041e6eda85d5c9a67b033998.tar.bz2 |
fix for 27454 - Fade out close button state on mouse exit
Changed TabView.xib to make the close button have a layer backing it's view.
BUG=27454
TEST=Create some tabs. Move the cursor over the close button for the tabs, and then out. Watch them fade.
Review URL: http://codereview.chromium.org/7331042
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@92318 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/ui/cocoa/animation_utils.h')
-rw-r--r-- | chrome/browser/ui/cocoa/animation_utils.h | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/chrome/browser/ui/cocoa/animation_utils.h b/chrome/browser/ui/cocoa/animation_utils.h index 3a34e0e..1f1be79 100644 --- a/chrome/browser/ui/cocoa/animation_utils.h +++ b/chrome/browser/ui/cocoa/animation_utils.h @@ -7,6 +7,7 @@ #pragma once #import <Cocoa/Cocoa.h> +#import <QuartzCore/QuartzCore.h> // This class is a stack-based helper useful for unit testing of Cocoa UI, // and any other situation where you want to temporarily turn off Cocoa @@ -31,5 +32,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 |