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

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

Issue 2746873004: Move ChromeOS login media access logic into a MediaAccessHandler (Closed)
Patch Set: Move ChromeOS login media access logic into a MediaAccessHandler Created 3 years, 8 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
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/desktop_capture_access_handler.h" 5 #include "chrome/browser/media/webrtc/desktop_capture_access_handler.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/strings/string_number_conversions.h" 10 #include "base/strings/string_number_conversions.h"
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after
344 344
345 bool DesktopCaptureAccessHandler::IsDefaultApproved( 345 bool DesktopCaptureAccessHandler::IsDefaultApproved(
346 const extensions::Extension* extension) { 346 const extensions::Extension* extension) {
347 return extension && 347 return extension &&
348 (extension->location() == extensions::Manifest::COMPONENT || 348 (extension->location() == extensions::Manifest::COMPONENT ||
349 extension->location() == extensions::Manifest::EXTERNAL_COMPONENT || 349 extension->location() == extensions::Manifest::EXTERNAL_COMPONENT ||
350 IsExtensionWhitelistedForScreenCapture(extension)); 350 IsExtensionWhitelistedForScreenCapture(extension));
351 } 351 }
352 352
353 bool DesktopCaptureAccessHandler::SupportsStreamType( 353 bool DesktopCaptureAccessHandler::SupportsStreamType(
354 content::WebContents* web_contents,
354 const content::MediaStreamType type, 355 const content::MediaStreamType type,
355 const extensions::Extension* extension) { 356 const extensions::Extension* extension) {
356 return type == content::MEDIA_DESKTOP_VIDEO_CAPTURE || 357 return type == content::MEDIA_DESKTOP_VIDEO_CAPTURE ||
357 type == content::MEDIA_DESKTOP_AUDIO_CAPTURE; 358 type == content::MEDIA_DESKTOP_AUDIO_CAPTURE;
358 } 359 }
359 360
360 bool DesktopCaptureAccessHandler::CheckMediaAccessPermission( 361 bool DesktopCaptureAccessHandler::CheckMediaAccessPermission(
361 content::WebContents* web_contents, 362 content::WebContents* web_contents,
362 const GURL& security_origin, 363 const GURL& security_origin,
363 content::MediaStreamType type, 364 content::MediaStreamType type,
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
448 const bool display_notification = ShouldDisplayNotification(extension); 449 const bool display_notification = ShouldDisplayNotification(extension);
449 450
450 ui = GetDevicesForDesktopCapture(&devices, media_id, capture_audio, 451 ui = GetDevicesForDesktopCapture(&devices, media_id, capture_audio,
451 request.disable_local_echo, 452 request.disable_local_echo,
452 display_notification, 453 display_notification,
453 GetApplicationTitle(web_contents, extension), 454 GetApplicationTitle(web_contents, extension),
454 base::UTF8ToUTF16(original_extension_name)); 455 base::UTF8ToUTF16(original_extension_name));
455 UpdateExtensionTrusted(request, extension); 456 UpdateExtensionTrusted(request, extension);
456 callback.Run(devices, content::MEDIA_DEVICE_OK, std::move(ui)); 457 callback.Run(devices, content::MEDIA_DEVICE_OK, std::move(ui));
457 } 458 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698