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 #include "remoting/host/single_window_input_injector.h" | 5 #include "remoting/host/single_window_input_injector.h" |
6 | 6 |
7 #include <ApplicationServices/ApplicationServices.h> | 7 #include <ApplicationServices/ApplicationServices.h> |
8 #include <Carbon/Carbon.h> | 8 #include <Carbon/Carbon.h> |
9 | 9 |
| 10 #include <utility> |
| 11 |
10 #include "base/mac/foundation_util.h" | 12 #include "base/mac/foundation_util.h" |
11 #include "base/mac/scoped_cftyperef.h" | 13 #include "base/mac/scoped_cftyperef.h" |
12 #include "base/macros.h" | 14 #include "base/macros.h" |
13 #include "remoting/proto/event.pb.h" | 15 #include "remoting/proto/event.pb.h" |
14 #include "third_party/webrtc/modules/desktop_capture/mac/desktop_configuration.h
" | 16 #include "third_party/webrtc/modules/desktop_capture/mac/desktop_configuration.h
" |
15 | 17 |
16 namespace remoting { | 18 namespace remoting { |
17 | 19 |
18 using protocol::ClipboardEvent; | 20 using protocol::ClipboardEvent; |
19 using protocol::KeyEvent; | 21 using protocol::KeyEvent; |
(...skipping 22 matching lines...) Expand all Loading... |
42 CGWindowID window_id_; | 44 CGWindowID window_id_; |
43 scoped_ptr<InputInjector> input_injector_; | 45 scoped_ptr<InputInjector> input_injector_; |
44 | 46 |
45 DISALLOW_COPY_AND_ASSIGN(SingleWindowInputInjectorMac); | 47 DISALLOW_COPY_AND_ASSIGN(SingleWindowInputInjectorMac); |
46 }; | 48 }; |
47 | 49 |
48 SingleWindowInputInjectorMac::SingleWindowInputInjectorMac( | 50 SingleWindowInputInjectorMac::SingleWindowInputInjectorMac( |
49 webrtc::WindowId window_id, | 51 webrtc::WindowId window_id, |
50 scoped_ptr<InputInjector> input_injector) | 52 scoped_ptr<InputInjector> input_injector) |
51 : window_id_(static_cast<CGWindowID>(window_id)), | 53 : window_id_(static_cast<CGWindowID>(window_id)), |
52 input_injector_(input_injector.Pass()) { | 54 input_injector_(std::move(input_injector)) {} |
53 } | |
54 | 55 |
55 SingleWindowInputInjectorMac::~SingleWindowInputInjectorMac() { | 56 SingleWindowInputInjectorMac::~SingleWindowInputInjectorMac() {} |
56 } | |
57 | 57 |
58 void SingleWindowInputInjectorMac::Start( | 58 void SingleWindowInputInjectorMac::Start( |
59 scoped_ptr<protocol::ClipboardStub> client_clipboard) { | 59 scoped_ptr<protocol::ClipboardStub> client_clipboard) { |
60 input_injector_->Start(client_clipboard.Pass()); | 60 input_injector_->Start(std::move(client_clipboard)); |
61 } | 61 } |
62 | 62 |
63 void SingleWindowInputInjectorMac::InjectKeyEvent(const KeyEvent& event) { | 63 void SingleWindowInputInjectorMac::InjectKeyEvent(const KeyEvent& event) { |
64 input_injector_->InjectKeyEvent(event); | 64 input_injector_->InjectKeyEvent(event); |
65 } | 65 } |
66 | 66 |
67 void SingleWindowInputInjectorMac::InjectTextEvent(const TextEvent& event) { | 67 void SingleWindowInputInjectorMac::InjectTextEvent(const TextEvent& event) { |
68 input_injector_->InjectTextEvent(event); | 68 input_injector_->InjectTextEvent(event); |
69 } | 69 } |
70 | 70 |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 } | 157 } |
158 } | 158 } |
159 } | 159 } |
160 | 160 |
161 return CGRectNull; | 161 return CGRectNull; |
162 } | 162 } |
163 | 163 |
164 scoped_ptr<InputInjector> SingleWindowInputInjector::CreateForWindow( | 164 scoped_ptr<InputInjector> SingleWindowInputInjector::CreateForWindow( |
165 webrtc::WindowId window_id, | 165 webrtc::WindowId window_id, |
166 scoped_ptr<InputInjector> input_injector) { | 166 scoped_ptr<InputInjector> input_injector) { |
167 scoped_ptr<SingleWindowInputInjectorMac> injector( | 167 return make_scoped_ptr( |
168 new SingleWindowInputInjectorMac(window_id, input_injector.Pass())); | 168 new SingleWindowInputInjectorMac(window_id, std::move(input_injector))); |
169 return injector.Pass(); | |
170 } | 169 } |
171 | 170 |
172 } // namespace remoting | 171 } // namespace remoting |
OLD | NEW |