| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef COMPONENTS_NTP_SNIPPETS_CONTENT_SUGGESTION_H_ | 5 #ifndef COMPONENTS_NTP_SNIPPETS_CONTENT_SUGGESTION_H_ |
| 6 #define COMPONENTS_NTP_SNIPPETS_CONTENT_SUGGESTION_H_ | 6 #define COMPONENTS_NTP_SNIPPETS_CONTENT_SUGGESTION_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 // Extra information for notifications. When absent, no notification should be | 144 // Extra information for notifications. When absent, no notification should be |
| 145 // sent for this suggestion. When present, a notification should be sent, | 145 // sent for this suggestion. When present, a notification should be sent, |
| 146 // unless other factors disallow it (examples: the extra parameters say to; | 146 // unless other factors disallow it (examples: the extra parameters say to; |
| 147 // notifications are disabled; Chrome is in the foreground). | 147 // notifications are disabled; Chrome is in the foreground). |
| 148 NotificationExtra* notification_extra() const { | 148 NotificationExtra* notification_extra() const { |
| 149 return notification_extra_.get(); | 149 return notification_extra_.get(); |
| 150 } | 150 } |
| 151 void set_notification_extra( | 151 void set_notification_extra( |
| 152 std::unique_ptr<NotificationExtra> notification_extra); | 152 std::unique_ptr<NotificationExtra> notification_extra); |
| 153 | 153 |
| 154 const base::Time& fetch_date() const { return fetch_date_; } |
| 155 void set_fetch_date(const base::Time& fetch_date) { |
| 156 fetch_date_ = fetch_date; |
| 157 } |
| 158 |
| 154 private: | 159 private: |
| 155 ID id_; | 160 ID id_; |
| 156 GURL url_; | 161 GURL url_; |
| 157 base::string16 title_; | 162 base::string16 title_; |
| 158 base::string16 snippet_text_; | 163 base::string16 snippet_text_; |
| 159 base::Time publish_date_; | 164 base::Time publish_date_; |
| 160 base::string16 publisher_name_; | 165 base::string16 publisher_name_; |
| 161 float score_; | 166 float score_; |
| 162 std::unique_ptr<DownloadSuggestionExtra> download_suggestion_extra_; | 167 std::unique_ptr<DownloadSuggestionExtra> download_suggestion_extra_; |
| 163 std::unique_ptr<RecentTabSuggestionExtra> recent_tab_suggestion_extra_; | 168 std::unique_ptr<RecentTabSuggestionExtra> recent_tab_suggestion_extra_; |
| 164 std::unique_ptr<NotificationExtra> notification_extra_; | 169 std::unique_ptr<NotificationExtra> notification_extra_; |
| 165 | 170 |
| 171 // The time when the remote suggestion was fetched from the server. This field |
| 172 // is only populated when the ContentSuggestion is created from a |
| 173 // RemoteSuggestion. |
| 174 base::Time fetch_date_; |
| 175 |
| 166 DISALLOW_COPY_AND_ASSIGN(ContentSuggestion); | 176 DISALLOW_COPY_AND_ASSIGN(ContentSuggestion); |
| 167 }; | 177 }; |
| 168 | 178 |
| 169 std::ostream& operator<<(std::ostream& os, const ContentSuggestion::ID& id); | 179 std::ostream& operator<<(std::ostream& os, const ContentSuggestion::ID& id); |
| 170 | 180 |
| 171 } // namespace ntp_snippets | 181 } // namespace ntp_snippets |
| 172 | 182 |
| 173 #endif // COMPONENTS_NTP_SNIPPETS_CONTENT_SUGGESTION_H_ | 183 #endif // COMPONENTS_NTP_SNIPPETS_CONTENT_SUGGESTION_H_ |
| OLD | NEW |