Chromium Code Reviews| 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_time() const { return fetch_time_; } | |
| 155 void set_fetch_time(const base::Time& fetch_time) { | |
| 156 fetch_time_ = fetch_time; | |
| 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 filed | |
|
Marc Treib
2017/02/10 16:16:56
s/filed/field/
markusheintz_
2017/02/13 09:59:55
Done.
| |
| 172 // is only populated when the ContentSuggestion is created from a | |
| 173 // RemoteSuggestion. | |
| 174 base::Time fetch_time_; | |
|
Marc Treib
2017/02/10 16:16:56
fetch_date_, to be consistent with publish_date_,
markusheintz_
2017/02/13 09:59:55
Done.
| |
| 166 DISALLOW_COPY_AND_ASSIGN(ContentSuggestion); | 175 DISALLOW_COPY_AND_ASSIGN(ContentSuggestion); |
|
Marc Treib
2017/02/10 16:16:56
nit: empty line before
markusheintz_
2017/02/13 09:59:55
Done.
| |
| 167 }; | 176 }; |
| 168 | 177 |
| 169 std::ostream& operator<<(std::ostream& os, const ContentSuggestion::ID& id); | 178 std::ostream& operator<<(std::ostream& os, const ContentSuggestion::ID& id); |
| 170 | 179 |
| 171 } // namespace ntp_snippets | 180 } // namespace ntp_snippets |
| 172 | 181 |
| 173 #endif // COMPONENTS_NTP_SNIPPETS_CONTENT_SUGGESTION_H_ | 182 #endif // COMPONENTS_NTP_SNIPPETS_CONTENT_SUGGESTION_H_ |
| OLD | NEW |