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

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

Issue 2337893003: Pass PopularSites ownership to MostVisitedSites. (Closed)
Patch Set: header Created 4 years, 3 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/most_visited_sites.h ('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 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 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 } 136 }
137 NOTREACHED(); 137 NOTREACHED();
138 return std::string(); 138 return std::string();
139 } 139 }
140 140
141 } // namespace 141 } // namespace
142 142
143 MostVisitedSites::MostVisitedSites(PrefService* prefs, 143 MostVisitedSites::MostVisitedSites(PrefService* prefs,
144 scoped_refptr<history::TopSites> top_sites, 144 scoped_refptr<history::TopSites> top_sites,
145 SuggestionsService* suggestions, 145 SuggestionsService* suggestions,
146 PopularSites* popular_sites, 146 std::unique_ptr<PopularSites> popular_sites,
147 MostVisitedSitesSupervisor* supervisor) 147 MostVisitedSitesSupervisor* supervisor)
148 : prefs_(prefs), 148 : prefs_(prefs),
149 top_sites_(top_sites), 149 top_sites_(top_sites),
150 suggestions_service_(suggestions), 150 suggestions_service_(suggestions),
151 popular_sites_(popular_sites), 151 popular_sites_(std::move(popular_sites)),
152 supervisor_(supervisor), 152 supervisor_(supervisor),
153 observer_(nullptr), 153 observer_(nullptr),
154 num_sites_(0), 154 num_sites_(0),
155 waiting_for_most_visited_sites_(true), 155 waiting_for_most_visited_sites_(true),
156 waiting_for_popular_sites_(true), 156 waiting_for_popular_sites_(true),
157 recorded_uma_(false), 157 recorded_uma_(false),
158 top_sites_observer_(this), 158 top_sites_observer_(this),
159 mv_source_(NTPTileSource::SUGGESTIONS_SERVICE), 159 mv_source_(NTPTileSource::SUGGESTIONS_SERVICE),
160 weak_ptr_factory_(this) { 160 weak_ptr_factory_(this) {
161 DCHECK(prefs_); 161 DCHECK(prefs_);
(...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after
544 544
545 void MostVisitedSites::TopSitesChanged(TopSites* top_sites, 545 void MostVisitedSites::TopSitesChanged(TopSites* top_sites,
546 ChangeReason change_reason) { 546 ChangeReason change_reason) {
547 if (mv_source_ == NTPTileSource::TOP_SITES) { 547 if (mv_source_ == NTPTileSource::TOP_SITES) {
548 // The displayed tiles are invalidated. 548 // The displayed tiles are invalidated.
549 InitiateTopSitesQuery(); 549 InitiateTopSitesQuery();
550 } 550 }
551 } 551 }
552 552
553 } // namespace ntp_tiles 553 } // namespace ntp_tiles
OLDNEW
« no previous file with comments | « components/ntp_tiles/most_visited_sites.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698