Add a FrameHostMsg_BeginNavigation IPC
[chromium-blink-merge.git] / content / browser / media / capture / desktop_capture_device.h
blob9fb8ca419fa7d82759e107864cfae6783cba20ce
1 // Copyright (c) 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_H_
6 #define CONTENT_BROWSER_MEDIA_CAPTURE_DESKTOP_CAPTURE_DEVICE_H_
8 #include "base/memory/ref_counted.h"
9 #include "base/memory/scoped_ptr.h"
10 #include "content/common/content_export.h"
11 #include "content/public/browser/desktop_media_id.h"
12 #include "media/video/capture/video_capture_device.h"
13 #include "ui/gfx/native_widget_types.h"
15 namespace base {
16 class SequencedTaskRunner;
17 class Thread;
18 } // namespace base
20 namespace webrtc {
21 class DesktopCapturer;
22 } // namespace webrtc
24 namespace content {
26 // DesktopCaptureDevice implements VideoCaptureDevice for screens and windows.
27 // It's essentially an adapter between webrtc::DesktopCapturer and
28 // VideoCaptureDevice.
29 class CONTENT_EXPORT DesktopCaptureDevice : public media::VideoCaptureDevice {
30 public:
31 // Creates capturer for the specified |source| and then creates
32 // DesktopCaptureDevice for it. May return NULL in case of a failure (e.g. if
33 // requested window was destroyed).
34 static scoped_ptr<media::VideoCaptureDevice> Create(
35 const DesktopMediaID& source);
37 virtual ~DesktopCaptureDevice();
39 // VideoCaptureDevice interface.
40 virtual void AllocateAndStart(const media::VideoCaptureParams& params,
41 scoped_ptr<Client> client) OVERRIDE;
42 virtual void StopAndDeAllocate() OVERRIDE;
44 // Set the platform-dependent window id for the notification window.
45 void SetNotificationWindowId(gfx::NativeViewId window_id);
47 private:
48 friend class DesktopCaptureDeviceTest;
49 class Core;
51 // Either |task_runner| or |thread| should be non-NULL, but not both.
52 DesktopCaptureDevice(scoped_refptr<base::SequencedTaskRunner> task_runner,
53 scoped_ptr<base::Thread> thread,
54 scoped_ptr<webrtc::DesktopCapturer> desktop_capturer,
55 DesktopMediaID::Type type);
57 scoped_refptr<Core> core_;
59 DISALLOW_COPY_AND_ASSIGN(DesktopCaptureDevice);
62 } // namespace content
64 #endif // CONTENT_BROWSER_MEDIA_CAPTURE_DESKTOP_CAPTURE_DEVICE_H_