Index: chrome/browser/chromeos/tether/tether_service_factory.cc |
diff --git a/chrome/browser/chromeos/tether/tether_service_factory.cc b/chrome/browser/chromeos/tether/tether_service_factory.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..d07ab579f744ff33b35fdc2bd36db08248410a33 |
--- /dev/null |
+++ b/chrome/browser/chromeos/tether/tether_service_factory.cc |
@@ -0,0 +1,44 @@ |
+// Copyright 2017 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#include "chrome/browser/chromeos/tether/tether_service_factory.h" |
+ |
+#include "base/memory/singleton.h" |
+#include "chrome/browser/cryptauth/chrome_cryptauth_service_factory.h" |
+#include "chrome/browser/profiles/profile.h" |
+#include "chrome/common/pref_names.h" |
+#include "components/keyed_service/content/browser_context_dependency_manager.h" |
+#include "components/pref_registry/pref_registry_syncable.h" |
+ |
+// static |
+TetherServiceFactory* TetherServiceFactory::GetInstance() { |
+ return base::Singleton<TetherServiceFactory>::get(); |
+} |
+ |
+// static |
+TetherService* TetherServiceFactory::GetForBrowserContext( |
+ content::BrowserContext* browser_context) { |
+ return static_cast<TetherService*>( |
+ TetherServiceFactory::GetInstance()->GetServiceForBrowserContext( |
+ browser_context, true)); |
+} |
+ |
+TetherServiceFactory::TetherServiceFactory() |
+ : BrowserContextKeyedServiceFactory( |
+ "TetherService", |
+ BrowserContextDependencyManager::GetInstance()) { |
+ DependsOn(ChromeCryptAuthServiceFactory::GetInstance()); |
+} |
+ |
+TetherServiceFactory::~TetherServiceFactory() {} |
+ |
+KeyedService* TetherServiceFactory::BuildServiceInstanceFor( |
+ content::BrowserContext* context) const { |
+ return new TetherService(Profile::FromBrowserContext(context)); |
+} |
+ |
+void TetherServiceFactory::RegisterProfilePrefs( |
+ user_prefs::PrefRegistrySyncable* registry) { |
+ TetherService::RegisterProfilePrefs(registry); |
+} |