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_UI_WEBUI_EXTENSION_ICON_SOURCE_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_EXTENSION_ICON_SOURCE_H_ |
6 #define CHROME_BROWSER_UI_WEBUI_EXTENSION_ICON_SOURCE_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_EXTENSION_ICON_SOURCE_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 virtual ~ExtensionIconSource(); | 56 virtual ~ExtensionIconSource(); |
57 | 57 |
58 // Gets the URL of the |extension| icon in the given |size|, falling back | 58 // Gets the URL of the |extension| icon in the given |size|, falling back |
59 // based on the |match| type. If |grayscale|, the URL will be for the | 59 // based on the |match| type. If |grayscale|, the URL will be for the |
60 // desaturated version of the icon. | 60 // desaturated version of the icon. |
61 static GURL GetIconURL(const Extension* extension, | 61 static GURL GetIconURL(const Extension* extension, |
62 Extension::Icons icon_size, | 62 Extension::Icons icon_size, |
63 ExtensionIconSet::MatchType match, | 63 ExtensionIconSet::MatchType match, |
64 bool grayscale); | 64 bool grayscale); |
65 | 65 |
| 66 // A public utility function for accessing the bitmap of the image specified |
| 67 // by |resource_id|. |
| 68 static SkBitmap* LoadImageByResourceId(int resource_id); |
| 69 |
66 // ChromeURLDataManager::DataSource | 70 // ChromeURLDataManager::DataSource |
67 | 71 |
68 virtual std::string GetMimeType(const std::string&) const; | 72 virtual std::string GetMimeType(const std::string&) const; |
69 | 73 |
70 virtual void StartDataRequest(const std::string& path, | 74 virtual void StartDataRequest(const std::string& path, |
71 bool is_incognito, | 75 bool is_incognito, |
72 int request_id); | 76 int request_id); |
73 | 77 |
74 | 78 |
75 private: | 79 private: |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 scoped_ptr<SkBitmap> default_app_data_; | 155 scoped_ptr<SkBitmap> default_app_data_; |
152 | 156 |
153 scoped_ptr<SkBitmap> default_extension_data_; | 157 scoped_ptr<SkBitmap> default_extension_data_; |
154 | 158 |
155 CancelableRequestConsumerT<int, 0> cancelable_consumer_; | 159 CancelableRequestConsumerT<int, 0> cancelable_consumer_; |
156 | 160 |
157 DISALLOW_COPY_AND_ASSIGN(ExtensionIconSource); | 161 DISALLOW_COPY_AND_ASSIGN(ExtensionIconSource); |
158 }; | 162 }; |
159 | 163 |
160 #endif // CHROME_BROWSER_UI_WEBUI_EXTENSION_ICON_SOURCE_H_ | 164 #endif // CHROME_BROWSER_UI_WEBUI_EXTENSION_ICON_SOURCE_H_ |
OLD | NEW |