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

Side by Side Diff: chrome/browser/android/ntp/popular_sites.cc

Issue 1836213004: [NTP Popular Sites] Bump default version to 5 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 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 | 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 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 "chrome/browser/android/ntp/popular_sites.h" 5 #include "chrome/browser/android/ntp/popular_sites.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 21 matching lines...) Expand all
32 #include "components/variations/service/variations_service.h" 32 #include "components/variations/service/variations_service.h"
33 #include "content/public/browser/browser_thread.h" 33 #include "content/public/browser/browser_thread.h"
34 34
35 using content::BrowserThread; 35 using content::BrowserThread;
36 36
37 namespace { 37 namespace {
38 38
39 const char kPopularSitesURLFormat[] = "https://www.gstatic.com/chrome/ntp/%s"; 39 const char kPopularSitesURLFormat[] = "https://www.gstatic.com/chrome/ntp/%s";
40 const char kPopularSitesServerFilenameFormat[] = "suggested_sites_%s_%s.json"; 40 const char kPopularSitesServerFilenameFormat[] = "suggested_sites_%s_%s.json";
41 const char kPopularSitesDefaultCountryCode[] = "DEFAULT"; 41 const char kPopularSitesDefaultCountryCode[] = "DEFAULT";
42 const char kPopularSitesDefaultVersion[] = "3"; 42 const char kPopularSitesDefaultVersion[] = "5";
43 const char kPopularSitesLocalFilename[] = "suggested_sites.json"; 43 const char kPopularSitesLocalFilename[] = "suggested_sites.json";
44 const int kPopularSitesRedownloadIntervalHours = 24; 44 const int kPopularSitesRedownloadIntervalHours = 24;
45 45
46 const char kPopularSitesLastDownloadPref[] = "popular_sites_last_download"; 46 const char kPopularSitesLastDownloadPref[] = "popular_sites_last_download";
47 47
48 // Extract the country from the default search engine if the default search 48 // Extract the country from the default search engine if the default search
49 // engine is Google. 49 // engine is Google.
50 std::string GetDefaultSearchEngineCountryCode(Profile* profile) { 50 std::string GetDefaultSearchEngineCountryCode(Profile* profile) {
51 DCHECK(profile); 51 DCHECK(profile);
52 52
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after
277 base::Bind(&PopularSites::OnJsonParsed, weak_ptr_factory_.GetWeakPtr())); 277 base::Bind(&PopularSites::OnJsonParsed, weak_ptr_factory_.GetWeakPtr()));
278 } 278 }
279 279
280 void PopularSites::OnJsonParsed(scoped_ptr<std::vector<Site>> sites) { 280 void PopularSites::OnJsonParsed(scoped_ptr<std::vector<Site>> sites) {
281 if (sites) 281 if (sites)
282 sites_.swap(*sites); 282 sites_.swap(*sites);
283 else 283 else
284 sites_.clear(); 284 sites_.clear();
285 callback_.Run(!!sites); 285 callback_.Run(!!sites);
286 } 286 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698