Chromium Code Reviews| 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 4269f9413cfb2624f079f8407508ef81b3108df7..72f516692fc6d7f23dd51cf2dff030825482cf73 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 get_last_status() const { |
|
Marc Treib
2016/04/21 13:47:21
Just "last_status", no "get".
Also, return a refer
jkrcal
2016/04/22 09:30:28
Done.
|
| + return snippets_fetcher_last_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); |
| @@ -150,7 +156,7 @@ class NTPSnippetsService : public KeyedService { |
| bool HasDiscardedSnippet(const GURL& url) const; |
| - void RemoveExpiredSnippets(); |
| + void LoadingSnippetsFinished(); |
| bool enabled_; |
| @@ -191,6 +197,8 @@ class NTPSnippetsService : public KeyedService { |
| scoped_ptr<NTPSnippetsFetcher::SnippetsAvailableCallbackList::Subscription> |
| snippets_fetcher_subscription_; |
| + std::string snippets_fetcher_last_status_; |
|
Marc Treib
2016/04/21 13:47:21
IMO this name is a bit misleading, ad it doesn't a
jkrcal
2016/04/22 09:30:28
Done.
|
| + |
| // Timer that calls us back when the next snippet expires. |
| base::OneShotTimer expiry_timer_; |