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

Side by Side Diff: chrome/browser/media/webrtc/permission_bubble_media_access_handler.cc

Issue 2696703006: Move media permission checking logic for ChromeOS login pages (Closed)
Patch Set: Move media permission checking logic for ChromeOS login pages Created 3 years, 10 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
« no previous file with comments | « chrome/browser/media/webrtc/media_stream_devices_controller.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/media/webrtc/permission_bubble_media_access_handler.h" 5 #include "chrome/browser/media/webrtc/permission_bubble_media_access_handler.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/metrics/field_trial.h" 9 #include "base/metrics/field_trial.h"
10 #include "chrome/browser/media/webrtc/media_permission.h" 10 #include "chrome/browser/media/webrtc/media_permission.h"
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 const extensions::Extension* extension) { 97 const extensions::Extension* extension) {
98 Profile* profile = 98 Profile* profile =
99 Profile::FromBrowserContext(web_contents->GetBrowserContext()); 99 Profile::FromBrowserContext(web_contents->GetBrowserContext());
100 ContentSettingsType content_settings_type = 100 ContentSettingsType content_settings_type =
101 type == content::MEDIA_DEVICE_AUDIO_CAPTURE 101 type == content::MEDIA_DEVICE_AUDIO_CAPTURE
102 ? CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC 102 ? CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC
103 : CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA; 103 : CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA;
104 104
105 MediaPermission permission(content_settings_type, security_origin, 105 MediaPermission permission(content_settings_type, security_origin,
106 web_contents->GetLastCommittedURL().GetOrigin(), 106 web_contents->GetLastCommittedURL().GetOrigin(),
107 profile); 107 profile, web_contents);
108 content::MediaStreamRequestResult unused; 108 content::MediaStreamRequestResult unused;
109 return permission.GetPermissionStatus(&unused) == CONTENT_SETTING_ALLOW; 109 return permission.GetPermissionStatus(&unused) == CONTENT_SETTING_ALLOW;
110 } 110 }
111 111
112 void PermissionBubbleMediaAccessHandler::HandleRequest( 112 void PermissionBubbleMediaAccessHandler::HandleRequest(
113 content::WebContents* web_contents, 113 content::WebContents* web_contents,
114 const content::MediaStreamRequest& request, 114 const content::MediaStreamRequest& request,
115 const content::MediaResponseCallback& callback, 115 const content::MediaResponseCallback& callback,
116 const extensions::Extension* extension) { 116 const extensions::Extension* extension) {
117 DCHECK_CURRENTLY_ON(BrowserThread::UI); 117 DCHECK_CURRENTLY_ON(BrowserThread::UI);
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
275 275
276 void PermissionBubbleMediaAccessHandler::Observe( 276 void PermissionBubbleMediaAccessHandler::Observe(
277 int type, 277 int type,
278 const content::NotificationSource& source, 278 const content::NotificationSource& source,
279 const content::NotificationDetails& details) { 279 const content::NotificationDetails& details) {
280 DCHECK_CURRENTLY_ON(BrowserThread::UI); 280 DCHECK_CURRENTLY_ON(BrowserThread::UI);
281 DCHECK_EQ(content::NOTIFICATION_WEB_CONTENTS_DESTROYED, type); 281 DCHECK_EQ(content::NOTIFICATION_WEB_CONTENTS_DESTROYED, type);
282 282
283 pending_requests_.erase(content::Source<content::WebContents>(source).ptr()); 283 pending_requests_.erase(content::Source<content::WebContents>(source).ptr());
284 } 284 }
OLDNEW
« no previous file with comments | « chrome/browser/media/webrtc/media_stream_devices_controller.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698