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 #include "remoting/host/local_input_monitor.h" | 5 #include "remoting/host/local_input_monitor.h" |
6 | 6 |
7 #import <AppKit/AppKit.h> | 7 #import <AppKit/AppKit.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 |
9 #include <set> | 10 #include <set> |
10 | 11 |
11 #include "base/bind.h" | 12 #include "base/bind.h" |
12 #include "base/compiler_specific.h" | 13 #include "base/compiler_specific.h" |
13 #include "base/location.h" | 14 #include "base/location.h" |
14 #include "base/logging.h" | 15 #include "base/logging.h" |
15 #include "base/mac/scoped_cftyperef.h" | 16 #include "base/mac/scoped_cftyperef.h" |
16 #include "base/macros.h" | 17 #include "base/macros.h" |
| 18 #include "base/memory/ptr_util.h" |
17 #include "base/memory/ref_counted.h" | 19 #include "base/memory/ref_counted.h" |
18 #include "base/single_thread_task_runner.h" | 20 #include "base/single_thread_task_runner.h" |
19 #include "base/synchronization/lock.h" | 21 #include "base/synchronization/lock.h" |
20 #include "base/threading/non_thread_safe.h" | 22 #include "base/threading/non_thread_safe.h" |
21 #include "remoting/host/client_session_control.h" | 23 #include "remoting/host/client_session_control.h" |
22 #import "third_party/google_toolbox_for_mac/src/AppKit/GTMCarbonEvent.h" | 24 #import "third_party/google_toolbox_for_mac/src/AppKit/GTMCarbonEvent.h" |
23 #include "third_party/webrtc/modules/desktop_capture/desktop_geometry.h" | 25 #include "third_party/webrtc/modules/desktop_capture/desktop_geometry.h" |
24 | 26 |
25 // Esc Key Code is 53. | 27 // Esc Key Code is 53. |
26 // http://boredzo.org/blog/wp-content/uploads/2007/05/IMTx-virtual-keycodes.pdf | 28 // http://boredzo.org/blog/wp-content/uploads/2007/05/IMTx-virtual-keycodes.pdf |
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
270 } | 272 } |
271 | 273 |
272 void LocalInputMonitorMac::Core::OnDisconnectShortcut() { | 274 void LocalInputMonitorMac::Core::OnDisconnectShortcut() { |
273 caller_task_runner_->PostTask( | 275 caller_task_runner_->PostTask( |
274 FROM_HERE, base::Bind(&ClientSessionControl::DisconnectSession, | 276 FROM_HERE, base::Bind(&ClientSessionControl::DisconnectSession, |
275 client_session_control_, protocol::OK)); | 277 client_session_control_, protocol::OK)); |
276 } | 278 } |
277 | 279 |
278 } // namespace | 280 } // namespace |
279 | 281 |
280 scoped_ptr<LocalInputMonitor> LocalInputMonitor::Create( | 282 std::unique_ptr<LocalInputMonitor> LocalInputMonitor::Create( |
281 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner, | 283 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner, |
282 scoped_refptr<base::SingleThreadTaskRunner> input_task_runner, | 284 scoped_refptr<base::SingleThreadTaskRunner> input_task_runner, |
283 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner, | 285 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner, |
284 base::WeakPtr<ClientSessionControl> client_session_control) { | 286 base::WeakPtr<ClientSessionControl> client_session_control) { |
285 return make_scoped_ptr(new LocalInputMonitorMac( | 287 return base::WrapUnique(new LocalInputMonitorMac( |
286 caller_task_runner, ui_task_runner, client_session_control)); | 288 caller_task_runner, ui_task_runner, client_session_control)); |
287 } | 289 } |
288 | 290 |
289 } // namespace remoting | 291 } // namespace remoting |
OLD | NEW |