2013-07-31 18:08:45 +00:00
|
|
|
// Copyright (c) 2012 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-CHROMIUM file.
|
|
|
|
|
|
|
|
#ifndef BRIGHTRAY_BROWSER_MEDIA_MEDIA_STREAM_DEVICES_CONTROLLER_H_
|
|
|
|
#define BRIGHTRAY_BROWSER_MEDIA_MEDIA_STREAM_DEVICES_CONTROLLER_H_
|
|
|
|
|
2013-10-07 20:13:01 +00:00
|
|
|
#include <string>
|
|
|
|
|
2013-07-31 18:08:45 +00:00
|
|
|
#include "content/public/browser/web_contents_delegate.h"
|
|
|
|
|
|
|
|
namespace brightray {
|
|
|
|
|
|
|
|
class MediaStreamDevicesController {
|
|
|
|
public:
|
|
|
|
MediaStreamDevicesController(const content::MediaStreamRequest& request,
|
|
|
|
const content::MediaResponseCallback& callback);
|
|
|
|
|
|
|
|
virtual ~MediaStreamDevicesController();
|
|
|
|
|
2013-10-07 21:04:22 +00:00
|
|
|
// Accept or deny the request based on the default policy.
|
2013-07-31 18:08:45 +00:00
|
|
|
bool TakeAction();
|
|
|
|
|
2013-10-07 21:04:22 +00:00
|
|
|
// Explicitly accept or deny the request.
|
2013-07-31 18:08:45 +00:00
|
|
|
void Accept();
|
2015-03-09 03:04:25 +00:00
|
|
|
void Deny(content::MediaStreamRequestResult result);
|
2013-07-31 18:08:45 +00:00
|
|
|
|
2013-10-07 21:04:22 +00:00
|
|
|
private:
|
2014-10-01 03:07:29 +00:00
|
|
|
// Handle the request of desktop or tab screen cast.
|
|
|
|
void HandleUserMediaRequest();
|
|
|
|
|
2013-07-31 18:08:45 +00:00
|
|
|
// The original request for access to devices.
|
|
|
|
const content::MediaStreamRequest request_;
|
|
|
|
|
|
|
|
// The callback that needs to be Run to notify WebRTC of whether access to
|
|
|
|
// audio/video devices was granted or not.
|
|
|
|
content::MediaResponseCallback callback_;
|
|
|
|
|
|
|
|
bool microphone_requested_;
|
|
|
|
bool webcam_requested_;
|
|
|
|
|
|
|
|
DISALLOW_COPY_AND_ASSIGN(MediaStreamDevicesController);
|
|
|
|
};
|
|
|
|
|
2013-11-17 23:56:07 +00:00
|
|
|
} // namespace brightray
|
2013-07-31 18:08:45 +00:00
|
|
|
|
|
|
|
#endif // BRIGHTRAY_BROWSER_MEDIA_MEDIA_STREAM_DEVICES_CONTROLLER_H_
|