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

Unified Diff: chrome/browser/icon_manager.h

Issue 113120: stub impl of linux,mac icon loader/manager (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: style fixes Created 11 years, 7 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/icon_loader_win.cc ('k') | chrome/browser/icon_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/icon_manager.h
===================================================================
--- chrome/browser/icon_manager.h (revision 15577)
+++ chrome/browser/icon_manager.h (working copy)
@@ -25,6 +25,9 @@
// file extension and the results will be cached per extension. That way, all
// .mp3 files will share one icon, but all .exe files will have their own icon.
//
+// POSIX files don't have associated icons. We query the OS by the file's
+// mime type.
+//
// The IconManager can be queried in two ways:
// 1. A quick, synchronous check of its caches which does not touch the disk:
// IconManager::LookupIcon()
@@ -47,14 +50,15 @@
#include <string>
#include "base/hash_tables.h"
+#include "chrome/browser/cancelable_request.h"
#include "chrome/browser/icon_loader.h"
-#include "chrome/browser/cancelable_request.h"
+class FilePath;
class SkBitmap;
class IconManager : public IconLoader::Delegate,
public CancelableRequestProvider {
-public:
+ public:
IconManager();
~IconManager();
@@ -83,14 +87,18 @@
// IconLoader::Delegate interface.
virtual bool OnBitmapLoaded(IconLoader* source, SkBitmap* result);
-private:
+ // Get the identifying string for the given file. The implementation
+ // is in icon_manager_[platform].cc.
+ static IconGroupID GetGroupIDFromFilepath(const FilePath& path);
+
+ private:
struct CacheKey {
- CacheKey(const FilePath& file_name, IconLoader::IconSize size);
+ CacheKey(const IconGroupID& group, IconLoader::IconSize size);
// Used as a key in the map below, so we need this comparator.
bool operator<(const CacheKey &other) const;
- FilePath file_name;
+ IconGroupID group;
IconLoader::IconSize size;
};
@@ -100,12 +108,12 @@
typedef CancelableRequest<IconRequestCallback> IconRequest;
typedef struct {
scoped_refptr<IconRequest> request;
- FilePath file_name;
+ IconGroupID group;
IconLoader::IconSize size;
} ClientRequest;
// Asynchronous requests that have not yet been completed.
- typedef base::hash_map<IconLoader*, ClientRequest> ClientRequests;
+ typedef std::map<IconLoader*, ClientRequest> ClientRequests;
ClientRequests requests_;
DISALLOW_COPY_AND_ASSIGN(IconManager);
« no previous file with comments | « chrome/browser/icon_loader_win.cc ('k') | chrome/browser/icon_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698