Index: remoting/host/window_capturer_screen_wrapper.h |
diff --git a/remoting/host/window_capturer_screen_wrapper.h b/remoting/host/window_capturer_screen_wrapper.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..c76e31f7b148d1417205a114ff739f73bd102f3e |
--- /dev/null |
+++ b/remoting/host/window_capturer_screen_wrapper.h |
@@ -0,0 +1,42 @@ |
+// Copyright 2014 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 file. |
+ |
+#include "base/memory/scoped_ptr.h" |
+#include "third_party/webrtc/modules/desktop_capture/desktop_capture_options.h" |
+#include "third_party/webrtc/modules/desktop_capture/screen_capturer.h" |
+ |
+namespace webrtc { |
+class WindowCapturer; |
+} |
+ |
+namespace remoting { |
+ |
+// This class wraps a WindowCapturer instance. The reason we do this |
+// is becaues the remoting_me2me_host uses a screen capturer interface. |
+// Instead of adding support for a window_capturer_interface, which |
+// is not really needed, we simply wrap a WindowCapturer inside of a |
+// ScreenCapturer and delegate messages sent to this class to the |
+// wrapped WindowCapturer. |
+class WindowCapturerScreenWrapper : public webrtc::ScreenCapturer { |
+ public: |
+ WindowCapturerScreenWrapper( |
+ scoped_ptr<webrtc::WindowCapturer> window_capturer); |
+ virtual ~WindowCapturerScreenWrapper(); |
+ |
+ // webrtc::ScreenCapturer interface. |
+ virtual void Start(DesktopCapturer::Callback* callback) OVERRIDE; |
+ virtual void Capture(const webrtc::DesktopRegion& region) OVERRIDE; |
+ virtual void SetMouseShapeObserver( |
+ MouseShapeObserver* mouse_shape_observer) OVERRIDE; |
+ virtual bool GetScreenList(ScreenList* screens) OVERRIDE; |
+ virtual bool SelectScreen(webrtc::ScreenId id) OVERRIDE; |
+ |
+ private: |
+ scoped_ptr<webrtc::WindowCapturer> window_capturer_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(WindowCapturerScreenWrapper); |
+}; |
+ |
+ |
+} // namespace remoting |