Enable getUserMedia(). Part of fixes for #31.
This commit is contained in:
parent
354a1c555b
commit
f26db5c7a1
9 changed files with 390 additions and 0 deletions
46
browser/media/media_stream_devices_controller.h
Normal file
46
browser/media/media_stream_devices_controller.h
Normal file
|
@ -0,0 +1,46 @@
|
|||
// Copyright (c) 2013 GitHub, Inc. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#ifndef ATOM_BROWSER_MEDIA_MEDIA_STREAM_DEVICES_CONTROLLER_H_
|
||||
#define ATOM_BROWSER_MEDIA_MEDIA_STREAM_DEVICES_CONTROLLER_H_
|
||||
|
||||
#include "content/public/browser/web_contents_delegate.h"
|
||||
|
||||
namespace atom {
|
||||
|
||||
class MediaStreamDevicesController {
|
||||
public:
|
||||
MediaStreamDevicesController(const content::MediaStreamRequest& request,
|
||||
const content::MediaResponseCallback& callback);
|
||||
|
||||
virtual ~MediaStreamDevicesController();
|
||||
|
||||
// Public method to be called before creating the MediaStreamInfoBarDelegate.
|
||||
// This function will check the content settings exceptions and take the
|
||||
// corresponding action on exception which matches the request.
|
||||
bool TakeAction();
|
||||
|
||||
// Public methods to be called by MediaStreamInfoBarDelegate;
|
||||
bool has_audio() const { return microphone_requested_; }
|
||||
bool has_video() const { return webcam_requested_; }
|
||||
void Accept();
|
||||
void Deny();
|
||||
|
||||
private:
|
||||
// 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);
|
||||
};
|
||||
|
||||
} // namespace atom
|
||||
|
||||
#endif // ATOM_BROWSER_MEDIA_MEDIA_STREAM_DEVICES_CONTROLLER_H_
|
Loading…
Add table
Add a link
Reference in a new issue