OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 // | 4 // |
5 // Class for finding and caching Windows explorer icons. The IconManager | 5 // Class for finding and caching Windows explorer icons. The IconManager |
6 // lives on the UI thread but performs icon extraction work on the file thread | 6 // lives on the UI thread but performs icon extraction work on the file thread |
7 // to avoid blocking the UI thread with potentially expensive COM and disk | 7 // to avoid blocking the UI thread with potentially expensive COM and disk |
8 // operations. | 8 // operations. |
9 // | 9 // |
10 // Terminology | 10 // Terminology |
(...skipping 30 matching lines...) Expand all Loading... |
41 // | 41 // |
42 // Icon bitmaps returned should be treated as const since they may be referenced | 42 // Icon bitmaps returned should be treated as const since they may be referenced |
43 // by other clients. Make a copy of the icon if you need to modify it. | 43 // by other clients. Make a copy of the icon if you need to modify it. |
44 | 44 |
45 #ifndef CHROME_BROWSER_ICON_MANAGER_H_ | 45 #ifndef CHROME_BROWSER_ICON_MANAGER_H_ |
46 #define CHROME_BROWSER_ICON_MANAGER_H_ | 46 #define CHROME_BROWSER_ICON_MANAGER_H_ |
47 | 47 |
48 #include <map> | 48 #include <map> |
49 | 49 |
50 #include "base/files/file_path.h" | 50 #include "base/files/file_path.h" |
| 51 #include "base/macros.h" |
51 #include "base/task/cancelable_task_tracker.h" | 52 #include "base/task/cancelable_task_tracker.h" |
52 #include "chrome/browser/icon_loader.h" | 53 #include "chrome/browser/icon_loader.h" |
53 #include "ui/gfx/image/image.h" | 54 #include "ui/gfx/image/image.h" |
54 | 55 |
55 class IconManager : public IconLoader::Delegate { | 56 class IconManager : public IconLoader::Delegate { |
56 public: | 57 public: |
57 IconManager(); | 58 IconManager(); |
58 ~IconManager() override; | 59 ~IconManager() override; |
59 | 60 |
60 // Synchronous call to examine the internal caches for the icon. Returns the | 61 // Synchronous call to examine the internal caches for the icon. Returns the |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 | 112 |
112 // Asynchronous requests that have not yet been completed. | 113 // Asynchronous requests that have not yet been completed. |
113 struct ClientRequest; | 114 struct ClientRequest; |
114 typedef std::map<IconLoader*, ClientRequest> ClientRequests; | 115 typedef std::map<IconLoader*, ClientRequest> ClientRequests; |
115 ClientRequests requests_; | 116 ClientRequests requests_; |
116 | 117 |
117 DISALLOW_COPY_AND_ASSIGN(IconManager); | 118 DISALLOW_COPY_AND_ASSIGN(IconManager); |
118 }; | 119 }; |
119 | 120 |
120 #endif // CHROME_BROWSER_ICON_MANAGER_H_ | 121 #endif // CHROME_BROWSER_ICON_MANAGER_H_ |
OLD | NEW |