Use total page scale in the LayerScrollOffsetDelegate.
[chromium-blink-merge.git] / android_webview / browser / icon_helper.h
blobd96406358472ecee5ef0987b8a2c742846a17642
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_
8 #include <string>
9 #include "content/public/browser/web_contents_observer.h"
10 #include "url/gurl.h"
12 class SkBitmap;
14 namespace content {
15 struct FaviconURL;
18 namespace gfx {
19 class Size;
22 namespace android_webview {
24 // A helper that observes favicon changes for Webview.
25 class IconHelper : public content::WebContentsObserver {
26 public:
27 class Listener {
28 public:
29 virtual bool ShouldDownloadFavicon(const GURL& icon_url) = 0;
30 virtual void OnReceivedIcon(const GURL& icon_url,
31 const SkBitmap& bitmap) = 0;
32 virtual void OnReceivedTouchIconUrl(const std::string& url,
33 const bool precomposed) = 0;
34 protected:
35 virtual ~Listener() {}
38 explicit IconHelper(content::WebContents* web_contents);
39 virtual ~IconHelper();
41 void SetListener(Listener* listener);
43 // From WebContentsObserver
44 virtual void DidUpdateFaviconURL(int32 page_id,
45 const std::vector<content::FaviconURL>& candidates) OVERRIDE;
47 void DownloadFaviconCallback(
48 int id,
49 int http_status_code,
50 const GURL& image_url,
51 const std::vector<SkBitmap>& bitmaps,
52 const std::vector<gfx::Size>& original_bitmap_sizes);
54 private:
55 Listener* listener_;
57 DISALLOW_COPY_AND_ASSIGN(IconHelper);
60 } // namespace android_webview
62 #endif // ANDROID_WEBVIEW_BROWSER_ICON_HELPER_H_