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

Side by Side Diff: components/favicon/core/large_icon_service.cc

Issue 2804293003: [LargeIconService] Adding URL fallback for the server (Closed)
Patch Set: Fix the unit-test Created 3 years, 8 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 | components/favicon/core/large_icon_service_unittest.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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/favicon/core/large_icon_service.h" 5 #include "components/favicon/core/large_icon_service.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/location.h" 10 #include "base/location.h"
(...skipping 14 matching lines...) Expand all
25 #include "ui/gfx/codec/png_codec.h" 25 #include "ui/gfx/codec/png_codec.h"
26 #include "ui/gfx/geometry/size.h" 26 #include "ui/gfx/geometry/size.h"
27 #include "url/url_canon.h" 27 #include "url/url_canon.h"
28 28
29 namespace favicon { 29 namespace favicon {
30 namespace { 30 namespace {
31 31
32 const char kGoogleServerV2RequestFormat[] = 32 const char kGoogleServerV2RequestFormat[] =
33 "https://t0.gstatic.com/faviconV2?" 33 "https://t0.gstatic.com/faviconV2?"
34 "client=chrome&drop_404_icon=true&size=%d&min_size=%d&max_size=%d&" 34 "client=chrome&drop_404_icon=true&size=%d&min_size=%d&max_size=%d&"
35 "fallback_opts=TYPE,SIZE&url=%s"; 35 "fallback_opts=TYPE,SIZE,URL&url=%s";
36 const int kGoogleServerV2MaxSizeInPixel = 128; 36 const int kGoogleServerV2MaxSizeInPixel = 128;
37 const int kGoogleServerV2DesiredSizeInPixel = 64; 37 const int kGoogleServerV2DesiredSizeInPixel = 64;
38 38
39 GURL TrimPageUrlForGoogleServer(const GURL& page_url) { 39 GURL TrimPageUrlForGoogleServer(const GURL& page_url) {
40 if (!page_url.SchemeIsHTTPOrHTTPS() || page_url.HostIsIPAddress()) 40 if (!page_url.SchemeIsHTTPOrHTTPS() || page_url.HostIsIPAddress())
41 return GURL(); 41 return GURL();
42 42
43 url::Replacements<char> replacements; 43 url::Replacements<char> replacements;
44 replacements.ClearUsername(); 44 replacements.ClearUsername();
45 replacements.ClearPassword(); 45 replacements.ClearPassword();
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after
333 // TODO(beaudoin): For now this is just a wrapper around 333 // TODO(beaudoin): For now this is just a wrapper around
334 // GetLargestRawFaviconForPageURL. Add the logic required to select the best 334 // GetLargestRawFaviconForPageURL. Add the logic required to select the best
335 // possible large icon. Also add logic to fetch-on-demand when the URL of 335 // possible large icon. Also add logic to fetch-on-demand when the URL of
336 // a large icon is known but its bitmap is not available. 336 // a large icon is known but its bitmap is not available.
337 return favicon_service_->GetLargestRawFaviconForPageURL( 337 return favicon_service_->GetLargestRawFaviconForPageURL(
338 page_url, large_icon_types_, min_source_size_in_pixel, 338 page_url, large_icon_types_, min_source_size_in_pixel,
339 base::Bind(&LargeIconWorker::OnIconLookupComplete, worker), tracker); 339 base::Bind(&LargeIconWorker::OnIconLookupComplete, worker), tracker);
340 } 340 }
341 341
342 } // namespace favicon 342 } // namespace favicon
OLDNEW
« no previous file with comments | « no previous file | components/favicon/core/large_icon_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698