This source file includes following definitions.
- RequestMediaAccessPermission
#include "chrome/browser/ui/media_utils.h"
#include "chrome/browser/extensions/extension_service.h"
#include "chrome/browser/media/media_capture_devices_dispatcher.h"
#include "chrome/browser/profiles/profile.h"
#include "extensions/browser/extension_system.h"
#include "extensions/common/constants.h"
class Profile;
namespace content {
class WebContents;
}
void RequestMediaAccessPermission(
content::WebContents* web_contents,
Profile* profile,
const content::MediaStreamRequest& request,
const content::MediaResponseCallback& callback) {
const extensions::Extension* extension = NULL;
GURL origin(request.security_origin);
if (origin.SchemeIs(extensions::kExtensionScheme)) {
ExtensionService* extensions_service =
extensions::ExtensionSystem::Get(profile)->extension_service();
extension = extensions_service->extensions()->GetByID(origin.host());
DCHECK(extension);
}
MediaCaptureDevicesDispatcher::GetInstance()->ProcessMediaAccessRequest(
web_contents, request, callback, extension);
}