Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(77)

Side by Side Diff: chrome/browser/media/media_stream_mic_permission_context_factory.cc

Issue 1311783007: refactor to Introduce AUDIO_CAPTURE and VIDEO_CAPTURE permissions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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/media/media_stream_mic_permission_context_factory.h"
6
7 #include "chrome/browser/media/media_stream_device_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 MediaStreamMicPermissionContextFactory::MediaStreamMicPermissionContextFactory()
13 : BrowserContextKeyedServiceFactory(
14 "MediaStreamMicPermissionContext",
15 BrowserContextDependencyManager::GetInstance()) {}
16
17 MediaStreamMicPermissionContextFactory::
18 ~MediaStreamMicPermissionContextFactory() {}
19
20 KeyedService* MediaStreamMicPermissionContextFactory::BuildServiceInstanceFor(
21 content::BrowserContext* profile) const {
22 return new MediaStreamDevicePermissionContext(
23 static_cast<Profile*>(profile), CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC);
24 }
25
26 content::BrowserContext*
27 MediaStreamMicPermissionContextFactory::GetBrowserContextToUse(
28 content::BrowserContext* context) const {
29 return chrome::GetBrowserContextOwnInstanceInIncognito(context);
30 }
31
32 // static
33 MediaStreamMicPermissionContextFactory*
34 MediaStreamMicPermissionContextFactory::GetInstance() {
35 return Singleton<MediaStreamMicPermissionContextFactory>::get();
36 }
37
38 // static
39 MediaStreamDevicePermissionContext*
40 MediaStreamMicPermissionContextFactory::GetForProfile(Profile* profile) {
41 return static_cast<MediaStreamDevicePermissionContext*>(
42 GetInstance()->GetServiceForBrowserContext(profile, true));
43 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698