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

Unified Diff: chrome/browser/profiles/profile_manager.cc

Issue 1699143002: [NTP Snippets] Schedule periodic fetching (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@snippets_feature
Patch Set: Created 4 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/profiles/profile_manager.cc
diff --git a/chrome/browser/profiles/profile_manager.cc b/chrome/browser/profiles/profile_manager.cc
index 55b1d61e59aa81952f5b121678dddac6760375dd..d6d1ee5fdc8e5db6c3c8ee1c15e5941a720a5409 100644
--- a/chrome/browser/profiles/profile_manager.cc
+++ b/chrome/browser/profiles/profile_manager.cc
@@ -12,6 +12,7 @@
#include "base/bind.h"
#include "base/command_line.h"
#include "base/deferred_sequenced_task_runner.h"
+#include "base/feature_list.h"
#include "base/files/file_enumerator.h"
#include "base/files/file_path.h"
#include "base/files/file_util.h"
@@ -124,6 +125,12 @@
#include "components/user_manager/user_manager.h"
#endif
+#if defined(OS_ANDROID)
Bernhard Bauer 2016/02/16 16:19:08 Move this before the OS_IOS section, so the sectio
Marc Treib 2016/02/16 16:54:27 Sure, done. Also moved WIN behind CHROMEOS so it's
+#include "chrome/browser/android/chrome_feature_list.h"
+#include "chrome/browser/ntp_snippets/ntp_snippets_service_factory.h"
+#include "components/ntp_snippets/ntp_snippets_service.h"
+#endif
+
using base::UserMetricsAction;
using content::BrowserThread;
@@ -1154,6 +1161,14 @@ void ProfileManager::DoFinalInitForServices(Profile* profile,
// migration code, rough time estimates are Q1 2016.
PasswordManagerSettingMigratorServiceFactory::GetForProfile(profile)
->InitializeMigration(ProfileSyncServiceFactory::GetForProfile(profile));
+
+#if defined(OS_ANDROID)
+ // Service is responsible for fetching content snippets for the NTP.
+ // Note: Create the service even if the feature is disabled, so that any
+ // remaining tasks will be cleaned up.
+ NTPSnippetsServiceFactory::GetForProfile(profile)->Init(
+ base::FeatureList::IsEnabled(chrome::android::kNTPSnippetsFeature));
+#endif
}
void ProfileManager::DoFinalInitLogging(Profile* profile) {

Powered by Google App Engine
This is Rietveld 408576698