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

Unified Diff: chrome/browser/ntp_snippets/content_suggestions_service_factory.cc

Issue 2629603002: [NTP::Downloads] Fetch assets once the manager is loaded. (Closed)
Patch Set: constructed DownloadHistory + tests. Created 3 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/ntp_snippets/download_suggestions_provider.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ntp_snippets/content_suggestions_service_factory.cc
diff --git a/chrome/browser/ntp_snippets/content_suggestions_service_factory.cc b/chrome/browser/ntp_snippets/content_suggestions_service_factory.cc
index d21b916c1401b7a539398e40dabb61fac0b21c08..00dd9e6db0fdfffa441299c79a21cd99cc8df583 100644
--- a/chrome/browser/ntp_snippets/content_suggestions_service_factory.cc
+++ b/chrome/browser/ntp_snippets/content_suggestions_service_factory.cc
@@ -58,6 +58,9 @@
#include "chrome/browser/android/chrome_feature_list.h"
#include "chrome/browser/android/ntp/ntp_snippets_launcher.h"
#include "chrome/browser/android/offline_pages/offline_page_model_factory.h"
+#include "chrome/browser/download/download_history.h"
+#include "chrome/browser/download/download_service.h"
+#include "chrome/browser/download/download_service_factory.h"
#include "chrome/browser/ntp_snippets/download_suggestions_provider.h"
#include "components/ntp_snippets/offline_pages/recent_tab_suggestions_provider.h"
#include "components/ntp_snippets/physical_web_pages/physical_web_page_suggestions_provider.h"
@@ -120,13 +123,14 @@ void RegisterRecentTabProvider(OfflinePageModel* offline_page_model,
void RegisterDownloadsProvider(OfflinePageModel* offline_page_model,
DownloadManager* download_manager,
+ DownloadHistory* download_history,
ContentSuggestionsService* service,
PrefService* pref_service) {
bool download_manager_ui_enabled =
base::FeatureList::IsEnabled(chrome::android::kDownloadsUiFeature);
auto provider = base::MakeUnique<DownloadSuggestionsProvider>(
- service, offline_page_model, download_manager, pref_service,
- download_manager_ui_enabled);
+ service, offline_page_model, download_manager, download_history,
+ pref_service, download_manager_ui_enabled);
service->RegisterProvider(std::move(provider));
}
#endif // OS_ANDROID
@@ -288,6 +292,9 @@ KeyedService* ContentSuggestionsServiceFactory::BuildServiceInstanceFor(
OfflinePageModelFactory::GetForBrowserContext(profile);
DownloadManager* download_manager =
content::BrowserContext::GetDownloadManager(profile);
+ DownloadService* download_service =
+ DownloadServiceFactory::GetForBrowserContext(profile);
+ DownloadHistory* download_history = download_service->GetDownloadHistory();
PhysicalWebDataSource* physical_web_data_source =
g_browser_process->GetPhysicalWebDataSource();
#endif // OS_ANDROID
@@ -312,8 +319,8 @@ KeyedService* ContentSuggestionsServiceFactory::BuildServiceInstanceFor(
if (show_asset_downloads || show_offline_page_downloads) {
RegisterDownloadsProvider(
show_offline_page_downloads ? offline_page_model : nullptr,
- show_asset_downloads ? download_manager : nullptr, service,
- pref_service);
+ show_asset_downloads ? download_manager : nullptr, download_history,
+ service, pref_service);
}
#endif // OS_ANDROID
« no previous file with comments | « no previous file | chrome/browser/ntp_snippets/download_suggestions_provider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698