summaryrefslogtreecommitdiff
path: root/chromium/components/ntp_tiles/webui/ntp_tiles_internals_message_handler.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/components/ntp_tiles/webui/ntp_tiles_internals_message_handler.cc')
-rw-r--r--chromium/components/ntp_tiles/webui/ntp_tiles_internals_message_handler.cc13
1 files changed, 13 insertions, 0 deletions
diff --git a/chromium/components/ntp_tiles/webui/ntp_tiles_internals_message_handler.cc b/chromium/components/ntp_tiles/webui/ntp_tiles_internals_message_handler.cc
index 7cc00477154..ea6ee51c758 100644
--- a/chromium/components/ntp_tiles/webui/ntp_tiles_internals_message_handler.cc
+++ b/chromium/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(