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

Unified Diff: components/ntp_snippets/ntp_snippets_service.h

Issue 1910633005: Display status message for "Add snippets" on chrome://snippets-internals (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: The final version ;) Created 4 years, 8 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_fetcher.cc ('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 c7a32443301e976c088ec1dc7dbb7945e3267879..e6dac62e61826dc9de340ba5c210ec2cd1d83343 100644
--- a/components/ntp_snippets/ntp_snippets_service.h
+++ b/components/ntp_snippets/ntp_snippets_service.h
@@ -79,6 +79,11 @@ class NTPSnippetsService : public KeyedService {
// suggestions from the suggestion service) and adds them to the current ones.
void FetchSnippetsFromHosts(const std::set<std::string>& hosts);
+ // Returns the last status message from the snippets fetcher.
+ const std::string& last_status() const {
+ return last_fetch_status_;
+ }
+
// (Re)schedules the periodic fetching of snippets. This is necessary because
// the schedule depends on the time of day
void RescheduleFetching();
@@ -123,7 +128,8 @@ class NTPSnippetsService : public KeyedService {
friend class NTPSnippetsServiceTest;
void OnSuggestionsChanged(const suggestions::SuggestionsProfile& suggestions);
- void OnSnippetsDownloaded(const std::string& snippets_json);
+ void OnSnippetsDownloaded(const std::string& snippets_json,
+ const std::string& status);
void OnJsonParsed(const std::string& snippets_json,
scoped_ptr<base::Value> parsed);
@@ -148,7 +154,7 @@ class NTPSnippetsService : public KeyedService {
std::set<std::string> GetSnippetHostsFromPrefs() const;
void StoreSnippetHostsToPrefs(const std::set<std::string>& hosts);
- void RemoveExpiredSnippets();
+ void LoadingSnippetsFinished();
bool enabled_;
@@ -189,6 +195,8 @@ class NTPSnippetsService : public KeyedService {
scoped_ptr<NTPSnippetsFetcher::SnippetsAvailableCallbackList::Subscription>
snippets_fetcher_subscription_;
+ std::string last_fetch_status_;
+
// Timer that calls us back when the next snippet expires.
base::OneShotTimer expiry_timer_;
« no previous file with comments | « components/ntp_snippets/ntp_snippets_fetcher.cc ('k') | components/ntp_snippets/ntp_snippets_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698