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

Unified Diff: chrome/browser/cocoa/download_started_animation_mac.mm

Issue 3005018: Load the download animation image as an NSImage rather than a CGImageRef. (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: Created 10 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/browser/cocoa/animatable_image.mm ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/cocoa/download_started_animation_mac.mm
diff --git a/chrome/browser/cocoa/download_started_animation_mac.mm b/chrome/browser/cocoa/download_started_animation_mac.mm
index f004469d3a6fb32da3c16b5881af20f5f826904e..f756bb043e83884897cdc8ee7ee2fcc92be832a6 100644
--- a/chrome/browser/cocoa/download_started_animation_mac.mm
+++ b/chrome/browser/cocoa/download_started_animation_mac.mm
@@ -84,8 +84,7 @@ class DownloadAnimationTabObserver : public NotificationObserver {
if ((self = [super init])) {
// Load the image of the download arrow.
ResourceBundle& bundle = ResourceBundle::GetSharedInstance();
- SkBitmap* imageBitmap = bundle.GetBitmapNamed(IDR_DOWNLOAD_ANIMATION_BEGIN);
- scoped_cftyperef<CGImageRef> image(SkCreateCGImageRef(*imageBitmap));
+ NSImage* image = bundle.GetNSImageNamed(IDR_DOWNLOAD_ANIMATION_BEGIN);
// Figure out the positioning in the current tab. Try to position the layer
// against the left edge, and three times the download image's height from
@@ -93,8 +92,8 @@ class DownloadAnimationTabObserver : public NotificationObserver {
// enough, don't show the animation and let the shelf speak for itself.
gfx::Rect bounds;
tabContents->GetContainerBounds(&bounds);
- imageWidth_ = CGImageGetWidth(image);
- CGFloat imageHeight = CGImageGetHeight(image);
+ imageWidth_ = [image size].width;
+ CGFloat imageHeight = [image size].height;
// Sanity check the size in case there's no room to display the animation.
if (bounds.height() < imageHeight) {
@@ -117,7 +116,7 @@ class DownloadAnimationTabObserver : public NotificationObserver {
// Create the animation object to assist in animating and fading.
CGFloat animationHeight = MIN(bounds.height(), 4 * imageHeight);
NSRect frame = NSMakeRect(origin.x, origin.y, imageWidth_, animationHeight);
- animation_ = [[AnimatableImage alloc] initWithImage:(id)image.get()
+ animation_ = [[AnimatableImage alloc] initWithImage:image
animationFrame:frame];
[parentWindow addChildWindow:animation_ ordered:NSWindowAbove];
« no previous file with comments | « chrome/browser/cocoa/animatable_image.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698