| 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 "base/mac/foundation_util.h" | 10 #include "base/mac/foundation_util.h" |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 CGWindowID window_id_; | 41 CGWindowID window_id_; |
| 42 scoped_ptr<InputInjector> input_injector_; | 42 scoped_ptr<InputInjector> input_injector_; |
| 43 | 43 |
| 44 DISALLOW_COPY_AND_ASSIGN(SingleWindowInputInjectorMac); | 44 DISALLOW_COPY_AND_ASSIGN(SingleWindowInputInjectorMac); |
| 45 }; | 45 }; |
| 46 | 46 |
| 47 SingleWindowInputInjectorMac::SingleWindowInputInjectorMac( | 47 SingleWindowInputInjectorMac::SingleWindowInputInjectorMac( |
| 48 webrtc::WindowId window_id, | 48 webrtc::WindowId window_id, |
| 49 scoped_ptr<InputInjector> input_injector) | 49 scoped_ptr<InputInjector> input_injector) |
| 50 : window_id_(static_cast<CGWindowID>(window_id)), | 50 : window_id_(static_cast<CGWindowID>(window_id)), |
| 51 input_injector_(input_injector.Pass()) { | 51 input_injector_(std::move(input_injector)) {} |
| 52 } | |
| 53 | 52 |
| 54 SingleWindowInputInjectorMac::~SingleWindowInputInjectorMac() { | 53 SingleWindowInputInjectorMac::~SingleWindowInputInjectorMac() {} |
| 55 } | |
| 56 | 54 |
| 57 void SingleWindowInputInjectorMac::Start( | 55 void SingleWindowInputInjectorMac::Start( |
| 58 scoped_ptr<protocol::ClipboardStub> client_clipboard) { | 56 scoped_ptr<protocol::ClipboardStub> client_clipboard) { |
| 59 input_injector_->Start(client_clipboard.Pass()); | 57 input_injector_->Start(std::move(client_clipboard)); |
| 60 } | 58 } |
| 61 | 59 |
| 62 void SingleWindowInputInjectorMac::InjectKeyEvent(const KeyEvent& event) { | 60 void SingleWindowInputInjectorMac::InjectKeyEvent(const KeyEvent& event) { |
| 63 input_injector_->InjectKeyEvent(event); | 61 input_injector_->InjectKeyEvent(event); |
| 64 } | 62 } |
| 65 | 63 |
| 66 void SingleWindowInputInjectorMac::InjectTextEvent(const TextEvent& event) { | 64 void SingleWindowInputInjectorMac::InjectTextEvent(const TextEvent& event) { |
| 67 input_injector_->InjectTextEvent(event); | 65 input_injector_->InjectTextEvent(event); |
| 68 } | 66 } |
| 69 | 67 |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 } | 154 } |
| 157 } | 155 } |
| 158 } | 156 } |
| 159 | 157 |
| 160 return CGRectNull; | 158 return CGRectNull; |
| 161 } | 159 } |
| 162 | 160 |
| 163 scoped_ptr<InputInjector> SingleWindowInputInjector::CreateForWindow( | 161 scoped_ptr<InputInjector> SingleWindowInputInjector::CreateForWindow( |
| 164 webrtc::WindowId window_id, | 162 webrtc::WindowId window_id, |
| 165 scoped_ptr<InputInjector> input_injector) { | 163 scoped_ptr<InputInjector> input_injector) { |
| 166 scoped_ptr<SingleWindowInputInjectorMac> injector( | 164 return make_scoped_ptr( |
| 167 new SingleWindowInputInjectorMac(window_id, input_injector.Pass())); | 165 new SingleWindowInputInjectorMac(window_id, std::move(input_injector))); |
| 168 return injector.Pass(); | |
| 169 } | 166 } |
| 170 | 167 |
| 171 } // namespace remoting | 168 } // namespace remoting |
| OLD | NEW |