media_stream_devices_controller.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. // Copyright (c) 2012 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE-CHROMIUM file.
  4. #ifndef BRIGHTRAY_BROWSER_MEDIA_MEDIA_STREAM_DEVICES_CONTROLLER_H_
  5. #define BRIGHTRAY_BROWSER_MEDIA_MEDIA_STREAM_DEVICES_CONTROLLER_H_
  6. #include "content/public/browser/web_contents_delegate.h"
  7. namespace brightray {
  8. class MediaStreamDevicesController {
  9. public:
  10. MediaStreamDevicesController(const content::MediaStreamRequest& request,
  11. const content::MediaResponseCallback& callback);
  12. virtual ~MediaStreamDevicesController();
  13. // Accept or deny the request based on the default policy.
  14. bool TakeAction();
  15. // Explicitly accept or deny the request.
  16. void Accept();
  17. void Deny(content::MediaStreamRequestResult result);
  18. private:
  19. // Handle the request of desktop or tab screen cast.
  20. void HandleUserMediaRequest();
  21. // The original request for access to devices.
  22. const content::MediaStreamRequest request_;
  23. // The callback that needs to be Run to notify WebRTC of whether access to
  24. // audio/video devices was granted or not.
  25. content::MediaResponseCallback callback_;
  26. bool microphone_requested_;
  27. bool webcam_requested_;
  28. DISALLOW_COPY_AND_ASSIGN(MediaStreamDevicesController);
  29. };
  30. } // namespace brightray
  31. #endif // BRIGHTRAY_BROWSER_MEDIA_MEDIA_STREAM_DEVICES_CONTROLLER_H_