Chromium Code Reviews| Index: components/ntp_snippets/offline_pages/offline_page_suggestions_provider.cc |
| diff --git a/components/ntp_snippets/offline_pages/offline_page_suggestions_provider.cc b/components/ntp_snippets/offline_pages/offline_page_suggestions_provider.cc |
| index ff3235d32cb2dd1efc57af2db153b499d3d2240d..845dd5ae7c543b350fc815438f2f90f0e2768d11 100644 |
| --- a/components/ntp_snippets/offline_pages/offline_page_suggestions_provider.cc |
| +++ b/components/ntp_snippets/offline_pages/offline_page_suggestions_provider.cc |
| @@ -17,6 +17,7 @@ |
| #include "components/ntp_snippets/pref_names.h" |
| #include "components/ntp_snippets/pref_util.h" |
| #include "components/offline_pages/client_namespace_constants.h" |
| +#include "components/offline_pages/client_policy_controller.h" |
| #include "components/prefs/pref_registry_simple.h" |
| #include "components/prefs/pref_service.h" |
| #include "grit/components_strings.h" |
| @@ -40,19 +41,20 @@ struct OrderByMostRecentlyVisited { |
| } |
| }; |
| -bool IsRecentTab(const offline_pages::ClientId& client_id) { |
| +} // namespace |
| + |
| +bool OfflinePageSuggestionsProvider::IsRecentTab( |
| + const offline_pages::ClientId& client_id) { |
| return client_id.name_space == offline_pages::kLastNNamespace; |
| } |
| -bool IsDownload(const offline_pages::ClientId& client_id) { |
| - // TODO(pke): Use kDownloadNamespace once the OfflinePageModel uses that. |
| - // The current logic is taken from DownloadUIAdapter::IsVisibleInUI. |
| - return client_id.name_space == offline_pages::kAsyncNamespace && |
| +bool OfflinePageSuggestionsProvider::IsDownload( |
| + const offline_pages::ClientId& client_id) { |
| + return offline_page_model_->GetPolicyController()->IsSupportedByDownload( |
|
romax
2016/10/04 17:50:34
sorry i remembered we had a discussion on this but
chili
2016/10/04 18:08:53
If it's static, we'd either
--- Get the OfflinePag
|
| + client_id.name_space) && |
| base::IsValidGUID(client_id.id); |
| } |
| -} // namespace |
| - |
| OfflinePageSuggestionsProvider::OfflinePageSuggestionsProvider( |
| bool recent_tabs_enabled, |
| bool downloads_enabled, |