#include "content/browser/media/media_devices_permission_checker.h"
#include <utility>
#include <vector>
#include "base/command_line.h"
#include "base/functional/bind.h"
#include "build/build_config.h"
#include "content/browser/permissions/permission_util.h"
#include "content/browser/renderer_host/render_frame_host_delegate.h"
#include "content/browser/renderer_host/render_frame_host_impl.h"
#include "content/public/browser/browser_context.h"
#include "content/public/browser/browser_task_traits.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/permission_controller.h"
#include "content/public/browser/render_process_host.h"
#include "content/public/browser/web_contents.h"
#include "content/public/common/content_switches.h"
#include "third_party/blink/public/common/mediastream/media_devices.h"
#include "third_party/blink/public/common/permissions/permission_utils.h"
#include "url/gurl.h"
#include "url/origin.h"
namespace content {
namespace {
MediaDevicesManager::BoolDeviceTypes DoCheckPermissionsOnUIThread(
MediaDevicesManager::BoolDeviceTypes requested_device_types,
int render_process_id,
int render_frame_id) { … }
bool CheckSinglePermissionOnUIThread(MediaDeviceType device_type,
int render_process_id,
int render_frame_id) { … }
}
MediaDevicesPermissionChecker::MediaDevicesPermissionChecker()
: … { … }
MediaDevicesPermissionChecker::MediaDevicesPermissionChecker(
bool override_value)
: … { … }
bool MediaDevicesPermissionChecker::CheckPermissionOnUIThread(
MediaDeviceType device_type,
int render_process_id,
int render_frame_id) const { … }
void MediaDevicesPermissionChecker::CheckPermission(
MediaDeviceType device_type,
int render_process_id,
int render_frame_id,
base::OnceCallback<void(bool)> callback) const { … }
void MediaDevicesPermissionChecker::CheckPermissions(
MediaDevicesManager::BoolDeviceTypes requested,
int render_process_id,
int render_frame_id,
base::OnceCallback<void(const MediaDevicesManager::BoolDeviceTypes&)>
callback) const { … }
bool MediaDevicesPermissionChecker::HasPanTiltZoomPermissionGrantedOnUIThread(
int render_process_id,
int render_frame_id) { … }
}