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

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

Issue 2671453003: [NTP::Cleanup] Avoid nested complex function calls (Closed)
Patch Set: clean rebase. Created 3 years, 10 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 | ios/chrome/browser/ntp_snippets/ios_chrome_content_suggestions_service_factory.cc » ('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 033f9c92c00a60122024a3dda5b732676bd5f9cd..903d743053999085c3735f64373deed816a0cc5f 100644
--- a/chrome/browser/ntp_snippets/content_suggestions_service_factory.cc
+++ b/chrome/browser/ntp_snippets/content_suggestions_service_factory.cc
@@ -171,15 +171,15 @@ void RegisterArticleProvider(SigninManagerBase* signin_manager,
base::SequencedWorkerPool::CONTINUE_ON_SHUTDOWN);
bool is_stable_channel =
chrome::GetChannel() == version_info::Channel::STABLE;
+ auto suggestions_fetcher = base::MakeUnique<RemoteSuggestionsFetcher>(
+ signin_manager, token_service, request_context, pref_service,
+ language_model, base::Bind(&safe_json::SafeJsonParser::Parse),
+ is_stable_channel ? google_apis::GetAPIKey()
+ : google_apis::GetNonStableAPIKey(),
+ service->user_classifier());
auto provider = base::MakeUnique<RemoteSuggestionsProviderImpl>(
service, pref_service, g_browser_process->GetApplicationLocale(),
- service->category_ranker(),
- base::MakeUnique<RemoteSuggestionsFetcher>(
- signin_manager, token_service, request_context, pref_service,
- language_model, base::Bind(&safe_json::SafeJsonParser::Parse),
- is_stable_channel ? google_apis::GetAPIKey()
- : google_apis::GetNonStableAPIKey(),
- service->user_classifier()),
+ service->category_ranker(), std::move(suggestions_fetcher),
base::MakeUnique<ImageFetcherImpl>(base::MakeUnique<ImageDecoderImpl>(),
request_context.get()),
base::MakeUnique<ImageDecoderImpl>(),
« no previous file with comments | « no previous file | ios/chrome/browser/ntp_snippets/ios_chrome_content_suggestions_service_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698