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

Unified Diff: components/ntp_snippets/ntp_snippets_service.h

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 | « components/ntp_snippets/ntp_snippets_scheduler.h ('k') | components/ntp_snippets/ntp_snippets_service.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/ntp_snippets/ntp_snippets_service.h
diff --git a/components/ntp_snippets/ntp_snippets_service.h b/components/ntp_snippets/ntp_snippets_service.h
index f9d2a40a4de10747d62d54575dc68f15fac27590..1b46bad976bd93300f8ddb6621e81300bd6acb82 100644
--- a/components/ntp_snippets/ntp_snippets_service.h
+++ b/components/ntp_snippets/ntp_snippets_service.h
@@ -18,6 +18,7 @@
#include "components/ntp_snippets/inner_iterator.h"
#include "components/ntp_snippets/ntp_snippet.h"
#include "components/ntp_snippets/ntp_snippets_fetcher.h"
+#include "components/ntp_snippets/ntp_snippets_scheduler.h"
namespace ntp_snippets {
@@ -36,9 +37,12 @@ class NTPSnippetsService : public KeyedService, NTPSnippetsFetcher::Observer {
// (British english person in the US) are not language code.
NTPSnippetsService(scoped_refptr<base::SequencedTaskRunner> file_task_runner,
const std::string& application_language_code,
+ NTPSnippetsScheduler* scheduler,
scoped_ptr<NTPSnippetsFetcher> snippets_fetcher);
~NTPSnippetsService() override;
+ void Init(bool enabled);
+
// Fetches snippets from the server. |overwrite| is true if existing snippets
// should be overwritten.
void FetchSnippets(bool overwrite);
@@ -99,6 +103,9 @@ class NTPSnippetsService : public KeyedService, NTPSnippetsFetcher::Observer {
// The observers.
base::ObserverList<NTPSnippetsServiceObserver> observers_;
+ // Scheduler for fetching snippets. Not owned.
+ NTPSnippetsScheduler* scheduler_;
+
// The snippets fetcher
scoped_ptr<NTPSnippetsFetcher> snippets_fetcher_;
« no previous file with comments | « components/ntp_snippets/ntp_snippets_scheduler.h ('k') | components/ntp_snippets/ntp_snippets_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698