diff options
Diffstat (limited to 'chrome/browser')
-rw-r--r-- | chrome/browser/favicon/favicon_handler.cc | 7 | ||||
-rw-r--r-- | chrome/browser/icon_loader_mac.mm | 5 | ||||
-rw-r--r-- | chrome/browser/profiles/profile_info_util.cc | 6 | ||||
-rw-r--r-- | chrome/browser/themes/browser_theme_pack.cc | 4 | ||||
-rw-r--r-- | chrome/browser/ui/cocoa/extensions/extension_installed_bubble_bridge.mm | 2 |
5 files changed, 11 insertions, 13 deletions
diff --git a/chrome/browser/favicon/favicon_handler.cc b/chrome/browser/favicon/favicon_handler.cc index cc19d92..52e429c 100644 --- a/chrome/browser/favicon/favicon_handler.cc +++ b/chrome/browser/favicon/favicon_handler.cc @@ -450,10 +450,9 @@ gfx::Image FaviconHandler::ResizeFaviconIfNeeded(const gfx::Image& image) { int height = bitmap.height(); if (width > 0 && height > 0) { gfx::CalculateFaviconTargetSize(&width, &height); - return gfx::Image(new SkBitmap( - skia::ImageOperations::Resize( - bitmap, skia::ImageOperations::RESIZE_LANCZOS3, - width, height))); + return gfx::Image(skia::ImageOperations::Resize( + bitmap, skia::ImageOperations::RESIZE_LANCZOS3, + width, height)); } return image; diff --git a/chrome/browser/icon_loader_mac.mm b/chrome/browser/icon_loader_mac.mm index b90f796..2e35a93 100644 --- a/chrome/browser/icon_loader_mac.mm +++ b/chrome/browser/icon_loader_mac.mm @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -33,8 +33,7 @@ void IconLoader::ReadIcon() { default: NOTREACHED(); } - image_.reset(new gfx::Image(new SkBitmap( - gfx::NSImageToSkBitmap(icon, size, false)))); + image_.reset(new gfx::Image(gfx::NSImageToSkBitmap(icon, size, false))); } target_message_loop_->PostTask(FROM_HERE, diff --git a/chrome/browser/profiles/profile_info_util.cc b/chrome/browser/profiles/profile_info_util.cc index 9068104..7c1be96 100644 --- a/chrome/browser/profiles/profile_info_util.cc +++ b/chrome/browser/profiles/profile_info_util.cc @@ -32,7 +32,7 @@ gfx::Image GetAvatarIconForMenu(const gfx::Image& image, SkColor color = SkColorSetARGB(83, 0, 0, 0); canvas.DrawRect(gfx::Rect(x, y, length - 1, length - 1), color); - return gfx::Image(new SkBitmap(canvas.ExtractBitmap())); + return gfx::Image(canvas.ExtractBitmap()); } gfx::Image GetAvatarIconForWebUI(const gfx::Image& image, @@ -50,7 +50,7 @@ gfx::Image GetAvatarIconForWebUI(const gfx::Image& image, int y = (kAvatarIconHeight - length) / 2; canvas.DrawBitmapInt(bmp, x, y); - return gfx::Image(new SkBitmap(canvas.ExtractBitmap())); + return gfx::Image(canvas.ExtractBitmap()); } gfx::Image GetAvatarIconForTitleBar(const gfx::Image& image, @@ -88,7 +88,7 @@ gfx::Image GetAvatarIconForTitleBar(const gfx::Image& image, canvas.DrawLine(gfx::Point(x2 - 1, y1 + 1), gfx::Point(x2 - 1, y2 - 1), shadow_color); - return gfx::Image(new SkBitmap(canvas.ExtractBitmap())); + return gfx::Image(canvas.ExtractBitmap()); } } // namespace diff --git a/chrome/browser/themes/browser_theme_pack.cc b/chrome/browser/themes/browser_theme_pack.cc index de73e05..2edf646 100644 --- a/chrome/browser/themes/browser_theme_pack.cc +++ b/chrome/browser/themes/browser_theme_pack.cc @@ -545,7 +545,7 @@ const gfx::Image* BrowserThemePack::GetImageNamed(int idr_id) const { return NULL; } - gfx::Image* ret = new gfx::Image(new SkBitmap(bitmap)); + gfx::Image* ret = new gfx::Image(bitmap); loaded_images_[prs_id] = ret; return ret; @@ -892,7 +892,7 @@ bool BrowserThemePack::LoadRawBitmapsTo( SkBitmap bitmap; if (gfx::PNGCodec::Decode(raw_data->front(), raw_data->size(), &bitmap)) { - (*raw_bitmaps)[it->first] = new gfx::Image(new SkBitmap(bitmap)); + (*raw_bitmaps)[it->first] = new gfx::Image(bitmap); } else { NOTREACHED() << "Unable to decode theme image resource " << it->first; } diff --git a/chrome/browser/ui/cocoa/extensions/extension_installed_bubble_bridge.mm b/chrome/browser/ui/cocoa/extensions/extension_installed_bubble_bridge.mm index 894643f..12c7b92 100644 --- a/chrome/browser/ui/cocoa/extensions/extension_installed_bubble_bridge.mm +++ b/chrome/browser/ui/cocoa/extensions/extension_installed_bubble_bridge.mm @@ -48,7 +48,7 @@ static void ShowGenericExtensionInstalledInfoBar( IDS_EXTENSION_INSTALLED_MANAGE_INFO_MAC); InfoBarTabHelper* infobar_helper = wrapper->infobar_tab_helper(); InfoBarDelegate* delegate = new SimpleAlertInfoBarDelegate( - infobar_helper, new gfx::Image(new SkBitmap(icon)), msg, true); + infobar_helper, new gfx::Image(icon), msg, true); infobar_helper->AddInfoBar(delegate); } |