Index: chrome/browser/profiles/profile_manager.cc |
diff --git a/chrome/browser/profiles/profile_manager.cc b/chrome/browser/profiles/profile_manager.cc |
index 09c2b0f137c78f9c521cdc59f9352b75c78b0936..a8717a47bba03b6d8ada465f74229091fe8125ed 100644 |
--- a/chrome/browser/profiles/profile_manager.cc |
+++ b/chrome/browser/profiles/profile_manager.cc |
@@ -107,6 +107,7 @@ |
#endif |
#if defined(OS_ANDROID) |
+#include "chrome/browser/android/ntp/bookmark_suggestions_provider_factory.h" |
#include "chrome/browser/android/ntp/offline_page_suggestions_provider_factory.h" |
#include "chrome/browser/ntp_snippets/content_suggestions_service_factory.h" |
#include "chrome/browser/ntp_snippets/ntp_snippets_service_factory.h" |
@@ -1227,10 +1228,21 @@ void ProfileManager::DoFinalInitForServices(Profile* profile, |
->InitializeMigration(ProfileSyncServiceFactory::GetForProfile(profile)); |
#if defined(OS_ANDROID) |
- // Service is responsible for fetching content snippets for the NTP. |
+ // TODO(pke): Remove all these initializer lines. |
+ // Do not add any more suggestion provider initializers. This is not the place |
+ // where every single profile-keyed service should be initialized. By default, |
+ // profile-keyed services are lazily created when needed. If there is |
+ // something that needs to happen at startup (like scheduling the fetching |
+ // task), the factory can declare that it wants to be created with the |
+ // profile. If we want to only add some providers under certain conditions, we |
+ // can move the provider registration code e.g. to the |
+ // ContentSuggestionsFactory, which would have the advantage that it would |
+ // centralize it. Service is responsible for fetching content snippets for the |
+ // NTP. |
ContentSuggestionsServiceFactory::GetForProfile(profile); |
NTPSnippetsServiceFactory::GetForProfile(profile); |
OfflinePageSuggestionsProviderFactory::GetForProfile(profile); |
+ BookmarkSuggestionsProviderFactory::GetForProfile(profile); |
#endif |
} |