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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 SkBitmap* GetDefaultExtensionImage(); | 90 SkBitmap* GetDefaultExtensionImage(); |
91 | 91 |
92 // Performs any remaining transformations (like desaturating the |image|), | 92 // Performs any remaining transformations (like desaturating the |image|), |
93 // then returns the |image| to the client and clears up any temporary data | 93 // then returns the |image| to the client and clears up any temporary data |
94 // associated with the |request_id|. | 94 // associated with the |request_id|. |
95 void FinalizeImage(SkBitmap* image, int request_id); | 95 void FinalizeImage(SkBitmap* image, int request_id); |
96 | 96 |
97 // Loads the default image for |request_id| and returns to the client. | 97 // Loads the default image for |request_id| and returns to the client. |
98 void LoadDefaultImage(int request_id); | 98 void LoadDefaultImage(int request_id); |
99 | 99 |
| 100 // Tries loading component extension image. These usually come from resources |
| 101 // instead of file system. Returns false if a given |icon| does not have |
| 102 // a corresponding image in bundled resources. |
| 103 bool TryLoadingComponentExtensionImage(const ExtensionResource& icon, |
| 104 int request_id); |
| 105 |
100 // Loads the extension's |icon| for the given |request_id| and returns the | 106 // Loads the extension's |icon| for the given |request_id| and returns the |
101 // image to the client. | 107 // image to the client. |
102 void LoadExtensionImage(const ExtensionResource& icon, int request_id); | 108 void LoadExtensionImage(const ExtensionResource& icon, int request_id); |
103 | 109 |
104 // Loads the favicon image for the app associated with the |request_id|. If | 110 // Loads the favicon image for the app associated with the |request_id|. If |
105 // the image does not exist, we fall back to the default image. | 111 // the image does not exist, we fall back to the default image. |
106 void LoadFaviconImage(int request_id); | 112 void LoadFaviconImage(int request_id); |
107 | 113 |
108 // FaviconService callback | 114 // FaviconService callback |
109 void OnFaviconDataAvailable(FaviconService::Handle request_handle, | 115 void OnFaviconDataAvailable(FaviconService::Handle request_handle, |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 scoped_ptr<SkBitmap> default_app_data_; | 164 scoped_ptr<SkBitmap> default_app_data_; |
159 | 165 |
160 scoped_ptr<SkBitmap> default_extension_data_; | 166 scoped_ptr<SkBitmap> default_extension_data_; |
161 | 167 |
162 CancelableRequestConsumerT<int, 0> cancelable_consumer_; | 168 CancelableRequestConsumerT<int, 0> cancelable_consumer_; |
163 | 169 |
164 DISALLOW_COPY_AND_ASSIGN(ExtensionIconSource); | 170 DISALLOW_COPY_AND_ASSIGN(ExtensionIconSource); |
165 }; | 171 }; |
166 | 172 |
167 #endif // CHROME_BROWSER_UI_WEBUI_EXTENSION_ICON_SOURCE_H_ | 173 #endif // CHROME_BROWSER_UI_WEBUI_EXTENSION_ICON_SOURCE_H_ |
OLD | NEW |