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

Side by Side Diff: chrome/browser/chromeos/tether/tether_service_factory.cc

Issue 2819713002: Create TetherService, a TetherAllowed pref, and use DependencyManager for RegisterProfilePrefs call… (Closed)
Patch Set: Create an IsEnabled method on TetherService. 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/chromeos/tether/tether_service_factory.h"
6
7 #include "base/memory/singleton.h"
8 #include "chrome/browser/cryptauth/chrome_cryptauth_service_factory.h"
9 #include "chrome/browser/profiles/profile.h"
10 #include "chrome/common/pref_names.h"
11 #include "components/keyed_service/content/browser_context_dependency_manager.h"
12 #include "components/pref_registry/pref_registry_syncable.h"
13
14 // static
15 TetherServiceFactory* TetherServiceFactory::GetInstance() {
16 return base::Singleton<TetherServiceFactory>::get();
17 }
18
19 // static
20 TetherService* TetherServiceFactory::GetForBrowserContext(
21 content::BrowserContext* browser_context) {
22 return static_cast<TetherService*>(
23 TetherServiceFactory::GetInstance()->GetServiceForBrowserContext(
24 browser_context, true));
25 }
26
27 TetherServiceFactory::TetherServiceFactory()
28 : BrowserContextKeyedServiceFactory(
29 "TetherService",
30 BrowserContextDependencyManager::GetInstance()) {
31 DependsOn(ChromeCryptAuthServiceFactory::GetInstance());
32 }
33
34 TetherServiceFactory::~TetherServiceFactory() {}
35
36 KeyedService* TetherServiceFactory::BuildServiceInstanceFor(
37 content::BrowserContext* context) const {
38 return new TetherService(Profile::FromBrowserContext(context));
39 }
40
41 void TetherServiceFactory::RegisterProfilePrefs(
42 user_prefs::PrefRegistrySyncable* registry) {
43 TetherService::RegisterProfilePrefs(registry);
44 }
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/tether/tether_service_factory.h ('k') | chrome/browser/cryptauth/chrome_cryptauth_service_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698