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

Side by Side Diff: components/ntp_tiles/webui/ntp_tiles_internals_message_handler.cc

Issue 2570783003: [Popular Sites] Split PopularSites interface and PopularSitesImpl (Closed)
Patch Set: Rebased and minor naming change. Created 4 years 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 unified diff | Download patch
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « components/ntp_tiles/popular_sites_unittest.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