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

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

Issue 1878993002: [NTP Snippets] Clean up NTPSnippetsServiceTests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 publish_date_ = publish_date; 72 publish_date_ = publish_date;
73 } 73 }
74 74
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 // Public for testing.
83 static base::Time TimeFromJsonString(const std::string& timestamp_str);
84 static std::string TimeToJsonString(const base::Time& time);
85
82 private: 86 private:
83 const GURL url_; 87 const GURL url_;
84 std::string site_title_; 88 std::string site_title_;
85 std::string title_; 89 std::string title_;
86 GURL favicon_url_; 90 GURL favicon_url_;
87 GURL salient_image_url_; 91 GURL salient_image_url_;
88 std::string snippet_; 92 std::string snippet_;
89 base::Time publish_date_; 93 base::Time publish_date_;
90 base::Time expiry_date_; 94 base::Time expiry_date_;
91 95
92 DISALLOW_COPY_AND_ASSIGN(NTPSnippet); 96 DISALLOW_COPY_AND_ASSIGN(NTPSnippet);
93 }; 97 };
94 98
95 } // namespace ntp_snippets 99 } // namespace ntp_snippets
96 100
97 #endif // COMPONENTS_NTP_SNIPPETS_NTP_SNIPPET_H_ 101 #endif // COMPONENTS_NTP_SNIPPETS_NTP_SNIPPET_H_
OLDNEW
« no previous file with comments | « no previous file | components/ntp_snippets/ntp_snippet.cc » ('j') | components/ntp_snippets/ntp_snippets_service_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698