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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/app/nibs/TabView.xib ('k') | chrome/browser/ui/cocoa/hover_button.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_UI_COCOA_ANIMATION_UTILS_H 5 #ifndef CHROME_BROWSER_UI_COCOA_ANIMATION_UTILS_H
6 #define CHROME_BROWSER_UI_COCOA_ANIMATION_UTILS_H 6 #define CHROME_BROWSER_UI_COCOA_ANIMATION_UTILS_H
7 #pragma once 7 #pragma once
8 8
9 #import <Cocoa/Cocoa.h> 9 #import <Cocoa/Cocoa.h>
10 10
(...skipping 13 matching lines...) Expand all
24 WithNoAnimation() { 24 WithNoAnimation() {
25 [NSAnimationContext beginGrouping]; 25 [NSAnimationContext beginGrouping];
26 [[NSAnimationContext currentContext] setDuration:0.0]; 26 [[NSAnimationContext currentContext] setDuration:0.0];
27 } 27 }
28 28
29 ~WithNoAnimation() { 29 ~WithNoAnimation() {
30 [NSAnimationContext endGrouping]; 30 [NSAnimationContext endGrouping];
31 } 31 }
32 }; 32 };
33 33
34 // Disables actions within a scope.
35 class ScopedCAActionDisabler {
36 public:
37 ScopedCAActionDisabler() {
38 [CATransaction begin];
39 [CATransaction setValue:[NSNumber numberWithBool:YES]
40 forKey:kCATransactionDisableActions];
41 }
42
43 ~ScopedCAActionDisabler() {
44 [CATransaction commit];
45 }
46 };
47
48 // Sets a duration on actions within a scope.
49 class ScopedCAActionSetDuration {
50 public:
51 explicit ScopedCAActionSetDuration(NSTimeInterval duration) {
52 [CATransaction begin];
53 [CATransaction setValue:[NSNumber numberWithFloat:duration]
54 forKey:kCATransactionAnimationDuration];
55 }
56
57 ~ScopedCAActionSetDuration() {
58 [CATransaction commit];
59 }
60 };
34 61
35 #endif // CHROME_BROWSER_UI_COCOA_ANIMATION_UTILS_H 62 #endif // CHROME_BROWSER_UI_COCOA_ANIMATION_UTILS_H
OLDNEW
« 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