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

Side by Side Diff: components/ntp_snippets/ntp_snippet.h

Issue 1922083004: Allow fetching personalized snippets from ChromeReader. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase-update and minor polish Created 4 years, 7 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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_NTP_SNIPPET_H_ 5 #ifndef COMPONENTS_NTP_SNIPPETS_NTP_SNIPPET_H_
6 #define COMPONENTS_NTP_SNIPPETS_NTP_SNIPPET_H_ 6 #define COMPONENTS_NTP_SNIPPETS_NTP_SNIPPET_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <string> 9 #include <string>
10 10
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 // After this expiration date this snippet should no longer be presented to 75 // After this expiration date this snippet should no longer be presented to
76 // the user. 76 // the user.
77 const base::Time& expiry_date() const { return expiry_date_; } 77 const base::Time& expiry_date() const { return expiry_date_; }
78 void set_expiry_date(const base::Time& expiry_date) { 78 void set_expiry_date(const base::Time& expiry_date) {
79 expiry_date_ = expiry_date; 79 expiry_date_ = expiry_date;
80 } 80 }
81 81
82 const GURL& amp_url() const { return amp_url_; } 82 const GURL& amp_url() const { return amp_url_; }
83 void set_amp_url(const GURL& amp_url) { amp_url_ = amp_url; } 83 void set_amp_url(const GURL& amp_url) { amp_url_ = amp_url; }
84 84
85 double score() const { return score_; }
86 void set_score(double score) { score_ = score; }
87
85 // Public for testing. 88 // Public for testing.
86 static base::Time TimeFromJsonString(const std::string& timestamp_str); 89 static base::Time TimeFromJsonString(const std::string& timestamp_str);
87 static std::string TimeToJsonString(const base::Time& time); 90 static std::string TimeToJsonString(const base::Time& time);
88 91
89 private: 92 private:
90 const GURL url_; 93 const GURL url_;
91 std::string site_title_; 94 std::string site_title_;
92 std::string title_; 95 std::string title_;
93 GURL favicon_url_; 96 GURL favicon_url_;
94 GURL salient_image_url_; 97 GURL salient_image_url_;
95 std::string snippet_; 98 std::string snippet_;
96 base::Time publish_date_; 99 base::Time publish_date_;
97 base::Time expiry_date_; 100 base::Time expiry_date_;
98 GURL amp_url_; 101 GURL amp_url_;
102 double score_;
Marc Treib 2016/05/04 11:50:09 I think float is good enough here :)
jkrcal 2016/05/04 14:04:07 Done.
99 103
100 DISALLOW_COPY_AND_ASSIGN(NTPSnippet); 104 DISALLOW_COPY_AND_ASSIGN(NTPSnippet);
101 }; 105 };
102 106
103 } // namespace ntp_snippets 107 } // namespace ntp_snippets
104 108
105 #endif // COMPONENTS_NTP_SNIPPETS_NTP_SNIPPET_H_ 109 #endif // COMPONENTS_NTP_SNIPPETS_NTP_SNIPPET_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698