| 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/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 value.SetBoolean("topSites", | 103 value.SetBoolean("topSites", |
| 104 client_->DoesSourceExist(NTPTileSource::TOP_SITES)); | 104 client_->DoesSourceExist(NTPTileSource::TOP_SITES)); |
| 105 value.SetBoolean( | 105 value.SetBoolean( |
| 106 "suggestionsService", | 106 "suggestionsService", |
| 107 client_->DoesSourceExist(NTPTileSource::SUGGESTIONS_SERVICE)); | 107 client_->DoesSourceExist(NTPTileSource::SUGGESTIONS_SERVICE)); |
| 108 value.SetBoolean("whitelist", | 108 value.SetBoolean("whitelist", |
| 109 client_->DoesSourceExist(NTPTileSource::WHITELIST)); | 109 client_->DoesSourceExist(NTPTileSource::WHITELIST)); |
| 110 | 110 |
| 111 if (client_->DoesSourceExist(NTPTileSource::POPULAR)) { | 111 if (client_->DoesSourceExist(NTPTileSource::POPULAR)) { |
| 112 auto popular_sites = client_->MakePopularSites(); | 112 auto popular_sites = client_->MakePopularSites(); |
| 113 value.SetString("popular.url", popular_sites->GetURLToUse().spec()); | 113 value.SetString("popular.url", popular_sites->GetURLToFetch().spec()); |
| 114 value.SetString("popular.country", popular_sites->GetCountryToUse()); | 114 value.SetString("popular.country", popular_sites->GetCountryToFetch()); |
| 115 value.SetString("popular.version", popular_sites->GetVersionToUse()); | 115 value.SetString("popular.version", popular_sites->GetVersionToFetch()); |
| 116 | 116 |
| 117 value.SetString( | 117 value.SetString( |
| 118 "popular.overrideURL", | 118 "popular.overrideURL", |
| 119 prefs->GetString(ntp_tiles::prefs::kPopularSitesOverrideURL)); | 119 prefs->GetString(ntp_tiles::prefs::kPopularSitesOverrideURL)); |
| 120 value.SetString( | 120 value.SetString( |
| 121 "popular.overrideCountry", | 121 "popular.overrideCountry", |
| 122 prefs->GetString(ntp_tiles::prefs::kPopularSitesOverrideCountry)); | 122 prefs->GetString(ntp_tiles::prefs::kPopularSitesOverrideCountry)); |
| 123 value.SetString( | 123 value.SetString( |
| 124 "popular.overrideVersion", | 124 "popular.overrideVersion", |
| 125 prefs->GetString(ntp_tiles::prefs::kPopularSitesOverrideVersion)); | 125 prefs->GetString(ntp_tiles::prefs::kPopularSitesOverrideVersion)); |
| (...skipping 25 matching lines...) Expand all Loading... |
| 151 | 151 |
| 152 void NTPTilesInternalsMessageHandler::OnMostVisitedURLsAvailable( | 152 void NTPTilesInternalsMessageHandler::OnMostVisitedURLsAvailable( |
| 153 const NTPTilesVector& tiles) { | 153 const NTPTilesVector& tiles) { |
| 154 SendTiles(tiles); | 154 SendTiles(tiles); |
| 155 } | 155 } |
| 156 | 156 |
| 157 void NTPTilesInternalsMessageHandler::OnIconMadeAvailable( | 157 void NTPTilesInternalsMessageHandler::OnIconMadeAvailable( |
| 158 const GURL& site_url) {} | 158 const GURL& site_url) {} |
| 159 | 159 |
| 160 } // namespace ntp_tiles | 160 } // namespace ntp_tiles |
| OLD | NEW |