| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef REMOTING_HOST_MOUSE_CURSOR_MONITOR_PROXY_H_ | 5 #ifndef REMOTING_HOST_MOUSE_CURSOR_MONITOR_PROXY_H_ |
| 6 #define REMOTING_HOST_MOUSE_CURSOR_MONITOR_PROXY_H_ | 6 #define REMOTING_HOST_MOUSE_CURSOR_MONITOR_PROXY_H_ |
| 7 | 7 |
| 8 #include <memory> |
| 9 |
| 8 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| 9 #include "base/memory/scoped_ptr.h" | |
| 10 #include "base/memory/weak_ptr.h" | 11 #include "base/memory/weak_ptr.h" |
| 11 #include "base/threading/thread_checker.h" | 12 #include "base/threading/thread_checker.h" |
| 12 #include "third_party/webrtc/modules/desktop_capture/mouse_cursor_monitor.h" | 13 #include "third_party/webrtc/modules/desktop_capture/mouse_cursor_monitor.h" |
| 13 | 14 |
| 14 namespace base { | 15 namespace base { |
| 15 class SingleThreadTaskRunner; | 16 class SingleThreadTaskRunner; |
| 16 } // namespace base | 17 } // namespace base |
| 17 | 18 |
| 18 namespace remoting { | 19 namespace remoting { |
| 19 | 20 |
| 20 class MouseCursorMonitorProxy : public webrtc::MouseCursorMonitor { | 21 class MouseCursorMonitorProxy : public webrtc::MouseCursorMonitor { |
| 21 public: | 22 public: |
| 22 MouseCursorMonitorProxy( | 23 MouseCursorMonitorProxy( |
| 23 scoped_refptr<base::SingleThreadTaskRunner> capture_task_runner, | 24 scoped_refptr<base::SingleThreadTaskRunner> capture_task_runner, |
| 24 scoped_ptr<webrtc::MouseCursorMonitor> mouse_cursor_monitor); | 25 std::unique_ptr<webrtc::MouseCursorMonitor> mouse_cursor_monitor); |
| 25 ~MouseCursorMonitorProxy() override; | 26 ~MouseCursorMonitorProxy() override; |
| 26 | 27 |
| 27 // webrtc::MouseCursorMonitor interface. | 28 // webrtc::MouseCursorMonitor interface. |
| 28 void Init(Callback* callback, Mode mode) override; | 29 void Init(Callback* callback, Mode mode) override; |
| 29 void Capture() override; | 30 void Capture() override; |
| 30 | 31 |
| 31 private: | 32 private: |
| 32 class Core; | 33 class Core; |
| 33 | 34 |
| 34 void OnMouseCursor(scoped_ptr<webrtc::MouseCursor> cursor); | 35 void OnMouseCursor(std::unique_ptr<webrtc::MouseCursor> cursor); |
| 35 void OnMouseCursorPosition(CursorState state, | 36 void OnMouseCursorPosition(CursorState state, |
| 36 const webrtc::DesktopVector& position); | 37 const webrtc::DesktopVector& position); |
| 37 | 38 |
| 38 base::ThreadChecker thread_checker_; | 39 base::ThreadChecker thread_checker_; |
| 39 | 40 |
| 40 scoped_ptr<Core> core_; | 41 std::unique_ptr<Core> core_; |
| 41 scoped_refptr<base::SingleThreadTaskRunner> capture_task_runner_; | 42 scoped_refptr<base::SingleThreadTaskRunner> capture_task_runner_; |
| 42 Callback* callback_ = nullptr; | 43 Callback* callback_ = nullptr; |
| 43 | 44 |
| 44 base::WeakPtrFactory<MouseCursorMonitorProxy> weak_factory_; | 45 base::WeakPtrFactory<MouseCursorMonitorProxy> weak_factory_; |
| 45 | 46 |
| 46 DISALLOW_COPY_AND_ASSIGN(MouseCursorMonitorProxy); | 47 DISALLOW_COPY_AND_ASSIGN(MouseCursorMonitorProxy); |
| 47 }; | 48 }; |
| 48 | 49 |
| 49 } // namespace remoting | 50 } // namespace remoting |
| 50 | 51 |
| 51 #endif // REMOTING_HOST_MOUSE_CURSOR_MONITOR_PROXY_H_ | 52 #endif // REMOTING_HOST_MOUSE_CURSOR_MONITOR_PROXY_H_ |
| OLD | NEW |