| 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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 // Loads the extension's |icon| for the given |request_id| and returns the | 93 // Loads the extension's |icon| for the given |request_id| and returns the |
| 94 // image to the client. | 94 // image to the client. |
| 95 void LoadExtensionImage(const ExtensionResource& icon, int request_id); | 95 void LoadExtensionImage(const ExtensionResource& icon, int request_id); |
| 96 | 96 |
| 97 // Loads the favicon image for the app associated with the |request_id|. If | 97 // Loads the favicon image for the app associated with the |request_id|. If |
| 98 // the image does not exist, we fall back to the default image. | 98 // the image does not exist, we fall back to the default image. |
| 99 void LoadFaviconImage(int request_id); | 99 void LoadFaviconImage(int request_id); |
| 100 | 100 |
| 101 // FaviconService callback | 101 // FaviconService callback |
| 102 void OnFaviconDataAvailable(FaviconService::Handle request_handle, | 102 void OnFaviconDataAvailable(FaviconService::Handle request_handle, |
| 103 bool know_favicon, | 103 history::FaviconData favicon); |
| 104 scoped_refptr<RefCountedMemory> data, | |
| 105 bool expired, | |
| 106 GURL icon_url); | |
| 107 | 104 |
| 108 // ImageLoadingTracker::Observer | 105 // ImageLoadingTracker::Observer |
| 109 virtual void OnImageLoaded(SkBitmap* image, | 106 virtual void OnImageLoaded(SkBitmap* image, |
| 110 const ExtensionResource& resource, | 107 const ExtensionResource& resource, |
| 111 int id); | 108 int id); |
| 112 | 109 |
| 113 // Called when the extension doesn't have an icon. We fall back to multiple | 110 // Called when the extension doesn't have an icon. We fall back to multiple |
| 114 // sources, using the following order: | 111 // sources, using the following order: |
| 115 // 1) The icons as listed in the extension / app manifests. | 112 // 1) The icons as listed in the extension / app manifests. |
| 116 // 2) If a 16px icon and the extension has a launch URL, see if Chrome | 113 // 2) If a 16px icon and the extension has a launch URL, see if Chrome |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 scoped_ptr<SkBitmap> default_app_data_; | 151 scoped_ptr<SkBitmap> default_app_data_; |
| 155 | 152 |
| 156 scoped_ptr<SkBitmap> default_extension_data_; | 153 scoped_ptr<SkBitmap> default_extension_data_; |
| 157 | 154 |
| 158 CancelableRequestConsumerT<int, 0> cancelable_consumer_; | 155 CancelableRequestConsumerT<int, 0> cancelable_consumer_; |
| 159 | 156 |
| 160 DISALLOW_COPY_AND_ASSIGN(ExtensionIconSource); | 157 DISALLOW_COPY_AND_ASSIGN(ExtensionIconSource); |
| 161 }; | 158 }; |
| 162 | 159 |
| 163 #endif // CHROME_BROWSER_UI_WEBUI_EXTENSION_ICON_SOURCE_H_ | 160 #endif // CHROME_BROWSER_UI_WEBUI_EXTENSION_ICON_SOURCE_H_ |
| OLD | NEW |