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

Unified Diff: chrome/browser/ntp_snippets/ntp_snippets_service_factory.cc

Issue 1699143002: [NTP Snippets] Schedule periodic fetching (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@snippets_feature
Patch Set: fix bots 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
« no previous file with comments | « chrome/browser/android/ntp_snippets_launcher.cc ('k') | chrome/browser/profiles/profile_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ntp_snippets/ntp_snippets_service_factory.cc
diff --git a/chrome/browser/ntp_snippets/ntp_snippets_service_factory.cc b/chrome/browser/ntp_snippets/ntp_snippets_service_factory.cc
index 0cf2dba8407534e2f217119029c88d510fbd9b5f..50a22944644c0b4cb14dc6ab897d645a8cb8db22 100644
--- a/chrome/browser/ntp_snippets/ntp_snippets_service_factory.cc
+++ b/chrome/browser/ntp_snippets/ntp_snippets_service_factory.cc
@@ -12,6 +12,7 @@
#include "chrome/browser/signin/signin_manager_factory.h"
#include "components/keyed_service/content/browser_context_dependency_manager.h"
#include "components/ntp_snippets/ntp_snippets_fetcher.h"
+#include "components/ntp_snippets/ntp_snippets_scheduler.h"
#include "components/ntp_snippets/ntp_snippets_service.h"
#include "components/signin/core/browser/profile_oauth2_token_service.h"
#include "components/signin/core/browser/signin_manager.h"
@@ -19,6 +20,10 @@
#include "content/public/browser/browser_thread.h"
#include "net/url_request/url_request_context_getter.h"
+#if defined(OS_ANDROID)
+#include "chrome/browser/android/ntp_snippets_launcher.h"
+#endif // OS_ANDROID
+
using content::BrowserThread;
// static
@@ -51,6 +56,11 @@ KeyedService* NTPSnippetsServiceFactory::BuildServiceInstanceFor(
scoped_refptr<net::URLRequestContextGetter> request_context =
context->GetRequestContext();
+ ntp_snippets::NTPSnippetsScheduler* scheduler = nullptr;
+#if defined(OS_ANDROID)
+ scheduler = NTPSnippetsLauncher::Get();
+#endif // OS_ANDROID
+
scoped_refptr<base::SequencedTaskRunner> task_runner =
BrowserThread::GetBlockingPool()
->GetSequencedTaskRunnerWithShutdownBehavior(
@@ -58,7 +68,7 @@ KeyedService* NTPSnippetsServiceFactory::BuildServiceInstanceFor(
base::SequencedWorkerPool::CONTINUE_ON_SHUTDOWN);
return new ntp_snippets::NTPSnippetsService(
- task_runner, g_browser_process->GetApplicationLocale(),
+ task_runner, g_browser_process->GetApplicationLocale(), scheduler,
make_scoped_ptr(new ntp_snippets::NTPSnippetsFetcher(
task_runner, signin_manager, token_service, request_context,
profile->GetPath())));
« no previous file with comments | « chrome/browser/android/ntp_snippets_launcher.cc ('k') | chrome/browser/profiles/profile_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698