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

Side by Side Diff: components/ntp_tiles/icon_cacher_impl.cc

Issue 2896803002: [LargeIconService] Make check_seen param optional for fetching (Closed)
Patch Set: Comments on unit-test Created 3 years, 7 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 | « components/ntp_snippets/content_suggestions_service.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "components/ntp_tiles/icon_cacher_impl.h" 5 #include "components/ntp_tiles/icon_cacher_impl.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/memory/ptr_util.h" 9 #include "base/memory/ptr_util.h"
10 #include "base/metrics/histogram_macros.h" 10 #include "base/metrics/histogram_macros.h"
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 if (!HasResultDefaultBackgroundColor(result)) { 212 if (!HasResultDefaultBackgroundColor(result)) {
213 // We should only fetch for default "gray" tiles so that we never overrite 213 // We should only fetch for default "gray" tiles so that we never overrite
214 // any favicon of any size. 214 // any favicon of any size.
215 FinishRequestAndNotifyIconAvailable(page_url, /*newly_available=*/false); 215 FinishRequestAndNotifyIconAvailable(page_url, /*newly_available=*/false);
216 return; 216 return;
217 } 217 }
218 218
219 large_icon_service_ 219 large_icon_service_
220 ->GetLargeIconOrFallbackStyleFromGoogleServerSkippingLocalCache( 220 ->GetLargeIconOrFallbackStyleFromGoogleServerSkippingLocalCache(
221 page_url, kTileIconMinSizePx, kTileIconDesiredSizePx, 221 page_url, kTileIconMinSizePx, kTileIconDesiredSizePx,
222 /*may_page_url_be_private=*/true,
222 base::Bind(&IconCacherImpl::OnMostLikelyFaviconDownloaded, 223 base::Bind(&IconCacherImpl::OnMostLikelyFaviconDownloaded,
223 weak_ptr_factory_.GetWeakPtr(), page_url)); 224 weak_ptr_factory_.GetWeakPtr(), page_url));
224 } 225 }
225 226
226 void IconCacherImpl::OnMostLikelyFaviconDownloaded(const GURL& request_url, 227 void IconCacherImpl::OnMostLikelyFaviconDownloaded(const GURL& request_url,
227 bool success) { 228 bool success) {
228 UMA_HISTOGRAM_BOOLEAN("NewTabPage.TileFaviconFetchSuccess.Server", success); 229 UMA_HISTOGRAM_BOOLEAN("NewTabPage.TileFaviconFetchSuccess.Server", success);
229 FinishRequestAndNotifyIconAvailable(request_url, success); 230 FinishRequestAndNotifyIconAvailable(request_url, success);
230 } 231 }
231 232
(...skipping 14 matching lines...) Expand all
246 return; 247 return;
247 } 248 }
248 for (const base::Closure& callback : callbacks) { 249 for (const base::Closure& callback : callbacks) {
249 if (callback) { 250 if (callback) {
250 callback.Run(); 251 callback.Run();
251 } 252 }
252 } 253 }
253 } 254 }
254 255
255 } // namespace ntp_tiles 256 } // namespace ntp_tiles
OLDNEW
« no previous file with comments | « components/ntp_snippets/content_suggestions_service.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698