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

Side by Side Diff: chrome/browser/ntp_snippets/ntp_snippets_service_factory.cc

Issue 2162533002: Adding a request counter to the snippets fetcher. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@traffic-monitor
Patch Set: Bernhard's comments Created 4 years, 4 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ntp_snippets/ntp_snippets_service_factory.h" 5 #include "chrome/browser/ntp_snippets/ntp_snippets_service_factory.h"
6 6
7 #include "base/feature_list.h" 7 #include "base/feature_list.h"
8 #include "base/files/file_path.h" 8 #include "base/files/file_path.h"
9 #include "base/memory/ptr_util.h" 9 #include "base/memory/ptr_util.h"
10 #include "base/memory/singleton.h" 10 #include "base/memory/singleton.h"
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 ->GetSequencedTaskRunnerWithShutdownBehavior( 117 ->GetSequencedTaskRunnerWithShutdownBehavior(
118 base::SequencedWorkerPool::GetSequenceToken(), 118 base::SequencedWorkerPool::GetSequenceToken(),
119 base::SequencedWorkerPool::CONTINUE_ON_SHUTDOWN); 119 base::SequencedWorkerPool::CONTINUE_ON_SHUTDOWN);
120 120
121 ntp_snippets::NTPSnippetsService* ntp_snippets_service = 121 ntp_snippets::NTPSnippetsService* ntp_snippets_service =
122 new ntp_snippets::NTPSnippetsService( 122 new ntp_snippets::NTPSnippetsService(
123 enabled, profile->GetPrefs(), suggestions_service, 123 enabled, profile->GetPrefs(), suggestions_service,
124 g_browser_process->GetApplicationLocale(), scheduler, 124 g_browser_process->GetApplicationLocale(), scheduler,
125 base::MakeUnique<ntp_snippets::NTPSnippetsFetcher>( 125 base::MakeUnique<ntp_snippets::NTPSnippetsFetcher>(
126 signin_manager, token_service, request_context, 126 signin_manager, token_service, request_context,
127 profile->GetPrefs(),
127 base::Bind(&safe_json::SafeJsonParser::Parse), 128 base::Bind(&safe_json::SafeJsonParser::Parse),
128 chrome::GetChannel() == version_info::Channel::STABLE), 129 chrome::GetChannel() == version_info::Channel::STABLE),
129 base::MakeUnique<ImageFetcherImpl>( 130 base::MakeUnique<ImageFetcherImpl>(
130 base::MakeUnique<ImageDecoderImpl>(), request_context.get()), 131 base::MakeUnique<ImageDecoderImpl>(), request_context.get()),
131 base::MakeUnique<ImageDecoderImpl>(), 132 base::MakeUnique<ImageDecoderImpl>(),
132 base::MakeUnique<ntp_snippets::NTPSnippetsDatabase>(database_dir, 133 base::MakeUnique<ntp_snippets::NTPSnippetsDatabase>(database_dir,
133 task_runner), 134 task_runner),
134 base::MakeUnique<ntp_snippets::NTPSnippetsStatusService>( 135 base::MakeUnique<ntp_snippets::NTPSnippetsStatusService>(
135 signin_manager, sync_service, profile->GetPrefs())); 136 signin_manager, sync_service, profile->GetPrefs()));
136 137
137 if (content_suggestions_service->state() == 138 if (content_suggestions_service->state() ==
138 ContentSuggestionsService::State::ENABLED) { 139 ContentSuggestionsService::State::ENABLED) {
139 content_suggestions_service->RegisterProvider(ntp_snippets_service); 140 content_suggestions_service->RegisterProvider(ntp_snippets_service);
140 } 141 }
141 return ntp_snippets_service; 142 return ntp_snippets_service;
142 } 143 }
OLDNEW
« no previous file with comments | « chrome/browser/android/ntp/ntp_snippets_bridge.cc ('k') | chrome/browser/ui/webui/snippets_internals_message_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698