OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_ICON_MANAGER_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_ICON_MANAGER_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_ICON_MANAGER_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_ICON_MANAGER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 #include <set> | 10 #include <set> |
11 #include <string> | 11 #include <string> |
12 | 12 |
13 #include "base/basictypes.h" | 13 #include "base/basictypes.h" |
14 #include "chrome/browser/extensions/image_loading_tracker.h" | 14 #include "chrome/browser/extensions/image_loading_tracker.h" |
15 #include "third_party/skia/include/core/SkBitmap.h" | 15 #include "third_party/skia/include/core/SkBitmap.h" |
16 #include "ui/gfx/insets.h" | 16 #include "ui/gfx/insets.h" |
17 | 17 |
| 18 namespace extensions { |
18 class Extension; | 19 class Extension; |
| 20 } |
19 | 21 |
20 class ExtensionIconManager : public ImageLoadingTracker::Observer { | 22 class ExtensionIconManager : public ImageLoadingTracker::Observer { |
21 public: | 23 public: |
22 ExtensionIconManager(); | 24 ExtensionIconManager(); |
23 virtual ~ExtensionIconManager(); | 25 virtual ~ExtensionIconManager(); |
24 | 26 |
25 // Start loading the icon for the given extension. | 27 // Start loading the icon for the given extension. |
26 void LoadIcon(const Extension* extension); | 28 void LoadIcon(const extensions::Extension* extension); |
27 | 29 |
28 // This returns a bitmap of width/height kFaviconSize, loaded either from an | 30 // This returns a bitmap of width/height kFaviconSize, loaded either from an |
29 // entry specified in the extension's 'icon' section of the manifest, or a | 31 // entry specified in the extension's 'icon' section of the manifest, or a |
30 // default extension icon. | 32 // default extension icon. |
31 const SkBitmap& GetIcon(const std::string& extension_id); | 33 const SkBitmap& GetIcon(const std::string& extension_id); |
32 | 34 |
33 // Removes the extension's icon from memory. | 35 // Removes the extension's icon from memory. |
34 void RemoveIcon(const std::string& extension_id); | 36 void RemoveIcon(const std::string& extension_id); |
35 | 37 |
36 // Implements the ImageLoadingTracker::Observer interface. | 38 // Implements the ImageLoadingTracker::Observer interface. |
(...skipping 28 matching lines...) Expand all Loading... |
65 // If true, we will desaturate the icons to make them monochromatic. | 67 // If true, we will desaturate the icons to make them monochromatic. |
66 bool monochrome_; | 68 bool monochrome_; |
67 | 69 |
68 // Specifies the amount of empty padding to place around the icon. | 70 // Specifies the amount of empty padding to place around the icon. |
69 gfx::Insets padding_; | 71 gfx::Insets padding_; |
70 | 72 |
71 DISALLOW_COPY_AND_ASSIGN(ExtensionIconManager); | 73 DISALLOW_COPY_AND_ASSIGN(ExtensionIconManager); |
72 }; | 74 }; |
73 | 75 |
74 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_ICON_MANAGER_H_ | 76 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_ICON_MANAGER_H_ |
OLD | NEW |