| 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 |
| 11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| 12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
| 13 #include "base/task/cancelable_task_tracker.h" | 13 #include "base/task/cancelable_task_tracker.h" |
| 14 #include "components/favicon_base/favicon_types.h" | 14 #include "components/favicon_base/favicon_types.h" |
| 15 #include "content/public/browser/web_ui_message_handler.h" | 15 #include "content/public/browser/web_ui_message_handler.h" |
| 16 | 16 |
| 17 class ExtensionIconColorManager; | 17 class ExtensionIconColorManager; |
| 18 | 18 |
| 19 namespace base { | 19 namespace base { |
| 20 class ListValue; | 20 class ListValue; |
| 21 } | 21 } |
| 22 | 22 |
| 23 class FaviconWebUIHandler : public content::WebUIMessageHandler { | 23 class FaviconWebUIHandler : public content::WebUIMessageHandler { |
| 24 public: | 24 public: |
| 25 FaviconWebUIHandler(); | 25 FaviconWebUIHandler(); |
| 26 virtual ~FaviconWebUIHandler(); | 26 virtual ~FaviconWebUIHandler(); |
| 27 | 27 |
| 28 // WebUIMessageHandler | 28 // WebUIMessageHandler |
| 29 virtual void RegisterMessages() OVERRIDE; | 29 virtual void RegisterMessages() override; |
| 30 | 30 |
| 31 // Called from the JS to get the dominant color of a favicon. The first | 31 // Called from the JS to get the dominant color of a favicon. The first |
| 32 // argument is a favicon URL, the second is the ID of the DOM node that is | 32 // argument is a favicon URL, the second is the ID of the DOM node that is |
| 33 // asking for it. | 33 // asking for it. |
| 34 void HandleGetFaviconDominantColor(const base::ListValue* args); | 34 void HandleGetFaviconDominantColor(const base::ListValue* args); |
| 35 | 35 |
| 36 // As above, but for an app tile. The sole argument is the extension ID. | 36 // As above, but for an app tile. The sole argument is the extension ID. |
| 37 void HandleGetAppIconDominantColor(const base::ListValue* args); | 37 void HandleGetAppIconDominantColor(const base::ListValue* args); |
| 38 | 38 |
| 39 // Callback getting signal that an app icon is loaded. | 39 // Callback getting signal that an app icon is loaded. |
| (...skipping 18 matching lines...) Expand all Loading... |
| 58 // database doesn't have a favicon for a webpage. | 58 // database doesn't have a favicon for a webpage. |
| 59 scoped_refptr<base::RefCountedMemory> default_favicon_; | 59 scoped_refptr<base::RefCountedMemory> default_favicon_; |
| 60 | 60 |
| 61 // Manage retrieval of icons from apps. | 61 // Manage retrieval of icons from apps. |
| 62 scoped_ptr<ExtensionIconColorManager> app_icon_color_manager_; | 62 scoped_ptr<ExtensionIconColorManager> app_icon_color_manager_; |
| 63 | 63 |
| 64 DISALLOW_COPY_AND_ASSIGN(FaviconWebUIHandler); | 64 DISALLOW_COPY_AND_ASSIGN(FaviconWebUIHandler); |
| 65 }; | 65 }; |
| 66 | 66 |
| 67 #endif // CHROME_BROWSER_UI_WEBUI_NTP_FAVICON_WEBUI_HANDLER_H_ | 67 #endif // CHROME_BROWSER_UI_WEBUI_NTP_FAVICON_WEBUI_HANDLER_H_ |
| OLD | NEW |