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