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

Side by Side Diff: components/ntp_tiles/most_visited_sites.cc

Issue 2683583006: [NTPTiles::Cleanup] Fix unused variable. (Closed)
Patch Set: Created 3 years, 10 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 | « no previous file | 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/most_visited_sites.h" 5 #include "components/ntp_tiles/most_visited_sites.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <set> 8 #include <set>
9 #include <string> 9 #include <string>
10 #include <utility> 10 #include <utility>
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 // precedence. 185 // precedence.
186 if (mv_source_ == NTPTileSource::SUGGESTIONS_SERVICE) { 186 if (mv_source_ == NTPTileSource::SUGGESTIONS_SERVICE) {
187 return; 187 return;
188 } 188 }
189 189
190 NTPTilesVector tiles; 190 NTPTilesVector tiles;
191 size_t num_tiles = 191 size_t num_tiles =
192 std::min(visited_list.size(), static_cast<size_t>(num_sites_)); 192 std::min(visited_list.size(), static_cast<size_t>(num_sites_));
193 for (size_t i = 0; i < num_tiles; ++i) { 193 for (size_t i = 0; i < num_tiles; ++i) {
194 const history::MostVisitedURL& visited = visited_list[i]; 194 const history::MostVisitedURL& visited = visited_list[i];
195 if (visited.url.is_empty()) { 195 if (visited.url.is_empty())
196 num_tiles = i;
197 break; // This is the signal that there are no more real visited sites. 196 break; // This is the signal that there are no more real visited sites.
198 }
199 if (supervisor_ && supervisor_->IsBlocked(visited.url)) 197 if (supervisor_ && supervisor_->IsBlocked(visited.url))
200 continue; 198 continue;
201 199
202 NTPTile tile; 200 NTPTile tile;
203 tile.title = visited.title; 201 tile.title = visited.title;
204 tile.url = visited.url; 202 tile.url = visited.url;
205 tile.source = NTPTileSource::TOP_SITES; 203 tile.source = NTPTileSource::TOP_SITES;
206 tile.whitelist_icon_path = GetWhitelistLargeIconPath(visited.url); 204 tile.whitelist_icon_path = GetWhitelistLargeIconPath(visited.url);
207 205
208 tiles.push_back(std::move(tile)); 206 tiles.push_back(std::move(tile));
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after
419 417
420 void MostVisitedSites::TopSitesChanged(TopSites* top_sites, 418 void MostVisitedSites::TopSitesChanged(TopSites* top_sites,
421 ChangeReason change_reason) { 419 ChangeReason change_reason) {
422 if (mv_source_ == NTPTileSource::TOP_SITES) { 420 if (mv_source_ == NTPTileSource::TOP_SITES) {
423 // The displayed tiles are invalidated. 421 // The displayed tiles are invalidated.
424 InitiateTopSitesQuery(); 422 InitiateTopSitesQuery();
425 } 423 }
426 } 424 }
427 425
428 } // namespace ntp_tiles 426 } // namespace ntp_tiles
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698