Chromium Code Reviews| Index: chrome/browser/icon_manager.h |
| diff --git a/chrome/browser/icon_manager.h b/chrome/browser/icon_manager.h |
| index 875c6d8ac15e770239a9d391d02fc0d0c34f7d42..53036b73fa1b91b2b4983f9f33267bf0c8bffdd2 100644 |
| --- a/chrome/browser/icon_manager.h |
| +++ b/chrome/browser/icon_manager.h |
| @@ -47,14 +47,11 @@ |
| #include <map> |
| +#include "base/file_path.h" |
| #include "chrome/browser/icon_loader.h" |
| #include "chrome/common/cancelable_task_tracker.h" |
| #include "ui/gfx/image/image.h" |
| -namespace base { |
| -class FilePath; |
| -} |
| - |
| class IconManager : public IconLoader::Delegate { |
| public: |
| IconManager(); |
| @@ -65,7 +62,10 @@ 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. |
| - gfx::Image* LookupIcon(const base::FilePath& file_name, IconLoader::IconSize size); |
| + gfx::Image* LookupIconFromFilepath(const base::FilePath& file_name, |
| + IconLoader::IconSize size); |
| + gfx::Image* LookupIconFromGroup(const IconGroupID& group, |
|
Robert Sesek
2013/02/12 16:49:25
Does this need to be public?
shatch
2013/02/13 16:14:52
Doesn't need to be, but I made it public in case a
Robert Sesek
2013/02/13 17:33:05
I prefer a minimally exposed interface. But your c
shatch
2013/02/21 20:02:06
Done.
|
| + IconLoader::IconSize size); |
| typedef base::Callback<void(gfx::Image*)> IconRequestCallback; |
| @@ -85,11 +85,16 @@ class IconManager : public IconLoader::Delegate { |
| CancelableTaskTracker* tracker); |
| // IconLoader::Delegate interface. |
| - virtual bool OnImageLoaded(IconLoader* loader, gfx::Image* result) OVERRIDE; |
| + virtual bool OnImageLoaded(IconLoader* loader, |
| + gfx::Image* result, |
| + const IconGroupID& group) OVERRIDE; |
| + |
|
Robert Sesek
2013/02/12 16:49:25
nit: no blank line needed
shatch
2013/02/13 16:14:52
Done.
|
| + virtual bool OnGroupLoaded(IconLoader* loader, |
| + const IconGroupID& group) OVERRIDE; |
| // Get the identifying string for the given file. The implementation |
| // is in icon_manager_[platform].cc. |
| - static IconGroupID GetGroupIDFromFilepath(const base::FilePath& path); |
| + static IconGroupID ReadGroupIDFromFilepath(const base::FilePath& path); |
| private: |
| struct CacheKey { |
| @@ -105,6 +110,9 @@ class IconManager : public IconLoader::Delegate { |
| typedef std::map<CacheKey, gfx::Image*> IconMap; |
| IconMap icon_cache_; |
| + typedef std::map<FilePath, IconGroupID> GroupMap; |
|
Robert Sesek
2013/02/12 16:49:25
I'm not sure how much of a benefit this cache mapp
shatch
2013/02/13 16:14:52
From what I could see, it got used when you did th
Robert Sesek
2013/02/13 17:33:05
Ah, good point.
|
| + GroupMap group_cache_; |
| + |
| // Asynchronous requests that have not yet been completed. |
| struct ClientRequest; |
| typedef std::map<IconLoader*, ClientRequest> ClientRequests; |