OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 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_IPC_MOUSE_CURSOR_MONITOR_H_ | 5 #ifndef REMOTING_HOST_IPC_MOUSE_CURSOR_MONITOR_H_ |
6 #define REMOTING_HOST_IPC_MOUSE_CURSOR_MONITOR_H_ | 6 #define REMOTING_HOST_IPC_MOUSE_CURSOR_MONITOR_H_ |
7 | 7 |
| 8 #include <memory> |
| 9 |
8 #include "base/macros.h" | 10 #include "base/macros.h" |
9 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
10 #include "base/memory/scoped_ptr.h" | |
11 #include "base/memory/weak_ptr.h" | 12 #include "base/memory/weak_ptr.h" |
12 #include "third_party/webrtc/modules/desktop_capture/desktop_frame.h" | 13 #include "third_party/webrtc/modules/desktop_capture/desktop_frame.h" |
13 #include "third_party/webrtc/modules/desktop_capture/mouse_cursor_monitor.h" | 14 #include "third_party/webrtc/modules/desktop_capture/mouse_cursor_monitor.h" |
14 | 15 |
15 namespace remoting { | 16 namespace remoting { |
16 | 17 |
17 class DesktopSessionProxy; | 18 class DesktopSessionProxy; |
18 | 19 |
19 // Routes webrtc::MouseCursorMonitor calls through the IPC channel to the | 20 // Routes webrtc::MouseCursorMonitor calls through the IPC channel to the |
20 // desktop session agent running in the desktop integration process. | 21 // desktop session agent running in the desktop integration process. |
21 class IpcMouseCursorMonitor : public webrtc::MouseCursorMonitor { | 22 class IpcMouseCursorMonitor : public webrtc::MouseCursorMonitor { |
22 public: | 23 public: |
23 explicit IpcMouseCursorMonitor( | 24 explicit IpcMouseCursorMonitor( |
24 scoped_refptr<DesktopSessionProxy> desktop_session_proxy); | 25 scoped_refptr<DesktopSessionProxy> desktop_session_proxy); |
25 ~IpcMouseCursorMonitor() override; | 26 ~IpcMouseCursorMonitor() 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 // Called when the cursor shape has changed. | 32 // Called when the cursor shape has changed. |
32 void OnMouseCursor(scoped_ptr<webrtc::MouseCursor> cursor); | 33 void OnMouseCursor(std::unique_ptr<webrtc::MouseCursor> cursor); |
33 | 34 |
34 private: | 35 private: |
35 // The callback passed to |webrtc::MouseCursorMonitor::Init()|. | 36 // The callback passed to |webrtc::MouseCursorMonitor::Init()|. |
36 webrtc::MouseCursorMonitor::Callback* callback_; | 37 webrtc::MouseCursorMonitor::Callback* callback_; |
37 | 38 |
38 // Wraps the IPC channel to the desktop session agent. | 39 // Wraps the IPC channel to the desktop session agent. |
39 scoped_refptr<DesktopSessionProxy> desktop_session_proxy_; | 40 scoped_refptr<DesktopSessionProxy> desktop_session_proxy_; |
40 | 41 |
41 // Used to cancel tasks pending on the capturer when it is stopped. | 42 // Used to cancel tasks pending on the capturer when it is stopped. |
42 base::WeakPtrFactory<IpcMouseCursorMonitor> weak_factory_; | 43 base::WeakPtrFactory<IpcMouseCursorMonitor> weak_factory_; |
43 | 44 |
44 DISALLOW_COPY_AND_ASSIGN(IpcMouseCursorMonitor); | 45 DISALLOW_COPY_AND_ASSIGN(IpcMouseCursorMonitor); |
45 }; | 46 }; |
46 | 47 |
47 } // namespace remoting | 48 } // namespace remoting |
48 | 49 |
49 #endif // REMOTING_HOST_IPC_MOUSE_CURSOR_MONITOR_H_ | 50 #endif // REMOTING_HOST_IPC_MOUSE_CURSOR_MONITOR_H_ |
OLD | NEW |