Refactor WebsiteSettings to operate on a SecurityInfo
[chromium-blink-merge.git] / chrome / browser / media / midi_permission_context_factory.cc
blobb4c974a1dcf3b9e395a2fd0f7ba5ad8ee6229ca4
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.
5 #include "chrome/browser/media/midi_permission_context_factory.h"
7 #include "chrome/browser/media/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"
12 // static
13 MidiPermissionContext*
14 MidiPermissionContextFactory::GetForProfile(Profile* profile) {
15 return static_cast<MidiPermissionContext*>(
16 GetInstance()->GetServiceForBrowserContext(profile, true));
19 // static
20 MidiPermissionContextFactory*
21 MidiPermissionContextFactory::GetInstance() {
22 return base::Singleton<MidiPermissionContextFactory>::get();
25 MidiPermissionContextFactory::MidiPermissionContextFactory()
26 : PermissionContextFactoryBase(
27 "MidiPermissionContext",
28 BrowserContextDependencyManager::GetInstance()) {
31 MidiPermissionContextFactory::~MidiPermissionContextFactory() {
34 KeyedService* MidiPermissionContextFactory::BuildServiceInstanceFor(
35 content::BrowserContext* profile) const {
36 return new MidiPermissionContext(static_cast<Profile*>(profile));