Chromium Code Reviews| 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..6d01d016b7e60b4dc53f3d6b4493b0afbf394b75 |
| --- /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 "third_party/webrtc/modules/desktop_capture/screen_capturer.h" |
| +#include "ui/aura/window.h" |
| + |
| +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 |
|
Sergey Ulanov
2014/09/10 23:08:52
For function names add () at the end instead of |
|
| +// 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; |
| + virtual void SetExcludedWindow(webrtc::WindowId window) OVERRIDE; |
|
Sergey Ulanov
2014/09/10 23:08:52
There is a default no-op implementation of this me
|
| + |
| + 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_; |
|
Sergey Ulanov
2014/09/10 23:08:52
please include base/memory/weak_ptr.h
|
| + |
| + DISALLOW_COPY_AND_ASSIGN(AuraDesktopCapturer); |
| +}; |
| + |
| +} // namespace remoting |
| + |
| +#endif // REMOTING_HOST_CHROMEOS_AURA_DESKTOP_CAPTURER_H_ |