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

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

Issue 2167063003: Rename discard to dismiss for NTP snippets and content suggestions (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@bridgeumbiegen
Patch Set: Fix unit test Created 4 years, 5 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 #include <vector> 10 #include <vector>
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 bool is_complete() const { 115 bool is_complete() const {
116 return !id().empty() && !sources().empty() && !title().empty() && 116 return !id().empty() && !sources().empty() && !title().empty() &&
117 !snippet().empty() && salient_image_url().is_valid() && 117 !snippet().empty() && salient_image_url().is_valid() &&
118 !publish_date().is_null() && !expiry_date().is_null() && 118 !publish_date().is_null() && !expiry_date().is_null() &&
119 !best_source().publisher_name.empty(); 119 !best_source().publisher_name.empty();
120 } 120 }
121 121
122 float score() const { return score_; } 122 float score() const { return score_; }
123 void set_score(float score) { score_ = score; } 123 void set_score(float score) { score_ = score; }
124 124
125 bool is_discarded() const { return is_discarded_; } 125 bool is_dismissed() const { return is_dismissed_; }
126 void set_discarded(bool discarded) { is_discarded_ = discarded; } 126 void set_dismissed(bool dismissed) { is_dismissed_ = dismissed; }
127 127
128 // Public for testing. 128 // Public for testing.
129 static base::Time TimeFromJsonString(const std::string& timestamp_str); 129 static base::Time TimeFromJsonString(const std::string& timestamp_str);
130 static std::string TimeToJsonString(const base::Time& time); 130 static std::string TimeToJsonString(const base::Time& time);
131 131
132 private: 132 private:
133 void FindBestSource(); 133 void FindBestSource();
134 134
135 std::string id_; 135 std::string id_;
136 std::string title_; 136 std::string title_;
137 GURL salient_image_url_; 137 GURL salient_image_url_;
138 std::string snippet_; 138 std::string snippet_;
139 base::Time publish_date_; 139 base::Time publish_date_;
140 base::Time expiry_date_; 140 base::Time expiry_date_;
141 float score_; 141 float score_;
142 bool is_discarded_; 142 bool is_dismissed_;
143 143
144 size_t best_source_index_; 144 size_t best_source_index_;
145 145
146 std::vector<SnippetSource> sources_; 146 std::vector<SnippetSource> sources_;
147 147
148 DISALLOW_COPY_AND_ASSIGN(NTPSnippet); 148 DISALLOW_COPY_AND_ASSIGN(NTPSnippet);
149 }; 149 };
150 150
151 } // namespace ntp_snippets 151 } // namespace ntp_snippets
152 152
153 #endif // COMPONENTS_NTP_SNIPPETS_NTP_SNIPPET_H_ 153 #endif // COMPONENTS_NTP_SNIPPETS_NTP_SNIPPET_H_
OLDNEW
« no previous file with comments | « components/ntp_snippets/content_suggestions_service_unittest.cc ('k') | components/ntp_snippets/ntp_snippet.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698