| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 ANDROID_WEBVIEW_BROWSER_ICON_HELPER_H_ | 5 #ifndef ANDROID_WEBVIEW_BROWSER_ICON_HELPER_H_ |
| 6 #define ANDROID_WEBVIEW_BROWSER_ICON_HELPER_H_ | 6 #define ANDROID_WEBVIEW_BROWSER_ICON_HELPER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include "content/public/browser/web_contents_observer.h" | 9 #include "content/public/browser/web_contents_observer.h" |
| 10 #include "url/gurl.h" | 10 #include "url/gurl.h" |
| 11 | 11 |
| 12 class SkBitmap; | 12 class SkBitmap; |
| 13 | 13 |
| 14 namespace content { | 14 namespace content { |
| 15 struct FaviconURL; | 15 struct FaviconURL; |
| 16 } | 16 } |
| 17 | 17 |
| 18 namespace gfx { | 18 namespace gfx { |
| 19 class Size; | 19 class Size; |
| 20 } | 20 } |
| 21 | 21 |
| 22 namespace android_webview { | 22 namespace android_webview { |
| 23 | 23 |
| 24 // A helper that observes favicon changes for Webview. | 24 // A helper that observes favicon changes for Webview. |
| 25 class IconHelper : public content::WebContentsObserver { | 25 class IconHelper : public content::WebContentsObserver { |
| 26 public: | 26 public: |
| 27 class Listener { | 27 class Listener { |
| 28 public: | 28 public: |
| 29 virtual bool ShouldDownloadFavicon(const GURL& icon_url) = 0; |
| 29 virtual void OnReceivedIcon(const GURL& icon_url, | 30 virtual void OnReceivedIcon(const GURL& icon_url, |
| 30 const SkBitmap& bitmap) = 0; | 31 const SkBitmap& bitmap) = 0; |
| 31 virtual void OnReceivedTouchIconUrl(const std::string& url, | 32 virtual void OnReceivedTouchIconUrl(const std::string& url, |
| 32 const bool precomposed) = 0; | 33 const bool precomposed) = 0; |
| 33 protected: | 34 protected: |
| 34 virtual ~Listener() {} | 35 virtual ~Listener() {} |
| 35 }; | 36 }; |
| 36 | 37 |
| 37 explicit IconHelper(content::WebContents* web_contents); | 38 explicit IconHelper(content::WebContents* web_contents); |
| 38 virtual ~IconHelper(); | 39 virtual ~IconHelper(); |
| (...skipping 13 matching lines...) Expand all Loading... |
| 52 | 53 |
| 53 private: | 54 private: |
| 54 Listener* listener_; | 55 Listener* listener_; |
| 55 | 56 |
| 56 DISALLOW_COPY_AND_ASSIGN(IconHelper); | 57 DISALLOW_COPY_AND_ASSIGN(IconHelper); |
| 57 }; | 58 }; |
| 58 | 59 |
| 59 } // namespace android_webview | 60 } // namespace android_webview |
| 60 | 61 |
| 61 #endif // ANDROID_WEBVIEW_BROWSER_ICON_HELPER_H_ | 62 #endif // ANDROID_WEBVIEW_BROWSER_ICON_HELPER_H_ |
| OLD | NEW |