| OLD | NEW |
| (Empty) |
| 1 // Copyright (c) 2012 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/extensions/api/bluetooth/bluetooth_api_factory.h" | |
| 6 | |
| 7 #include "chrome/browser/extensions/api/bluetooth/bluetooth_api.h" | |
| 8 #include "chrome/browser/extensions/extension_system_factory.h" | |
| 9 #include "chrome/browser/profiles/profile.h" | |
| 10 #include "components/browser_context_keyed_service/browser_context_dependency_ma
nager.h" | |
| 11 #include "extensions/browser/extensions_browser_client.h" | |
| 12 | |
| 13 namespace extensions { | |
| 14 | |
| 15 // static | |
| 16 BluetoothAPI* BluetoothAPIFactory::GetForProfile(Profile* profile) { | |
| 17 return static_cast<BluetoothAPI*>( | |
| 18 GetInstance()->GetServiceForBrowserContext(profile, true)); | |
| 19 } | |
| 20 | |
| 21 // static | |
| 22 BluetoothAPIFactory* BluetoothAPIFactory::GetInstance() { | |
| 23 return Singleton<BluetoothAPIFactory>::get(); | |
| 24 } | |
| 25 | |
| 26 BluetoothAPIFactory::BluetoothAPIFactory() | |
| 27 : BrowserContextKeyedServiceFactory( | |
| 28 "BluetoothAPI", | |
| 29 BrowserContextDependencyManager::GetInstance()) { | |
| 30 DependsOn(ExtensionSystemFactory::GetInstance()); | |
| 31 } | |
| 32 | |
| 33 BluetoothAPIFactory::~BluetoothAPIFactory() { | |
| 34 } | |
| 35 | |
| 36 BrowserContextKeyedService* BluetoothAPIFactory::BuildServiceInstanceFor( | |
| 37 content::BrowserContext* profile) const { | |
| 38 return new BluetoothAPI(static_cast<Profile*>(profile)); | |
| 39 } | |
| 40 | |
| 41 content::BrowserContext* BluetoothAPIFactory::GetBrowserContextToUse( | |
| 42 content::BrowserContext* context) const { | |
| 43 return ExtensionsBrowserClient::Get()->GetOriginalContext(context); | |
| 44 } | |
| 45 | |
| 46 bool BluetoothAPIFactory::ServiceIsCreatedWithBrowserContext() const { | |
| 47 return true; | |
| 48 } | |
| 49 | |
| 50 bool BluetoothAPIFactory::ServiceIsNULLWhileTesting() const { | |
| 51 return true; | |
| 52 } | |
| 53 | |
| 54 } // namespace extensions | |
| OLD | NEW |