Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2014 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. | |
| 4 | |
| 5 #ifndef REMOTING_HOST_CHROMEOS_AURA_DESKTOP_CAPTURER_H_ | |
| 6 #define REMOTING_HOST_CHROMEOS_AURA_DESKTOP_CAPTURER_H_ | |
| 7 | |
| 8 #include "base/memory/weak_ptr.h" | |
| 9 #include "third_party/webrtc/modules/desktop_capture/screen_capturer.h" | |
| 10 #include "ui/aura/window.h" | |
|
sky
2014/09/11 21:22:47
nit: forward declare this.
kelvinp
2014/09/11 22:27:51
Done.
| |
| 11 | |
| 12 namespace cc { | |
| 13 class CopyOutputResult; | |
| 14 } // namespace | |
| 15 | |
| 16 namespace remoting { | |
| 17 | |
| 18 // A webrtc::DesktopCapturer that captures pixels from the root window of the | |
| 19 // Aura Shell. This is implemented by requesting the layer and its substree to | |
| 20 // be rendered to a given data structure. Start() and Capture() must be called | |
| 21 // on the Browser UI thread. | |
| 22 class AuraDesktopCapturer : public webrtc::DesktopCapturer { | |
| 23 public: | |
| 24 AuraDesktopCapturer(); | |
| 25 virtual ~AuraDesktopCapturer(); | |
| 26 | |
| 27 // webrtc::DesktopCapturer implementation. | |
| 28 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
| |
| 29 virtual void Capture(const webrtc::DesktopRegion& region) OVERRIDE; | |
| 30 | |
| 31 private: | |
| 32 friend class AuraDesktopCapturerTest; | |
| 33 | |
| 34 // Called when a copy of the layer is captured. | |
| 35 void OnFrameCaptured(scoped_ptr<cc::CopyOutputResult> result); | |
| 36 | |
| 37 // Points to the callback passed to webrtc::DesktopCapturer::Start(). | |
| 38 webrtc::DesktopCapturer::Callback* callback_; | |
| 39 | |
| 40 // The root window of the Aura Shell. | |
| 41 aura::Window* desktop_window_; | |
| 42 | |
| 43 base::WeakPtrFactory<AuraDesktopCapturer> weak_factory_; | |
| 44 | |
| 45 DISALLOW_COPY_AND_ASSIGN(AuraDesktopCapturer); | |
| 46 }; | |
| 47 | |
| 48 } // namespace remoting | |
| 49 | |
| 50 #endif // REMOTING_HOST_CHROMEOS_AURA_DESKTOP_CAPTURER_H_ | |
| OLD | NEW |