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

Unified Diff: components/ntp_tiles/webui/ntp_tiles_internals_message_handler.cc

Issue 2841643005: [Popular Sites] Add Variations parameter to override URL path (Closed)
Patch Set: Update ntp-tiles-internals. 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 side-by-side diff with in-line comments
Download patch
Index: components/ntp_tiles/webui/ntp_tiles_internals_message_handler.cc
diff --git a/components/ntp_tiles/webui/ntp_tiles_internals_message_handler.cc b/components/ntp_tiles/webui/ntp_tiles_internals_message_handler.cc
index 7cc0047715401e66563dd7bd90028bf13a549b3f..ea6ee51c7586c9cd7908b3590db9ebc14d34c681 100644
--- a/components/ntp_tiles/webui/ntp_tiles_internals_message_handler.cc
+++ b/components/ntp_tiles/webui/ntp_tiles_internals_message_handler.cc
@@ -110,6 +110,15 @@ void NTPTilesInternalsMessageHandler::HandleUpdate(
url_formatter::FixupURL(url, std::string()).spec());
}
+ std::string directory;
+ dict->GetString("popular.overrideDirectory", &directory);
+ if (directory.empty()) {
+ prefs->ClearPref(ntp_tiles::prefs::kPopularSitesOverrideDirectory);
+ } else {
+ prefs->SetString(ntp_tiles::prefs::kPopularSitesOverrideDirectory,
+ directory);
+ }
+
std::string country;
dict->GetString("popular.overrideCountry", &country);
if (country.empty()) {
@@ -181,6 +190,7 @@ void NTPTilesInternalsMessageHandler::SendSourceInfo() {
if (most_visited_sites_->DoesSourceExist(TileSource::POPULAR)) {
auto* popular_sites = most_visited_sites_->popular_sites();
value.SetString("popular.url", popular_sites->GetURLToFetch().spec());
+ value.SetString("popular.directory", popular_sites->GetDirectoryToFetch());
value.SetString("popular.country", popular_sites->GetCountryToFetch());
value.SetString("popular.version", popular_sites->GetVersionToFetch());
@@ -188,6 +198,9 @@ void NTPTilesInternalsMessageHandler::SendSourceInfo() {
"popular.overrideURL",
prefs->GetString(ntp_tiles::prefs::kPopularSitesOverrideURL));
value.SetString(
+ "popular.overrideDirectory",
+ prefs->GetString(ntp_tiles::prefs::kPopularSitesOverrideDirectory));
+ value.SetString(
"popular.overrideCountry",
prefs->GetString(ntp_tiles::prefs::kPopularSitesOverrideCountry));
value.SetString(
« no previous file with comments | « components/ntp_tiles/pref_names.cc ('k') | components/ntp_tiles/webui/popular_sites_internals_message_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698