Chromium Code Reviews| Index: components/ntp_snippets/remote/remote_suggestion.h |
| diff --git a/components/ntp_snippets/remote/remote_suggestion.h b/components/ntp_snippets/remote/remote_suggestion.h |
| index c08e7ecfd2678bc53ac3edb7eaf346471b2c3586..3e7bf7e45e851305ae74e74e7dcb490d6aa5ff42 100644 |
| --- a/components/ntp_snippets/remote/remote_suggestion.h |
| +++ b/components/ntp_snippets/remote/remote_suggestion.h |
| @@ -38,14 +38,16 @@ class RemoteSuggestion { |
| // suggestion. The keys in the dictionary are expected to be the same as the |
| // property name, with exceptions documented in the property comment. |
| static std::unique_ptr<RemoteSuggestion> CreateFromChromeReaderDictionary( |
| - const base::DictionaryValue& dict); |
| + const base::DictionaryValue& dict, |
| + const base::Time& fetch_date); |
| // Creates a RemoteSuggestion from a dictionary, as returned by Chrome Content |
| // Suggestions. Returns a null pointer if the dictionary doesn't correspond to |
| // a valid suggestion. Maps field names to Chrome Reader field names. |
| static std::unique_ptr<RemoteSuggestion> |
| CreateFromContentSuggestionsDictionary(const base::DictionaryValue& dict, |
| - int remote_category_id); |
| + int remote_category_id, |
| + const base::Time& fetch_date); |
| // Creates an RemoteSuggestion from a protocol buffer. Returns a null pointer |
| // if the protocol buffer doesn't correspond to a valid suggestion. |
| @@ -120,6 +122,8 @@ class RemoteSuggestion { |
| // CategoryFactory::FromRemoteCategory. |
| int remote_category_id() const { return remote_category_id_; } |
| + base::Time fetch_date() const { return fetch_date_; } |
| + |
| // Public for testing. |
| static base::Time TimeFromJsonString(const std::string& timestamp_str); |
| static std::string TimeToJsonString(const base::Time& time); |
| @@ -152,6 +156,9 @@ class RemoteSuggestion { |
| bool should_notify_; |
| base::Time notification_deadline_; |
| + // The time when the remote suggestions was fetched from the server. |
|
Marc Treib
2017/02/13 10:24:49
nit: s/suggestions/suggestion/
markusheintz_
2017/02/13 11:19:15
Done.
|
| + base::Time fetch_date_; |
| + |
| DISALLOW_COPY_AND_ASSIGN(RemoteSuggestion); |
| }; |