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
3 // found in the LICENSE file.
5 #ifndef ANDROID_WEBVIEW_BROWSER_ICON_HELPER_H_
6 #define ANDROID_WEBVIEW_BROWSER_ICON_HELPER_H_
9 #include "content/public/browser/web_contents_observer.h"
17 namespace android_webview
{
19 // A helper that observes favicon changes for Webview.
20 class IconHelper
: public content::WebContentsObserver
{
24 virtual void OnReceivedIcon(const SkBitmap
& bitmap
) = 0;
25 virtual void OnReceivedTouchIconUrl(const std::string
& url
,
26 const bool precomposed
) = 0;
28 virtual ~Listener() {}
31 explicit IconHelper(content::WebContents
* web_contents
);
32 virtual ~IconHelper();
34 void SetListener(Listener
* listener
);
36 // From WebContentsObserver
37 virtual void DidUpdateFaviconURL(int32 page_id
,
38 const std::vector
<content::FaviconURL
>& candidates
) OVERRIDE
;
40 void DownloadFaviconCallback(int id
, const GURL
& image_url
,
41 int requested_size
, const std::vector
<SkBitmap
>& bitmaps
);
46 DISALLOW_COPY_AND_ASSIGN(IconHelper
);
49 } // namespace android_webview
51 #endif // ANDROID_WEBVIEW_BROWSER_ICON_HELPER_H_