| 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/keyed_service/content/browser_context_dependency_manager.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 KeyedService* ChromeMidiPermissionContextFactory::BuildServiceInstanceFor( | |
| 37 content::BrowserContext* profile) const { | |
| 38 return new ChromeMidiPermissionContext(static_cast<Profile*>(profile)); | |
| 39 } | |
| 40 | |
| 41 content::BrowserContext* | |
| 42 ChromeMidiPermissionContextFactory::GetBrowserContextToUse( | |
| 43 content::BrowserContext* context) const { | |
| 44 return chrome::GetBrowserContextOwnInstanceInIncognito(context); | |
| 45 } | |
| OLD | NEW |