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

Unified Diff: components/ntp_tiles/most_visited_sites.cc

Issue 2579813002: ntp_tiles: Add tests covering tile-fetching logic (Closed)
Patch Set: 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 35bfd4472236aa1aba96a84fc47eae3af3d16546..615cc9ab1d6832e49fceca612179a9c604b3a825 100644
--- a/components/ntp_tiles/most_visited_sites.cc
+++ b/components/ntp_tiles/most_visited_sites.cc
@@ -18,7 +18,7 @@
#include "components/ntp_tiles/icon_cacher.h"
#include "components/ntp_tiles/pref_names.h"
#include "components/ntp_tiles/switches.h"
-#include "components/pref_registry/pref_registry_syncable.h"
+#include "components/prefs/pref_registry_simple.h"
Marc Treib 2016/12/19 09:11:50 Nice! Once we do the same for PopularSites, we can
mastiz 2017/01/09 10:40:58 sfiera@ raised some concerns so I reverted this ch
#include "components/prefs/pref_service.h"
using history::TopSites;
@@ -153,8 +153,7 @@ void MostVisitedSites::OnBlockedSitesChanged() {
}
// static
-void MostVisitedSites::RegisterProfilePrefs(
- user_prefs::PrefRegistrySyncable* registry) {
+void MostVisitedSites::RegisterProfilePrefs(PrefRegistrySimple* registry) {
registry->RegisterIntegerPref(prefs::kNumPersonalTiles, 0);
}
@@ -187,6 +186,8 @@ base::FilePath MostVisitedSites::GetWhitelistLargeIconPath(const GURL& url) {
void MostVisitedSites::OnMostVisitedURLsAvailable(
const history::MostVisitedURLList& visited_list) {
+ // TODO(mastiz): Verify if suggestion service results have been fetched in
+ // the meantime, and if that's the case ignore this event.
NTPTilesVector tiles;
size_t num_tiles =
std::min(visited_list.size(), static_cast<size_t>(num_sites_));

Powered by Google App Engine
This is Rietveld 408576698