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

Unified Diff: chrome/browser/android/most_visited_sites.cc

Issue 1302773002: Popular sites on the NTP: add the option to provide the server filename through a variation param (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: redownload on filename change Created 5 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/android/popular_sites.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/android/most_visited_sites.cc
diff --git a/chrome/browser/android/most_visited_sites.cc b/chrome/browser/android/most_visited_sites.cc
index 960b46294bea2de01268329a6620893ed4283dd3..f87c950c8fbabe2d957dc2010fcd7783218051e6 100644
--- a/chrome/browser/android/most_visited_sites.cc
+++ b/chrome/browser/android/most_visited_sites.cc
@@ -76,6 +76,8 @@ const char kImpressionServerHistogramName[] =
const char kImpressionServerHistogramFormat[] =
"NewTabPage.SuggestionsImpression.server%d";
+const char kPopularSitesFieldTrialName[] = "NTPPopularSites";
+
scoped_ptr<SkBitmap> MaybeFetchLocalThumbnail(
const GURL& url,
const scoped_refptr<TopSites>& top_sites) {
@@ -118,7 +120,7 @@ bool ShouldShowPopularSites() {
// Note: It's important to query the field trial state first, to ensure that
// UMA reports the correct group.
const std::string group_name =
- base::FieldTrialList::FindFullName("NTPPopularSites");
+ base::FieldTrialList::FindFullName(kPopularSitesFieldTrialName);
base::CommandLine* cmd_line = base::CommandLine::ForCurrentProcess();
if (cmd_line->HasSwitch(switches::kDisableNTPPopularSites))
return false;
@@ -127,6 +129,11 @@ bool ShouldShowPopularSites() {
return group_name == "Enabled";
}
+std::string GetPopularSitesFilename() {
+ return variations::GetVariationParamValue(kPopularSitesFieldTrialName,
+ "filename");
+}
+
} // namespace
MostVisitedSites::MostVisitedSites(Profile* profile)
@@ -149,6 +156,7 @@ MostVisitedSites::MostVisitedSites(Profile* profile)
if (ShouldShowPopularSites()) {
popular_sites_.reset(new PopularSites(
+ GetPopularSitesFilename(),
profile_->GetRequestContext(),
base::Bind(&MostVisitedSites::OnPopularSitesAvailable,
base::Unretained(this))));
« no previous file with comments | « no previous file | chrome/browser/android/popular_sites.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698