Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(242)

Unified Diff: remoting/host/chromeos/aura_desktop_capturer.h

Issue 543243003: Remote Assistance on Chrome OS Part I - Aura Desktop Capturer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix Build bot failures on Official Chrome builds Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « remoting/host/DEPS ('k') | remoting/host/chromeos/aura_desktop_capturer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..a76abce2522a80609fc3738ac77ceba18295f384
--- /dev/null
+++ b/remoting/host/chromeos/aura_desktop_capturer.h
@@ -0,0 +1,53 @@
+// 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"
+
+namespace cc {
+class CopyOutputResult;
+} // namespace cc
+
+namespace aura {
+class Window;
+} // namespace aura
+
+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;
+ 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_
« no previous file with comments | « remoting/host/DEPS ('k') | remoting/host/chromeos/aura_desktop_capturer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698