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

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

Issue 2744253004: NTP: clang-format (Closed)
Patch Set: rebase 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 unified diff | Download patch
« no previous file with comments | « components/ntp_tiles/switches.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/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 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 } 152 }
153 153
154 void NTPTilesInternalsMessageHandler::HandleViewPopularSitesJson( 154 void NTPTilesInternalsMessageHandler::HandleViewPopularSitesJson(
155 const base::ListValue* args) { 155 const base::ListValue* args) {
156 DCHECK_EQ(0u, args->GetSize()); 156 DCHECK_EQ(0u, args->GetSize());
157 if (!most_visited_sites_->DoesSourceExist( 157 if (!most_visited_sites_->DoesSourceExist(
158 ntp_tiles::NTPTileSource::POPULAR)) { 158 ntp_tiles::NTPTileSource::POPULAR)) {
159 return; 159 return;
160 } 160 }
161 161
162 popular_sites_json_ = FormatJson( 162 popular_sites_json_ =
163 *most_visited_sites_->popular_sites()->GetCachedJson()); 163 FormatJson(*most_visited_sites_->popular_sites()->GetCachedJson());
164 SendSourceInfo(); 164 SendSourceInfo();
165 } 165 }
166 166
167 void NTPTilesInternalsMessageHandler::SendSourceInfo() { 167 void NTPTilesInternalsMessageHandler::SendSourceInfo() {
168 PrefService* prefs = client_->GetPrefs(); 168 PrefService* prefs = client_->GetPrefs();
169 base::DictionaryValue value; 169 base::DictionaryValue value;
170 170
171 value.SetBoolean("topSites", most_visited_sites_->DoesSourceExist( 171 value.SetBoolean("topSites", most_visited_sites_->DoesSourceExist(
172 NTPTileSource::TOP_SITES)); 172 NTPTileSource::TOP_SITES));
173 value.SetBoolean("whitelist", most_visited_sites_->DoesSourceExist( 173 value.SetBoolean("whitelist", most_visited_sites_->DoesSourceExist(
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
225 225
226 void NTPTilesInternalsMessageHandler::OnMostVisitedURLsAvailable( 226 void NTPTilesInternalsMessageHandler::OnMostVisitedURLsAvailable(
227 const NTPTilesVector& tiles) { 227 const NTPTilesVector& tiles) {
228 SendTiles(tiles); 228 SendTiles(tiles);
229 } 229 }
230 230
231 void NTPTilesInternalsMessageHandler::OnIconMadeAvailable( 231 void NTPTilesInternalsMessageHandler::OnIconMadeAvailable(
232 const GURL& site_url) {} 232 const GURL& site_url) {}
233 233
234 } // namespace ntp_tiles 234 } // namespace ntp_tiles
OLDNEW
« no previous file with comments | « components/ntp_tiles/switches.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698