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

Side by Side Diff: chrome/browser/ui/cocoa/animatable_image.mm

Issue 16917011: mac: Replace base::mac::ScopedCFTypeRef with base::ScopedCFTypeRef. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: with fixed off-by-1 in git-clang-format Created 7 years, 6 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
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 #import "chrome/browser/ui/cocoa/animatable_image.h" 5 #import "chrome/browser/ui/cocoa/animatable_image.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #import "base/mac/mac_util.h" 8 #import "base/mac/mac_util.h"
9 #include "base/mac/scoped_cftyperef.h" 9 #include "base/mac/scoped_cftyperef.h"
10 #import "third_party/GTM/AppKit/GTMNSAnimation+Duration.h" 10 #import "third_party/GTM/AppKit/GTMNSAnimation+Duration.h"
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 [layer addAnimation:boundsAnimation forKey:@"bounds"]; 123 [layer addAnimation:boundsAnimation forKey:@"bounds"];
124 } 124 }
125 [layer addAnimation:positionAnimation forKey:@"position"]; 125 [layer addAnimation:positionAnimation forKey:@"position"];
126 [layer addAnimation:opacityAnimation forKey:@"opacity"]; 126 [layer addAnimation:opacityAnimation forKey:@"opacity"];
127 [CATransaction commit]; 127 [CATransaction commit];
128 } 128 }
129 129
130 // Sets the layer contents by converting the NSImage to a CGImageRef. This will 130 // Sets the layer contents by converting the NSImage to a CGImageRef. This will
131 // rasterize PDF resources. 131 // rasterize PDF resources.
132 - (void)setLayerContents:(CALayer*)layer { 132 - (void)setLayerContents:(CALayer*)layer {
133 base::mac::ScopedCFTypeRef<CGImageRef> image( 133 base::ScopedCFTypeRef<CGImageRef> image(
134 base::mac::CopyNSImageToCGImage(image_.get())); 134 base::mac::CopyNSImageToCGImage(image_.get()));
135 // Create the layer that will be animated. 135 // Create the layer that will be animated.
136 [layer setContents:(id)image.get()]; 136 [layer setContents:(id)image.get()];
137 } 137 }
138 138
139 // CAAnimation delegate method called when the animation is complete. 139 // CAAnimation delegate method called when the animation is complete.
140 - (void)animationDidStop:(CAAnimation*)animation finished:(BOOL)flag { 140 - (void)animationDidStop:(CAAnimation*)animation finished:(BOOL)flag {
141 // Close the window, releasing self. 141 // Close the window, releasing self.
142 [self close]; 142 [self close];
143 } 143 }
144 144
145 @end 145 @end
OLDNEW
« no previous file with comments | « chrome/browser/storage_monitor/storage_monitor_mac.mm ('k') | chrome/browser/ui/cocoa/certificate_viewer_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698