OLD | NEW |
(Empty) | |
| 1 // Copyright 2013 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/media/chrome_midi_permission_context_factory.h" |
| 6 |
| 7 #include "chrome/browser/media/chrome_midi_permission_context.h" |
| 8 #include "chrome/browser/profiles/incognito_helpers.h" |
| 9 #include "chrome/browser/profiles/profile.h" |
| 10 #include "components/browser_context_keyed_service/browser_context_dependency_ma
nager.h" |
| 11 |
| 12 // static |
| 13 ChromeMIDIPermissionContext* |
| 14 ChromeMIDIPermissionContextFactory::GetForProfile(Profile* profile) { |
| 15 return static_cast<ChromeMIDIPermissionContext*>( |
| 16 GetInstance()->GetServiceForBrowserContext(profile, true)); |
| 17 } |
| 18 |
| 19 // static |
| 20 ChromeMIDIPermissionContextFactory* |
| 21 ChromeMIDIPermissionContextFactory::GetInstance() { |
| 22 return Singleton<ChromeMIDIPermissionContextFactory>::get(); |
| 23 } |
| 24 |
| 25 ChromeMIDIPermissionContextFactory:: |
| 26 ChromeMIDIPermissionContextFactory() |
| 27 : BrowserContextKeyedServiceFactory( |
| 28 "ChromeMIDIPermissionContext", |
| 29 BrowserContextDependencyManager::GetInstance()) { |
| 30 } |
| 31 |
| 32 ChromeMIDIPermissionContextFactory:: |
| 33 ~ChromeMIDIPermissionContextFactory() { |
| 34 } |
| 35 |
| 36 BrowserContextKeyedService* |
| 37 ChromeMIDIPermissionContextFactory::BuildServiceInstanceFor( |
| 38 content::BrowserContext* profile) const { |
| 39 return new ChromeMIDIPermissionContext(static_cast<Profile*>(profile)); |
| 40 } |
| 41 |
| 42 content::BrowserContext* |
| 43 ChromeMIDIPermissionContextFactory::GetBrowserContextToUse( |
| 44 content::BrowserContext* context) const { |
| 45 return chrome::GetBrowserContextOwnInstanceInIncognito(context); |
| 46 } |
OLD | NEW |