Chromium Code Reviews| 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 <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <string> | 10 #include <string> |
| 11 | 11 |
| 12 #include "base/containers/hash_tables.h" | 12 #include "base/containers/hash_tables.h" |
| 13 #include "base/macros.h" | 13 #include "base/macros.h" |
| 14 #include "content/public/browser/web_contents_observer.h" | 14 #include "content/public/browser/web_contents_observer.h" |
|
Charlie Reis
2016/09/09 05:41:05
nit: Include-what-you-use. Many of these files ou
Takashi Toyoshima
2016/09/09 07:31:30
Done.
| |
| 15 #include "url/gurl.h" | 15 #include "url/gurl.h" |
| 16 | 16 |
| 17 class SkBitmap; | 17 class SkBitmap; |
| 18 | 18 |
| 19 namespace content { | 19 namespace content { |
| 20 struct FaviconURL; | 20 struct FaviconURL; |
| 21 } | 21 } |
| 22 | 22 |
| 23 namespace gfx { | 23 namespace gfx { |
| 24 class Size; | 24 class Size; |
| (...skipping 18 matching lines...) Expand all Loading... | |
| 43 explicit IconHelper(content::WebContents* web_contents); | 43 explicit IconHelper(content::WebContents* web_contents); |
| 44 ~IconHelper() override; | 44 ~IconHelper() override; |
| 45 | 45 |
| 46 void SetListener(Listener* listener); | 46 void SetListener(Listener* listener); |
| 47 | 47 |
| 48 // From WebContentsObserver | 48 // From WebContentsObserver |
| 49 void DidUpdateFaviconURL( | 49 void DidUpdateFaviconURL( |
| 50 const std::vector<content::FaviconURL>& candidates) override; | 50 const std::vector<content::FaviconURL>& candidates) override; |
| 51 void DidStartNavigationToPendingEntry( | 51 void DidStartNavigationToPendingEntry( |
| 52 const GURL& url, | 52 const GURL& url, |
| 53 content::NavigationController::ReloadType reload_type) override; | 53 content::ReloadType reload_type) override; |
| 54 | 54 |
| 55 void DownloadFaviconCallback( | 55 void DownloadFaviconCallback( |
| 56 int id, | 56 int id, |
| 57 int http_status_code, | 57 int http_status_code, |
| 58 const GURL& image_url, | 58 const GURL& image_url, |
| 59 const std::vector<SkBitmap>& bitmaps, | 59 const std::vector<SkBitmap>& bitmaps, |
| 60 const std::vector<gfx::Size>& original_bitmap_sizes); | 60 const std::vector<gfx::Size>& original_bitmap_sizes); |
| 61 | 61 |
| 62 private: | 62 private: |
| 63 void MarkUnableToDownloadFavicon(const GURL& icon_url); | 63 void MarkUnableToDownloadFavicon(const GURL& icon_url); |
| 64 bool WasUnableToDownloadFavicon(const GURL& icon_url) const; | 64 bool WasUnableToDownloadFavicon(const GURL& icon_url) const; |
| 65 void ClearUnableToDownloadFavicons(); | 65 void ClearUnableToDownloadFavicons(); |
| 66 | 66 |
| 67 Listener* listener_; | 67 Listener* listener_; |
| 68 | 68 |
| 69 typedef uint32_t MissingFaviconURLHash; | 69 typedef uint32_t MissingFaviconURLHash; |
| 70 base::hash_set<MissingFaviconURLHash> missing_favicon_urls_; | 70 base::hash_set<MissingFaviconURLHash> missing_favicon_urls_; |
| 71 | 71 |
| 72 DISALLOW_COPY_AND_ASSIGN(IconHelper); | 72 DISALLOW_COPY_AND_ASSIGN(IconHelper); |
| 73 }; | 73 }; |
| 74 | 74 |
| 75 } // namespace android_webview | 75 } // namespace android_webview |
| 76 | 76 |
| 77 #endif // ANDROID_WEBVIEW_BROWSER_ICON_HELPER_H_ | 77 #endif // ANDROID_WEBVIEW_BROWSER_ICON_HELPER_H_ |
| OLD | NEW |