OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_LOCAL_INPUT_MONITOR_H_ | 5 #ifndef REMOTING_HOST_LOCAL_INPUT_MONITOR_H_ |
6 #define REMOTING_HOST_LOCAL_INPUT_MONITOR_H_ | 6 #define REMOTING_HOST_LOCAL_INPUT_MONITOR_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 | 12 |
12 namespace base { | 13 namespace base { |
13 class SingleThreadTaskRunner; | 14 class SingleThreadTaskRunner; |
14 } // namespace base | 15 } // namespace base |
15 | 16 |
16 namespace remoting { | 17 namespace remoting { |
17 | 18 |
18 class ClientSessionControl; | 19 class ClientSessionControl; |
19 | 20 |
20 // Monitors the local input to notify about mouse movements. On Mac and Linux | 21 // Monitors the local input to notify about mouse movements. On Mac and Linux |
21 // catches the disconnection keyboard shortcut (Ctlr-Alt-Esc) and invokes | 22 // catches the disconnection keyboard shortcut (Ctlr-Alt-Esc) and invokes |
22 // SessionController::Delegate::DisconnectSession() when this key combination is | 23 // SessionController::Delegate::DisconnectSession() when this key combination is |
23 // pressed. | 24 // pressed. |
24 // | 25 // |
25 // TODO(sergeyu): Refactor shortcut code to a separate class. | 26 // TODO(sergeyu): Refactor shortcut code to a separate class. |
26 class LocalInputMonitor { | 27 class LocalInputMonitor { |
27 public: | 28 public: |
28 virtual ~LocalInputMonitor() {} | 29 virtual ~LocalInputMonitor() {} |
29 | 30 |
30 // Creates a platform-specific instance of LocalInputMonitor. | 31 // Creates a platform-specific instance of LocalInputMonitor. |
31 // |client_session_control| is called on the |caller_task_runner| thread. | 32 // |client_session_control| is called on the |caller_task_runner| thread. |
32 static scoped_ptr<LocalInputMonitor> Create( | 33 static std::unique_ptr<LocalInputMonitor> Create( |
33 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner, | 34 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner, |
34 scoped_refptr<base::SingleThreadTaskRunner> input_task_runner, | 35 scoped_refptr<base::SingleThreadTaskRunner> input_task_runner, |
35 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner, | 36 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner, |
36 base::WeakPtr<ClientSessionControl> client_session_control); | 37 base::WeakPtr<ClientSessionControl> client_session_control); |
37 | 38 |
38 protected: | 39 protected: |
39 LocalInputMonitor() {} | 40 LocalInputMonitor() {} |
40 }; | 41 }; |
41 | 42 |
42 } // namespace remoting | 43 } // namespace remoting |
43 | 44 |
44 #endif // REMOTING_HOST_LOCAL_INPUT_MONITOR_H_ | 45 #endif // REMOTING_HOST_LOCAL_INPUT_MONITOR_H_ |
OLD | NEW |