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 #ifndef CHROME_BROWSER_UI_WEBUI_EXTENSIONS_EXTENSION_ICON_SOURCE_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_EXTENSIONS_EXTENSION_ICON_SOURCE_H_ |
6 #define CHROME_BROWSER_UI_WEBUI_EXTENSIONS_EXTENSION_ICON_SOURCE_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_EXTENSIONS_EXTENSION_ICON_SOURCE_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 | 88 |
89 // Loads the extension's |icon| for the given |request_id| and returns the | 89 // Loads the extension's |icon| for the given |request_id| and returns the |
90 // image to the client. | 90 // image to the client. |
91 void LoadExtensionImage(const ExtensionResource& icon, int request_id); | 91 void LoadExtensionImage(const ExtensionResource& icon, int request_id); |
92 | 92 |
93 // Loads the favicon image for the app associated with the |request_id|. If | 93 // Loads the favicon image for the app associated with the |request_id|. If |
94 // the image does not exist, we fall back to the default image. | 94 // the image does not exist, we fall back to the default image. |
95 void LoadFaviconImage(int request_id); | 95 void LoadFaviconImage(int request_id); |
96 | 96 |
97 // FaviconService callback | 97 // FaviconService callback |
98 void OnFaviconDataAvailable(FaviconService::Handle request_handle, | 98 void OnFaviconDataAvailable( |
99 history::FaviconData favicon); | 99 FaviconService::Handle request_handle, |
| 100 const history::FaviconBitmapResult& bitmap_result); |
100 | 101 |
101 // ImageLoadingTracker::Observer | 102 // ImageLoadingTracker::Observer |
102 virtual void OnImageLoaded(const gfx::Image& image, | 103 virtual void OnImageLoaded(const gfx::Image& image, |
103 const std::string& extension_id, | 104 const std::string& extension_id, |
104 int id) OVERRIDE; | 105 int id) OVERRIDE; |
105 | 106 |
106 // Called when the extension doesn't have an icon. We fall back to multiple | 107 // Called when the extension doesn't have an icon. We fall back to multiple |
107 // sources, using the following order: | 108 // sources, using the following order: |
108 // 1) The icons as listed in the extension / app manifests. | 109 // 1) The icons as listed in the extension / app manifests. |
109 // 2) If a 16px icon and the extension has a launch URL, see if Chrome | 110 // 2) If a 16px icon and the extension has a launch URL, see if Chrome |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 scoped_ptr<ImageLoadingTracker> tracker_; | 144 scoped_ptr<ImageLoadingTracker> tracker_; |
144 | 145 |
145 int next_tracker_id_; | 146 int next_tracker_id_; |
146 | 147 |
147 CancelableRequestConsumerT<int, 0> cancelable_consumer_; | 148 CancelableRequestConsumerT<int, 0> cancelable_consumer_; |
148 | 149 |
149 DISALLOW_COPY_AND_ASSIGN(ExtensionIconSource); | 150 DISALLOW_COPY_AND_ASSIGN(ExtensionIconSource); |
150 }; | 151 }; |
151 | 152 |
152 #endif // CHROME_BROWSER_UI_WEBUI_EXTENSIONS_EXTENSION_ICON_SOURCE_H_ | 153 #endif // CHROME_BROWSER_UI_WEBUI_EXTENSIONS_EXTENSION_ICON_SOURCE_H_ |
OLD | NEW |