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