| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/ntp_tiles/webui/ntp_tiles_internals_message_handler.h" | 5 #include "components/ntp_tiles/webui/ntp_tiles_internals_message_handler.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "base/files/file_util.h" | 9 #include "base/files/file_util.h" |
| 10 #include "base/json/json_reader.h" | 10 #include "base/json/json_reader.h" |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 NTPTileSource::WHITELIST)); | 170 NTPTileSource::WHITELIST)); |
| 171 | 171 |
| 172 if (most_visited_sites_->DoesSourceExist( | 172 if (most_visited_sites_->DoesSourceExist( |
| 173 NTPTileSource::SUGGESTIONS_SERVICE)) { | 173 NTPTileSource::SUGGESTIONS_SERVICE)) { |
| 174 value.SetString("suggestionsService.status", suggestions_status_); | 174 value.SetString("suggestionsService.status", suggestions_status_); |
| 175 } else { | 175 } else { |
| 176 value.SetBoolean("suggestionsService", false); | 176 value.SetBoolean("suggestionsService", false); |
| 177 } | 177 } |
| 178 | 178 |
| 179 if (most_visited_sites_->DoesSourceExist(NTPTileSource::POPULAR)) { | 179 if (most_visited_sites_->DoesSourceExist(NTPTileSource::POPULAR)) { |
| 180 auto popular_sites = most_visited_sites_->popular_sites(); | 180 auto* popular_sites = most_visited_sites_->popular_sites(); |
| 181 value.SetString("popular.url", popular_sites->GetURLToFetch().spec()); | 181 value.SetString("popular.url", popular_sites->GetURLToFetch().spec()); |
| 182 value.SetString("popular.country", popular_sites->GetCountryToFetch()); | 182 value.SetString("popular.country", popular_sites->GetCountryToFetch()); |
| 183 value.SetString("popular.version", popular_sites->GetVersionToFetch()); | 183 value.SetString("popular.version", popular_sites->GetVersionToFetch()); |
| 184 | 184 |
| 185 value.SetString( | 185 value.SetString( |
| 186 "popular.overrideURL", | 186 "popular.overrideURL", |
| 187 prefs->GetString(ntp_tiles::prefs::kPopularSitesOverrideURL)); | 187 prefs->GetString(ntp_tiles::prefs::kPopularSitesOverrideURL)); |
| 188 value.SetString( | 188 value.SetString( |
| 189 "popular.overrideCountry", | 189 "popular.overrideCountry", |
| 190 prefs->GetString(ntp_tiles::prefs::kPopularSitesOverrideCountry)); | 190 prefs->GetString(ntp_tiles::prefs::kPopularSitesOverrideCountry)); |
| (...skipping 30 matching lines...) Expand all Loading... |
| 221 | 221 |
| 222 void NTPTilesInternalsMessageHandler::OnMostVisitedURLsAvailable( | 222 void NTPTilesInternalsMessageHandler::OnMostVisitedURLsAvailable( |
| 223 const NTPTilesVector& tiles) { | 223 const NTPTilesVector& tiles) { |
| 224 SendTiles(tiles); | 224 SendTiles(tiles); |
| 225 } | 225 } |
| 226 | 226 |
| 227 void NTPTilesInternalsMessageHandler::OnIconMadeAvailable( | 227 void NTPTilesInternalsMessageHandler::OnIconMadeAvailable( |
| 228 const GURL& site_url) {} | 228 const GURL& site_url) {} |
| 229 | 229 |
| 230 } // namespace ntp_tiles | 230 } // namespace ntp_tiles |
| OLD | NEW |