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

Side by Side Diff: chrome/browser/search/google_search_provider_service_factory.cc

Issue 2805133004: Local NTP: Deploy strict-dynamic CSP (Closed)
Patch Set: fix Created 3 years, 8 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
(Empty)
1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "chrome/browser/search/google_search_provider_service_factory.h"
6
7 #include "chrome/browser/profiles/profile.h"
8 #include "chrome/browser/search/google_search_provider_service.h"
9 #include "chrome/browser/search_engines/template_url_service_factory.h"
10 #include "components/keyed_service/content/browser_context_dependency_manager.h"
11 #include "content/public/browser/browser_context.h"
12
13 // static
14 GoogleSearchProviderService* GoogleSearchProviderServiceFactory::GetForProfile(
15 Profile* profile) {
16 return static_cast<GoogleSearchProviderService*>(
17 GetInstance()->GetServiceForBrowserContext(profile, true));
18 }
19
20 // static
21 GoogleSearchProviderServiceFactory*
22 GoogleSearchProviderServiceFactory::GetInstance() {
23 return base::Singleton<GoogleSearchProviderServiceFactory>::get();
24 }
25
26 GoogleSearchProviderServiceFactory::GoogleSearchProviderServiceFactory()
27 : BrowserContextKeyedServiceFactory(
28 "GoogleSearchProviderService",
29 BrowserContextDependencyManager::GetInstance()) {
30 DependsOn(TemplateURLServiceFactory::GetInstance());
31 }
32
33 GoogleSearchProviderServiceFactory::~GoogleSearchProviderServiceFactory() =
34 default;
35
36 KeyedService* GoogleSearchProviderServiceFactory::BuildServiceInstanceFor(
37 content::BrowserContext* context) const {
38 Profile* profile = Profile::FromBrowserContext(context);
39 return new GoogleSearchProviderService(
40 TemplateURLServiceFactory::GetForProfile(profile));
41 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698