From 66171abedad9f817901db48328fdc417ecf56c7a Mon Sep 17 00:00:00 2001 From: "rsesek@chromium.org" Date: Thu, 3 Mar 2011 15:50:07 +0000 Subject: Convert IconLoader and IconManager to deal with gfx::Image rather than SkBitmap. This allows loading of icons in the platform format, avoiding unnecessary conversions if the image is going to be used with the platform toolkit. In other cases, this just pushes image conversion to the callsite rather than the actual image load. BUG=19685 TEST=unit_tests and visual inspection of icons in the download shelf Review URL: http://codereview.chromium.org/6597043 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@76743 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/icon_loader.cc | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'chrome/browser/icon_loader.cc') diff --git a/chrome/browser/icon_loader.cc b/chrome/browser/icon_loader.cc index 0c30301..c1d8e8f 100644 --- a/chrome/browser/icon_loader.cc +++ b/chrome/browser/icon_loader.cc @@ -1,9 +1,10 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 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. #include "chrome/browser/icon_loader.h" +#include "base/basictypes.h" #include "content/browser/browser_thread.h" #include "third_party/skia/include/core/SkBitmap.h" @@ -16,7 +17,7 @@ IconLoader::IconLoader(const IconGroupID& group, IconSize size, : target_message_loop_(NULL), group_(group), icon_size_(size), - bitmap_(NULL), + image_(NULL), delegate_(delegate) { } @@ -36,6 +37,8 @@ void IconLoader::Start() { } void IconLoader::NotifyDelegate() { - if (delegate_->OnBitmapLoaded(this, bitmap_.Get())) - bitmap_.Release(); + // If the delegate takes ownership of the Image, release it from the scoped + // pointer. + if (delegate_->OnImageLoaded(this, image_.get())) + ignore_result(image_.release()); // Can't ignore return value. } -- cgit v1.1