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

Unified Diff: components/ntp_tiles/most_visited_sites.cc

Issue 2572133002: Add more features to ntp-tiles-internal (Closed)
Patch Set: address comments 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 side-by-side diff with in-line comments
Download patch
Index: components/ntp_tiles/most_visited_sites.cc
diff --git a/components/ntp_tiles/most_visited_sites.cc b/components/ntp_tiles/most_visited_sites.cc
index 0e73f9f9786f6e69610aebc86200862512afc5ed..f70fa2e5f32136ba77c5d427aae5365cfcbe63a4 100644
--- a/components/ntp_tiles/most_visited_sites.cc
+++ b/components/ntp_tiles/most_visited_sites.cc
@@ -77,6 +77,21 @@ MostVisitedSites::~MostVisitedSites() {
supervisor_->SetObserver(nullptr);
}
+bool MostVisitedSites::DoesSourceExist(NTPTileSource source) const {
+ switch (source) {
+ case NTPTileSource::TOP_SITES:
+ return top_sites_ != nullptr;
+ case NTPTileSource::SUGGESTIONS_SERVICE:
+ return suggestions_service_ != nullptr;
+ case NTPTileSource::POPULAR:
+ return popular_sites_ != nullptr;
+ case NTPTileSource::WHITELIST:
+ return supervisor_ != nullptr;
+ }
+ NOTREACHED();
+ return false;
+}
+
void MostVisitedSites::SetMostVisitedURLsObserver(Observer* observer,
int num_sites) {
DCHECK(observer);

Powered by Google App Engine
This is Rietveld 408576698