Index: remoting/host/chromeos/aura_desktop_capturer.h |
diff --git a/remoting/host/chromeos/aura_desktop_capturer.h b/remoting/host/chromeos/aura_desktop_capturer.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..7aabda53be887cd95b11034d075a4682aed11a35 |
--- /dev/null |
+++ b/remoting/host/chromeos/aura_desktop_capturer.h |
@@ -0,0 +1,50 @@ |
+// 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. |
+ |
+#ifndef REMOTING_HOST_CHROMEOS_AURA_DESKTOP_CAPTURER_H_ |
+#define REMOTING_HOST_CHROMEOS_AURA_DESKTOP_CAPTURER_H_ |
+ |
+#include "base/memory/weak_ptr.h" |
+#include "third_party/webrtc/modules/desktop_capture/screen_capturer.h" |
+#include "ui/aura/window.h" |
sky
2014/09/11 21:22:47
nit: forward declare this.
kelvinp
2014/09/11 22:27:51
Done.
|
+ |
+namespace cc { |
+class CopyOutputResult; |
+} // namespace |
+ |
+namespace remoting { |
+ |
+// A webrtc::DesktopCapturer that captures pixels from the root window of the |
+// Aura Shell. This is implemented by requesting the layer and its substree to |
+// be rendered to a given data structure. Start() and Capture() must be called |
+// on the Browser UI thread. |
+class AuraDesktopCapturer : public webrtc::DesktopCapturer { |
+ public: |
+ AuraDesktopCapturer(); |
+ virtual ~AuraDesktopCapturer(); |
+ |
+ // webrtc::DesktopCapturer implementation. |
+ virtual void Start(webrtc::DesktopCapturer::Callback* callback) OVERRIDE; |
sky
2014/09/11 21:22:47
nit: IMO naming this Callback is very confusing gi
kelvinp
2014/09/11 22:27:51
I agree. However, renaming methods in the existin
|
+ virtual void Capture(const webrtc::DesktopRegion& region) OVERRIDE; |
+ |
+ private: |
+ friend class AuraDesktopCapturerTest; |
+ |
+ // Called when a copy of the layer is captured. |
+ void OnFrameCaptured(scoped_ptr<cc::CopyOutputResult> result); |
+ |
+ // Points to the callback passed to webrtc::DesktopCapturer::Start(). |
+ webrtc::DesktopCapturer::Callback* callback_; |
+ |
+ // The root window of the Aura Shell. |
+ aura::Window* desktop_window_; |
+ |
+ base::WeakPtrFactory<AuraDesktopCapturer> weak_factory_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(AuraDesktopCapturer); |
+}; |
+ |
+} // namespace remoting |
+ |
+#endif // REMOTING_HOST_CHROMEOS_AURA_DESKTOP_CAPTURER_H_ |