Roll src/third_party/WebKit d9c6159:8139f33 (svn 201974:201975)
[chromium-blink-merge.git] / content / browser / media / capture / desktop_capture_device_aura.h
blobc2959234793e38f135dc00387108d14c648c7da0
1 // Copyright 2013 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 file.
5 #ifndef CONTENT_BROWSER_MEDIA_CAPTURE_DESKTOP_CAPTURE_DEVICE_AURA_H_
6 #define CONTENT_BROWSER_MEDIA_CAPTURE_DESKTOP_CAPTURE_DEVICE_AURA_H_
8 #include <string>
10 #include "base/memory/scoped_ptr.h"
11 #include "content/common/content_export.h"
12 #include "content/public/browser/desktop_media_id.h"
13 #include "media/capture/content/screen_capture_device_core.h"
14 #include "media/capture/video/video_capture_device.h"
16 namespace aura {
17 class Window;
18 } // namespace aura
20 namespace content {
22 // An implementation of VideoCaptureDevice that mirrors an Aura window.
23 class CONTENT_EXPORT DesktopCaptureDeviceAura
24 : public media::VideoCaptureDevice {
25 public:
26 // Creates a VideoCaptureDevice for the Aura desktop. If |source| does not
27 // reference a registered aura window, returns nullptr instead.
28 static scoped_ptr<media::VideoCaptureDevice> Create(
29 const DesktopMediaID& source);
31 ~DesktopCaptureDeviceAura() override;
33 // VideoCaptureDevice implementation.
34 void AllocateAndStart(const media::VideoCaptureParams& params,
35 scoped_ptr<Client> client) override;
36 void StopAndDeAllocate() override;
38 private:
39 explicit DesktopCaptureDeviceAura(const DesktopMediaID& source);
41 scoped_ptr<media::ScreenCaptureDeviceCore> core_;
43 DISALLOW_COPY_AND_ASSIGN(DesktopCaptureDeviceAura);
47 } // namespace content
49 #endif // CONTENT_BROWSER_MEDIA_CAPTURE_DESKTOP_CAPTURE_DEVICE_AURA_H_