// 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 "content/shell/browser/shell_permission_manager.h" #include "base/callback.h" #include "base/command_line.h" #include "content/public/browser/permission_type.h" #include "content/public/common/content_switches.h" #include "media/base/media_switches.h" namespace content { ShellPermissionManager::ShellPermissionManager() : PermissionManager() { } ShellPermissionManager::~ShellPermissionManager() { } int ShellPermissionManager::RequestPermission( PermissionType permission, RenderFrameHost* render_frame_host, const GURL& requesting_origin, bool user_gesture, const base::Callback& callback) { callback.Run(permission == PermissionType::GEOLOCATION ? PERMISSION_STATUS_GRANTED : PERMISSION_STATUS_DENIED); return kNoPendingOperation; } void ShellPermissionManager::CancelPermissionRequest(int request_id) { } void ShellPermissionManager::ResetPermission( PermissionType permission, const GURL& requesting_origin, const GURL& embedding_origin) { } PermissionStatus ShellPermissionManager::GetPermissionStatus( PermissionType permission, const GURL& requesting_origin, const GURL& embedding_origin) { base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); if ((permission == PermissionType::AUDIO_CAPTURE || permission == PermissionType::VIDEO_CAPTURE) && command_line->HasSwitch(switches::kUseFakeDeviceForMediaStream) && command_line->HasSwitch(switches::kUseFakeUIForMediaStream)) { return PERMISSION_STATUS_GRANTED; } return PERMISSION_STATUS_DENIED; } void ShellPermissionManager::RegisterPermissionUsage( PermissionType permission, const GURL& requesting_origin, const GURL& embedding_origin) { } int ShellPermissionManager::SubscribePermissionStatusChange( PermissionType permission, const GURL& requesting_origin, const GURL& embedding_origin, const base::Callback& callback) { return kNoPendingOperation; } void ShellPermissionManager::UnsubscribePermissionStatusChange( int subscription_id) { } } // namespace content