| Index: components/ntp_snippets/ntp_snippet.cc
|
| diff --git a/components/ntp_snippets/ntp_snippet.cc b/components/ntp_snippets/ntp_snippet.cc
|
| index d56528508a59eab0073c5c12937c836b0f4f33e8..125ec5199b2b1af20af0e86179699b262bc62455 100644
|
| --- a/components/ntp_snippets/ntp_snippet.cc
|
| +++ b/components/ntp_snippets/ntp_snippet.cc
|
| @@ -8,6 +8,9 @@
|
| #include "base/strings/string_number_conversions.h"
|
| #include "base/strings/stringprintf.h"
|
| #include "base/values.h"
|
| +#include "components/ntp_snippets/content_suggestion.h"
|
| +#include "components/ntp_snippets/content_suggestion_category.h"
|
| +#include "components/ntp_snippets/content_suggestions_provider_type.h"
|
| #include "components/ntp_snippets/proto/ntp_snippets.pb.h"
|
|
|
| namespace {
|
| @@ -250,6 +253,19 @@ SnippetProto NTPSnippet::ToProto() const {
|
| return result;
|
| }
|
|
|
| +std::unique_ptr<ContentSuggestion> NTPSnippet::ToContentSuggestion() const {
|
| + std::unique_ptr<ContentSuggestion> result(new ContentSuggestion(
|
| + id_, ContentSuggestionsProviderType::ARTICLES,
|
| + ContentSuggestionCategory::ARTICLE, best_source().url));
|
| + result->set_amp_url(best_source().amp_url);
|
| + result->set_title(title_);
|
| + result->set_snippet_text(snippet_);
|
| + result->set_publish_date(publish_date_);
|
| + result->set_publisher_name(best_source().publisher_name);
|
| + result->set_score(score_);
|
| + return result;
|
| +}
|
| +
|
| // static
|
| base::Time NTPSnippet::TimeFromJsonString(const std::string& timestamp_str) {
|
| int64_t timestamp;
|
|
|