Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(382)

Side by Side Diff: android_webview/browser/icon_helper.cc

Issue 934693002: Reload favicon from HTTP cache on Ctrl+Refresh (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/android/shortcut_helper.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 67
68 switch(i->icon_type) { 68 switch(i->icon_type) {
69 case content::FaviconURL::FAVICON: 69 case content::FaviconURL::FAVICON:
70 if ((listener_ && !listener_->ShouldDownloadFavicon(i->icon_url)) || 70 if ((listener_ && !listener_->ShouldDownloadFavicon(i->icon_url)) ||
71 WasUnableToDownloadFavicon(i->icon_url)) { 71 WasUnableToDownloadFavicon(i->icon_url)) {
72 break; 72 break;
73 } 73 }
74 web_contents()->DownloadImage(i->icon_url, 74 web_contents()->DownloadImage(i->icon_url,
75 true, // Is a favicon 75 true, // Is a favicon
76 0, // No maximum size 76 0, // No maximum size
77 false, // Normal cache policy
77 base::Bind( 78 base::Bind(
78 &IconHelper::DownloadFaviconCallback, base::Unretained(this))); 79 &IconHelper::DownloadFaviconCallback, base::Unretained(this)));
79 break; 80 break;
80 case content::FaviconURL::TOUCH_ICON: 81 case content::FaviconURL::TOUCH_ICON:
81 if (listener_) 82 if (listener_)
82 listener_->OnReceivedTouchIconUrl(i->icon_url.spec(), false); 83 listener_->OnReceivedTouchIconUrl(i->icon_url.spec(), false);
83 break; 84 break;
84 case content::FaviconURL::TOUCH_PRECOMPOSED_ICON: 85 case content::FaviconURL::TOUCH_PRECOMPOSED_ICON:
85 if (listener_) 86 if (listener_)
86 listener_->OnReceivedTouchIconUrl(i->icon_url.spec(), true); 87 listener_->OnReceivedTouchIconUrl(i->icon_url.spec(), true);
(...skipping 23 matching lines...) Expand all
110 bool IconHelper::WasUnableToDownloadFavicon(const GURL& icon_url) const { 111 bool IconHelper::WasUnableToDownloadFavicon(const GURL& icon_url) const {
111 MissingFaviconURLHash url_hash = base::Hash(icon_url.spec()); 112 MissingFaviconURLHash url_hash = base::Hash(icon_url.spec());
112 return missing_favicon_urls_.find(url_hash) != missing_favicon_urls_.end(); 113 return missing_favicon_urls_.find(url_hash) != missing_favicon_urls_.end();
113 } 114 }
114 115
115 void IconHelper::ClearUnableToDownloadFavicons() { 116 void IconHelper::ClearUnableToDownloadFavicons() {
116 missing_favicon_urls_.clear(); 117 missing_favicon_urls_.clear();
117 } 118 }
118 119
119 } // namespace android_webview 120 } // namespace android_webview
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/android/shortcut_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698