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

Unified Diff: chrome/browser/media/tab_capture_access_handler.cc

Issue 2307083002: Cleanup: move WebRTC related files from chrome/browser/media to chrome/browser/media/webrtc/ (Closed)
Patch Set: Removed file wrongly resuscitated during rebase Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/media/tab_capture_access_handler.h ('k') | chrome/browser/media/tab_desktop_media_list.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/media/tab_capture_access_handler.cc
diff --git a/chrome/browser/media/tab_capture_access_handler.cc b/chrome/browser/media/tab_capture_access_handler.cc
deleted file mode 100644
index 4a4bb6852c8840fdc46cb1277b33a0e811e52c16..0000000000000000000000000000000000000000
--- a/chrome/browser/media/tab_capture_access_handler.cc
+++ /dev/null
@@ -1,86 +0,0 @@
-// Copyright 2015 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "chrome/browser/media/tab_capture_access_handler.h"
-
-#include <utility>
-
-#include "chrome/browser/extensions/api/tab_capture/tab_capture_registry.h"
-#include "chrome/browser/media/media_capture_devices_dispatcher.h"
-#include "chrome/browser/media/media_stream_capture_indicator.h"
-#include "chrome/browser/profiles/profile.h"
-#include "content/public/browser/web_contents.h"
-#include "extensions/common/permissions/permissions_data.h"
-
-TabCaptureAccessHandler::TabCaptureAccessHandler() {
-}
-
-TabCaptureAccessHandler::~TabCaptureAccessHandler() {
-}
-
-bool TabCaptureAccessHandler::SupportsStreamType(
- const content::MediaStreamType type,
- const extensions::Extension* extension) {
- return type == content::MEDIA_TAB_VIDEO_CAPTURE ||
- type == content::MEDIA_TAB_AUDIO_CAPTURE;
-}
-
-bool TabCaptureAccessHandler::CheckMediaAccessPermission(
- content::WebContents* web_contents,
- const GURL& security_origin,
- content::MediaStreamType type,
- const extensions::Extension* extension) {
- return false;
-}
-
-void TabCaptureAccessHandler::HandleRequest(
- content::WebContents* web_contents,
- const content::MediaStreamRequest& request,
- const content::MediaResponseCallback& callback,
- const extensions::Extension* extension) {
- content::MediaStreamDevices devices;
- std::unique_ptr<content::MediaStreamUI> ui;
-
- if (!extension)
- callback.Run(devices, content::MEDIA_DEVICE_TAB_CAPTURE_FAILURE,
- std::move(ui));
-
- Profile* profile =
- Profile::FromBrowserContext(web_contents->GetBrowserContext());
- extensions::TabCaptureRegistry* tab_capture_registry =
- extensions::TabCaptureRegistry::Get(profile);
- if (!tab_capture_registry) {
- NOTREACHED();
- callback.Run(devices, content::MEDIA_DEVICE_INVALID_STATE, std::move(ui));
- return;
- }
- const bool tab_capture_allowed = tab_capture_registry->VerifyRequest(
- request.render_process_id, request.render_frame_id, extension->id());
-
- if (request.audio_type == content::MEDIA_TAB_AUDIO_CAPTURE &&
- tab_capture_allowed &&
- extension->permissions_data()->HasAPIPermission(
- extensions::APIPermission::kTabCapture)) {
- devices.push_back(content::MediaStreamDevice(
- content::MEDIA_TAB_AUDIO_CAPTURE, std::string(), std::string()));
- }
-
- if (request.video_type == content::MEDIA_TAB_VIDEO_CAPTURE &&
- tab_capture_allowed &&
- extension->permissions_data()->HasAPIPermission(
- extensions::APIPermission::kTabCapture)) {
- devices.push_back(content::MediaStreamDevice(
- content::MEDIA_TAB_VIDEO_CAPTURE, std::string(), std::string()));
- }
-
- if (!devices.empty()) {
- ui = MediaCaptureDevicesDispatcher::GetInstance()
- ->GetMediaStreamCaptureIndicator()
- ->RegisterMediaStream(web_contents, devices);
- }
- UpdateExtensionTrusted(request, extension);
- callback.Run(devices, devices.empty() ? content::MEDIA_DEVICE_INVALID_STATE
- : content::MEDIA_DEVICE_OK,
- std::move(ui));
-}
« no previous file with comments | « chrome/browser/media/tab_capture_access_handler.h ('k') | chrome/browser/media/tab_desktop_media_list.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698