| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_SHAPE_PUMP_H_ | 5 #ifndef REMOTING_HOST_MOUSE_SHAPE_PUMP_H_ |
| 6 #define REMOTING_HOST_MOUSE_SHAPE_PUMP_H_ | 6 #define REMOTING_HOST_MOUSE_SHAPE_PUMP_H_ |
| 7 | 7 |
| 8 #include <memory> |
| 9 |
| 8 #include "base/macros.h" | 10 #include "base/macros.h" |
| 9 #include "base/memory/scoped_ptr.h" | |
| 10 #include "base/threading/thread_checker.h" | 11 #include "base/threading/thread_checker.h" |
| 11 #include "base/timer/timer.h" | 12 #include "base/timer/timer.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 remoting { | 15 namespace remoting { |
| 15 | 16 |
| 16 namespace protocol { | 17 namespace protocol { |
| 17 class CursorShapeStub; | 18 class CursorShapeStub; |
| 18 } // namespace | 19 } // namespace |
| 19 | 20 |
| 20 // MouseShapePump is responsible for capturing mouse shape using | 21 // MouseShapePump is responsible for capturing mouse shape using |
| 21 // MouseCursorMonitor and sending it to a CursorShapeStub. | 22 // MouseCursorMonitor and sending it to a CursorShapeStub. |
| 22 class MouseShapePump : public webrtc::MouseCursorMonitor::Callback { | 23 class MouseShapePump : public webrtc::MouseCursorMonitor::Callback { |
| 23 public: | 24 public: |
| 24 MouseShapePump(scoped_ptr<webrtc::MouseCursorMonitor> mouse_cursor_monitor, | 25 MouseShapePump( |
| 25 protocol::CursorShapeStub* cursor_shape_stub); | 26 std::unique_ptr<webrtc::MouseCursorMonitor> mouse_cursor_monitor, |
| 27 protocol::CursorShapeStub* cursor_shape_stub); |
| 26 ~MouseShapePump() override; | 28 ~MouseShapePump() override; |
| 27 | 29 |
| 28 private: | 30 private: |
| 29 void Capture(); | 31 void Capture(); |
| 30 | 32 |
| 31 // webrtc::MouseCursorMonitor::Callback implementation. | 33 // webrtc::MouseCursorMonitor::Callback implementation. |
| 32 void OnMouseCursor(webrtc::MouseCursor* mouse_cursor) override; | 34 void OnMouseCursor(webrtc::MouseCursor* mouse_cursor) override; |
| 33 void OnMouseCursorPosition(webrtc::MouseCursorMonitor::CursorState state, | 35 void OnMouseCursorPosition(webrtc::MouseCursorMonitor::CursorState state, |
| 34 const webrtc::DesktopVector& position) override; | 36 const webrtc::DesktopVector& position) override; |
| 35 | 37 |
| 36 base::ThreadChecker thread_checker_; | 38 base::ThreadChecker thread_checker_; |
| 37 scoped_ptr<webrtc::MouseCursorMonitor> mouse_cursor_monitor_; | 39 std::unique_ptr<webrtc::MouseCursorMonitor> mouse_cursor_monitor_; |
| 38 protocol::CursorShapeStub* cursor_shape_stub_; | 40 protocol::CursorShapeStub* cursor_shape_stub_; |
| 39 | 41 |
| 40 base::Timer capture_timer_; | 42 base::Timer capture_timer_; |
| 41 | 43 |
| 42 DISALLOW_COPY_AND_ASSIGN(MouseShapePump); | 44 DISALLOW_COPY_AND_ASSIGN(MouseShapePump); |
| 43 }; | 45 }; |
| 44 | 46 |
| 45 } // namespace remoting | 47 } // namespace remoting |
| 46 | 48 |
| 47 #endif // REMOTING_HOST_MOUSE_SHAPE_PUMP_H_ | 49 #endif // REMOTING_HOST_MOUSE_SHAPE_PUMP_H_ |
| OLD | NEW |