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

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

Issue 2146753002: Android: Remove unneeded RegisterNatives() calls (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase, more fixes Created 4 years, 4 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
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 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 base::SequencedWorkerPool::CONTINUE_ON_SHUTDOWN)), 171 base::SequencedWorkerPool::CONTINUE_ON_SHUTDOWN)),
172 weak_ptr_factory_(this) { 172 weak_ptr_factory_(this) {
173 DCHECK(suggestions_service_); 173 DCHECK(suggestions_service_);
174 supervisor_->SetObserver(this); 174 supervisor_->SetObserver(this);
175 } 175 }
176 176
177 MostVisitedSites::~MostVisitedSites() { 177 MostVisitedSites::~MostVisitedSites() {
178 supervisor_->SetObserver(nullptr); 178 supervisor_->SetObserver(nullptr);
179 } 179 }
180 180
181 #if defined(OS_ANDROID)
182 // static
183 bool MostVisitedSites::Register(JNIEnv* env) {
184 return RegisterNativesImpl(env);
185 }
186 #endif
187
188 void MostVisitedSites::SetMostVisitedURLsObserver(Observer* observer, 181 void MostVisitedSites::SetMostVisitedURLsObserver(Observer* observer,
189 int num_sites) { 182 int num_sites) {
190 DCHECK(observer); 183 DCHECK(observer);
191 observer_ = observer; 184 observer_ = observer;
192 num_sites_ = num_sites; 185 num_sites_ = num_sites;
193 186
194 if (popular_sites_ && ShouldShowPopularSites() && 187 if (popular_sites_ && ShouldShowPopularSites() &&
195 NeedPopularSites(prefs_, num_sites_)) { 188 NeedPopularSites(prefs_, num_sites_)) {
196 popular_sites_->StartFetch( 189 popular_sites_->StartFetch(
197 false, base::Bind(&MostVisitedSites::OnPopularSitesAvailable, 190 false, base::Bind(&MostVisitedSites::OnPopularSitesAvailable,
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after
559 552
560 void MostVisitedSites::TopSitesChanged(TopSites* top_sites, 553 void MostVisitedSites::TopSitesChanged(TopSites* top_sites,
561 ChangeReason change_reason) { 554 ChangeReason change_reason) {
562 if (mv_source_ == TOP_SITES) { 555 if (mv_source_ == TOP_SITES) {
563 // The displayed suggestions are invalidated. 556 // The displayed suggestions are invalidated.
564 InitiateTopSitesQuery(); 557 InitiateTopSitesQuery();
565 } 558 }
566 } 559 }
567 560
568 } // namespace ntp_tiles 561 } // namespace ntp_tiles
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698