Chromium Code Reviews| Index: chrome/browser/ntp_snippets/download_suggestions_provider.h |
| diff --git a/chrome/browser/ntp_snippets/download_suggestions_provider.h b/chrome/browser/ntp_snippets/download_suggestions_provider.h |
| index 59bf356f557328a90abd3ced220aa8b826f48c8b..27a767cccc52845f023011c3ba27230bb49e9144 100644 |
| --- a/chrome/browser/ntp_snippets/download_suggestions_provider.h |
| +++ b/chrome/browser/ntp_snippets/download_suggestions_provider.h |
| @@ -28,6 +28,10 @@ namespace offline_pages { |
| struct OfflinePageItem; |
| } |
| +namespace base { |
| +class Clock; |
| +} |
| + |
| // Provides download content suggestions from the offline pages model and the |
| // download manager (obtaining the data through DownloadManager and each |
| // DownloadItem). Offline page related downloads are referred to as offline page |
| @@ -46,7 +50,8 @@ class DownloadSuggestionsProvider |
| offline_pages::OfflinePageModel* offline_page_model, |
| content::DownloadManager* download_manager, |
| DownloadHistory* download_history, |
| - PrefService* pref_service); |
| + PrefService* pref_service, |
| + std::unique_ptr<base::Clock> clock); |
| ~DownloadSuggestionsProvider() override; |
| // ContentSuggestionsProvider implementation. |
| @@ -136,6 +141,9 @@ class DownloadSuggestionsProvider |
| ntp_snippets::ContentSuggestion ConvertDownloadItem( |
| const content::DownloadItem& download_item) const; |
| + // Returns true if a download published time is too old to be shown. |
| + bool IsDownloadOld(const base::Time& published_time); |
|
tschumann
2017/02/02 14:30:34
'old' is a bit short on semantics.
Should we call
vitaliii
2017/02/07 10:26:05
Done. "Outdated"
|
| + |
| // Adds |item| to the internal asset download cache if all of the following |
| // holds: |
| // - the download is completed; |
| @@ -205,8 +213,8 @@ class DownloadSuggestionsProvider |
| offline_pages::OfflinePageModel* offline_page_model_; |
| content::DownloadManager* download_manager_; |
| DownloadHistory* download_history_; |
| - |
| PrefService* pref_service_; |
| + std::unique_ptr<base::Clock> clock_; |
| // Cached offline page downloads. If there are not enough asset downloads, all |
| // of these could be shown (they are the most recently visited, not dismissed |