OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 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/bluetooth/bluetooth_permission_context_factory.h" |
| 6 |
| 7 #include "chrome/browser/bluetooth/bluetooth_permission_context.h" |
| 8 #include "chrome/browser/profiles/profile.h" |
| 9 #include "components/keyed_service/content/browser_context_dependency_manager.h" |
| 10 |
| 11 BluetoothPermissionContextFactory::BluetoothPermissionContextFactory() |
| 12 : PermissionContextFactoryBase( |
| 13 "BluetoothPermissionContext", |
| 14 BrowserContextDependencyManager::GetInstance()) {} |
| 15 |
| 16 BluetoothPermissionContextFactory::~BluetoothPermissionContextFactory() {} |
| 17 |
| 18 // static |
| 19 BluetoothPermissionContextFactory* |
| 20 BluetoothPermissionContextFactory::GetInstance() { |
| 21 return base::Singleton<BluetoothPermissionContextFactory>::get(); |
| 22 } |
| 23 |
| 24 // static |
| 25 BluetoothPermissionContext* BluetoothPermissionContextFactory::GetForProfile( |
| 26 Profile* profile) { |
| 27 return static_cast<BluetoothPermissionContext*>( |
| 28 GetInstance()->GetServiceForBrowserContext(profile, true)); |
| 29 } |
| 30 |
| 31 KeyedService* BluetoothPermissionContextFactory::BuildServiceInstanceFor( |
| 32 content::BrowserContext* context) const { |
| 33 return new BluetoothPermissionContext(Profile::FromBrowserContext(context)); |
| 34 } |
OLD | NEW |