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 #include "android_webview/browser/icon_helper.h" | 5 #include "android_webview/browser/icon_helper.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/hash.h" | 9 #include "base/hash.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
11 #include "content/public/browser/browser_thread.h" | 11 #include "content/public/browser/browser_thread.h" |
12 #include "content/public/browser/web_contents.h" | 12 #include "content/public/browser/web_contents.h" |
13 #include "content/public/common/favicon_url.h" | 13 #include "content/public/common/favicon_url.h" |
14 #include "third_party/skia/include/core/SkBitmap.h" | 14 #include "third_party/skia/include/core/SkBitmap.h" |
15 #include "ui/gfx/size.h" | 15 #include "ui/gfx/geometry/size.h" |
16 | 16 |
17 using content::BrowserThread; | 17 using content::BrowserThread; |
18 using content::WebContents; | 18 using content::WebContents; |
19 | 19 |
20 namespace android_webview { | 20 namespace android_webview { |
21 | 21 |
22 IconHelper::IconHelper(WebContents* web_contents) | 22 IconHelper::IconHelper(WebContents* web_contents) |
23 : WebContentsObserver(web_contents), | 23 : WebContentsObserver(web_contents), |
24 listener_(NULL), | 24 listener_(NULL), |
25 missing_favicon_urls_() { | 25 missing_favicon_urls_() { |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 bool IconHelper::WasUnableToDownloadFavicon(const GURL& icon_url) const { | 110 bool IconHelper::WasUnableToDownloadFavicon(const GURL& icon_url) const { |
111 MissingFaviconURLHash url_hash = base::Hash(icon_url.spec()); | 111 MissingFaviconURLHash url_hash = base::Hash(icon_url.spec()); |
112 return missing_favicon_urls_.find(url_hash) != missing_favicon_urls_.end(); | 112 return missing_favicon_urls_.find(url_hash) != missing_favicon_urls_.end(); |
113 } | 113 } |
114 | 114 |
115 void IconHelper::ClearUnableToDownloadFavicons() { | 115 void IconHelper::ClearUnableToDownloadFavicons() { |
116 missing_favicon_urls_.clear(); | 116 missing_favicon_urls_.clear(); |
117 } | 117 } |
118 | 118 |
119 } // namespace android_webview | 119 } // namespace android_webview |
OLD | NEW |