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_NTP_FAVICON_WEBUI_HANDLER_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_NTP_FAVICON_WEBUI_HANDLER_H_ |
6 #define CHROME_BROWSER_UI_WEBUI_NTP_FAVICON_WEBUI_HANDLER_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_NTP_FAVICON_WEBUI_HANDLER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 22 matching lines...) Expand all Loading... |
33 void HandleGetFaviconDominantColor(const base::ListValue* args); | 33 void HandleGetFaviconDominantColor(const base::ListValue* args); |
34 | 34 |
35 // As above, but for an app tile. The sole argument is the extension ID. | 35 // As above, but for an app tile. The sole argument is the extension ID. |
36 void HandleGetAppIconDominantColor(const base::ListValue* args); | 36 void HandleGetAppIconDominantColor(const base::ListValue* args); |
37 | 37 |
38 // Callback getting signal that an app icon is loaded. | 38 // Callback getting signal that an app icon is loaded. |
39 void NotifyAppIconReady(const std::string& extension_id); | 39 void NotifyAppIconReady(const std::string& extension_id); |
40 | 40 |
41 private: | 41 private: |
42 // Called when favicon data is available from the history backend. | 42 // Called when favicon data is available from the history backend. |
43 void OnFaviconDataAvailable(FaviconService::Handle request_handle, | 43 void OnFaviconDataAvailable( |
44 history::FaviconData favicon); | 44 FaviconService::Handle request_handle, |
| 45 const history::FaviconBitmapResult& bitmap_result); |
45 | 46 |
46 CancelableRequestConsumerTSimple<int> consumer_; | 47 CancelableRequestConsumerTSimple<int> consumer_; |
47 | 48 |
48 // Map from request ID to DOM ID so we can make the appropriate callback when | 49 // Map from request ID to DOM ID so we can make the appropriate callback when |
49 // the favicon request comes back. This map exists because | 50 // the favicon request comes back. This map exists because |
50 // CancelableRequestConsumerTSimple only takes POD keys. | 51 // CancelableRequestConsumerTSimple only takes POD keys. |
51 std::map<int, std::string> dom_id_map_; | 52 std::map<int, std::string> dom_id_map_; |
52 // A counter to track ID numbers as we use them. | 53 // A counter to track ID numbers as we use them. |
53 int id_; | 54 int id_; |
54 | 55 |
55 // Raw PNG representation of the favicon to show when the favicon | 56 // Raw PNG representation of the favicon to show when the favicon |
56 // database doesn't have a favicon for a webpage. | 57 // database doesn't have a favicon for a webpage. |
57 scoped_refptr<base::RefCountedMemory> default_favicon_; | 58 scoped_refptr<base::RefCountedMemory> default_favicon_; |
58 | 59 |
59 // Manage retrieval of icons from apps. | 60 // Manage retrieval of icons from apps. |
60 scoped_ptr<ExtensionIconColorManager> app_icon_color_manager_; | 61 scoped_ptr<ExtensionIconColorManager> app_icon_color_manager_; |
61 | 62 |
62 DISALLOW_COPY_AND_ASSIGN(FaviconWebUIHandler); | 63 DISALLOW_COPY_AND_ASSIGN(FaviconWebUIHandler); |
63 }; | 64 }; |
64 | 65 |
65 #endif // CHROME_BROWSER_UI_WEBUI_NTP_FAVICON_WEBUI_HANDLER_H_ | 66 #endif // CHROME_BROWSER_UI_WEBUI_NTP_FAVICON_WEBUI_HANDLER_H_ |
OLD | NEW |