diff options
author | rsesek@chromium.org <rsesek@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-03 15:50:07 +0000 |
---|---|---|
committer | rsesek@chromium.org <rsesek@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-03 15:50:07 +0000 |
commit | 66171abedad9f817901db48328fdc417ecf56c7a (patch) | |
tree | 59ebd2a67731072f9326f08fa3fcce32cc1c5866 /chrome/browser/icon_manager.h | |
parent | 7aebaf878d8ec781f8fcc5f2932d67a9f6afb966 (diff) | |
download | chromium_src-66171abedad9f817901db48328fdc417ecf56c7a.zip chromium_src-66171abedad9f817901db48328fdc417ecf56c7a.tar.gz chromium_src-66171abedad9f817901db48328fdc417ecf56c7a.tar.bz2 |
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
Diffstat (limited to 'chrome/browser/icon_manager.h')
-rw-r--r-- | chrome/browser/icon_manager.h | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/chrome/browser/icon_manager.h b/chrome/browser/icon_manager.h index a7a2441..81ecb9f 100644 --- a/chrome/browser/icon_manager.h +++ b/chrome/browser/icon_manager.h @@ -1,4 +1,4 @@ -// 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. // @@ -52,9 +52,9 @@ #include "base/hash_tables.h" #include "chrome/browser/icon_loader.h" #include "content/browser/cancelable_request.h" +#include "ui/gfx/image.h" class FilePath; -class SkBitmap; class IconManager : public IconLoader::Delegate, public CancelableRequestProvider { @@ -67,11 +67,11 @@ class IconManager : public IconLoader::Delegate, // it via 'LoadIcon'. The returned bitmap is owned by the IconManager and must // not be free'd by the caller. If the caller needs to modify the icon, it // must make a copy and modify the copy. - SkBitmap* LookupIcon(const FilePath& file_name, - IconLoader::IconSize size); + gfx::Image* LookupIcon(const FilePath& file_name, + IconLoader::IconSize size); typedef CancelableRequestProvider::Handle Handle; - typedef Callback2<Handle, SkBitmap*>::Type IconRequestCallback; + typedef Callback2<Handle, gfx::Image*>::Type IconRequestCallback; // Asynchronous call to lookup and return the icon associated with file. The // work is done on the file thread, with the callbacks running on the UI @@ -85,7 +85,7 @@ class IconManager : public IconLoader::Delegate, IconRequestCallback* callback); // IconLoader::Delegate interface. - virtual bool OnBitmapLoaded(IconLoader* source, SkBitmap* result); + virtual bool OnImageLoaded(IconLoader* source, gfx::Image* result); // Get the identifying string for the given file. The implementation // is in icon_manager_[platform].cc. @@ -102,7 +102,7 @@ class IconManager : public IconLoader::Delegate, IconLoader::IconSize size; }; - typedef std::map<CacheKey, SkBitmap*> IconMap; + typedef std::map<CacheKey, gfx::Image*> IconMap; IconMap icon_cache_; typedef CancelableRequest<IconRequestCallback> IconRequest; |