| 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" |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 break; | 91 break; |
| 92 default: | 92 default: |
| 93 NOTREACHED(); | 93 NOTREACHED(); |
| 94 break; | 94 break; |
| 95 } | 95 } |
| 96 } | 96 } |
| 97 } | 97 } |
| 98 | 98 |
| 99 void IconHelper::DidStartNavigationToPendingEntry( | 99 void IconHelper::DidStartNavigationToPendingEntry( |
| 100 const GURL& url, | 100 const GURL& url, |
| 101 content::NavigationController::ReloadType reload_type) { | 101 content::ReloadType reload_type) { |
| 102 if (reload_type == content::NavigationController::RELOAD_BYPASSING_CACHE) | 102 if (reload_type == content::ReloadType::BYPASSING_CACHE) |
| 103 ClearUnableToDownloadFavicons(); | 103 ClearUnableToDownloadFavicons(); |
| 104 } | 104 } |
| 105 | 105 |
| 106 void IconHelper::MarkUnableToDownloadFavicon(const GURL& icon_url) { | 106 void IconHelper::MarkUnableToDownloadFavicon(const GURL& icon_url) { |
| 107 MissingFaviconURLHash url_hash = base::Hash(icon_url.spec()); | 107 MissingFaviconURLHash url_hash = base::Hash(icon_url.spec()); |
| 108 missing_favicon_urls_.insert(url_hash); | 108 missing_favicon_urls_.insert(url_hash); |
| 109 } | 109 } |
| 110 | 110 |
| 111 bool IconHelper::WasUnableToDownloadFavicon(const GURL& icon_url) const { | 111 bool IconHelper::WasUnableToDownloadFavicon(const GURL& icon_url) const { |
| 112 MissingFaviconURLHash url_hash = base::Hash(icon_url.spec()); | 112 MissingFaviconURLHash url_hash = base::Hash(icon_url.spec()); |
| 113 return missing_favicon_urls_.find(url_hash) != missing_favicon_urls_.end(); | 113 return missing_favicon_urls_.find(url_hash) != missing_favicon_urls_.end(); |
| 114 } | 114 } |
| 115 | 115 |
| 116 void IconHelper::ClearUnableToDownloadFavicons() { | 116 void IconHelper::ClearUnableToDownloadFavicons() { |
| 117 missing_favicon_urls_.clear(); | 117 missing_favicon_urls_.clear(); |
| 118 } | 118 } |
| 119 | 119 |
| 120 } // namespace android_webview | 120 } // namespace android_webview |
| OLD | NEW |