Chromium Code Reviews| Index: components/ntp_snippets/reading_list/reading_list_suggestions_provider.cc |
| diff --git a/components/ntp_snippets/reading_list/reading_list_suggestions_provider.cc b/components/ntp_snippets/reading_list/reading_list_suggestions_provider.cc |
| index ed11ed83fda216959320eacb6d952f6d8d206de4..09aa3c888d76ee8d9a222d37adb116e7f37a58df 100644 |
| --- a/components/ntp_snippets/reading_list/reading_list_suggestions_provider.cc |
| +++ b/components/ntp_snippets/reading_list/reading_list_suggestions_provider.cc |
| @@ -11,8 +11,8 @@ |
| #include "base/memory/ptr_util.h" |
| #include "base/strings/utf_string_conversions.h" |
| #include "base/threading/thread_task_runner_handle.h" |
| +#include "base/time/time.h" |
| #include "components/ntp_snippets/category.h" |
| -#include "components/ntp_snippets/reading_list/reading_list_distillation_state_util.h" |
| #include "components/reading_list/core/reading_list_entry.h" |
| #include "components/reading_list/core/reading_list_model.h" |
| #include "components/strings/grit/components_strings.h" |
| @@ -218,10 +218,16 @@ ContentSuggestion ReadingListSuggestionsProvider::ConvertEntry( |
| } |
| suggestion.set_publisher_name( |
| url_formatter::FormatUrl(entry->URL().GetOrigin())); |
| + int64_t entry_time = |
| + entry->DistillationTime() / base::Time::kMicrosecondsPerSecond; |
|
jif
2017/05/10 09:06:19
Can you change the description of DistillationTime
gambard
2017/05/10 09:23:27
Done.
|
| + if (entry_time == 0) { |
| + entry_time = entry->CreationTime() / base::Time::kMicrosecondsPerSecond; |
| + } |
| + |
| + suggestion.set_publish_date(base::Time::FromDoubleT(entry_time)); |
| auto extra = base::MakeUnique<ReadingListSuggestionExtra>(); |
| - extra->distilled_state = |
| - SuggestionStateFromReadingListState(entry->DistilledState()); |
| + extra->distilled = entry->DistilledState() == ReadingListEntry::PROCESSED; |
| extra->favicon_page_url = |
| entry->DistilledURL().is_valid() ? entry->DistilledURL() : entry->URL(); |
| suggestion.set_reading_list_suggestion_extra(std::move(extra)); |