OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_BROWSER_UI_WEBUI_NTP_FAVICON_WEBUI_HANDLER_H_ |
| 6 #define CHROME_BROWSER_UI_WEBUI_NTP_FAVICON_WEBUI_HANDLER_H_ |
| 7 #pragma once |
| 8 |
| 9 #include <string> |
| 10 |
| 11 #include "base/basictypes.h" |
| 12 #include "base/memory/ref_counted.h" |
| 13 #include "chrome/browser/favicon/favicon_service.h" |
| 14 #include "content/browser/webui/web_ui.h" |
| 15 |
| 16 class GURL; |
| 17 class ListValue; |
| 18 class Profile; |
| 19 |
| 20 class FaviconWebUIHandler : public WebUIMessageHandler { |
| 21 public: |
| 22 FaviconWebUIHandler(); |
| 23 virtual ~FaviconWebUIHandler(); |
| 24 |
| 25 // WebUIMessageHandler |
| 26 virtual void RegisterMessages(); |
| 27 |
| 28 void HandleGetFaviconDominantColor(const ListValue* args); |
| 29 |
| 30 private: |
| 31 // Called when favicon data is available from the history backend. |
| 32 void OnFaviconDataAvailable(FaviconService::Handle request_handle, |
| 33 history::FaviconData favicon); |
| 34 |
| 35 CancelableRequestConsumerTSimple<int> consumer_; |
| 36 |
| 37 // Raw PNG representation of the favicon to show when the favicon |
| 38 // database doesn't have a favicon for a webpage. |
| 39 scoped_refptr<RefCountedMemory> default_favicon_; |
| 40 |
| 41 DISALLOW_COPY_AND_ASSIGN(FaviconWebUIHandler); |
| 42 }; |
| 43 |
| 44 #endif // CHROME_BROWSER_UI_WEBUI_NTP_FAVICON_WEBUI_HANDLER_H_ |
OLD | NEW |