| 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 #include "remoting/host/touch_injector_win.h" | 5 #include "remoting/host/touch_injector_win.h" |
| 6 | 6 |
| 7 #include "base/files/file_path.h" | 7 #include "base/files/file_path.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/native_library.h" | 9 #include "base/native_library.h" |
| 10 #include "remoting/proto/event.pb.h" | 10 #include "remoting/proto/event.pb.h" |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 182 CancelTouchPoints(event); | 182 CancelTouchPoints(event); |
| 183 break; | 183 break; |
| 184 default: | 184 default: |
| 185 NOTREACHED(); | 185 NOTREACHED(); |
| 186 return; | 186 return; |
| 187 } | 187 } |
| 188 } | 188 } |
| 189 | 189 |
| 190 void TouchInjectorWin::SetInjectorDelegateForTest( | 190 void TouchInjectorWin::SetInjectorDelegateForTest( |
| 191 scoped_ptr<TouchInjectorWinDelegate> functions) { | 191 scoped_ptr<TouchInjectorWinDelegate> functions) { |
| 192 delegate_ = functions.Pass(); | 192 delegate_ = std::move(functions); |
| 193 } | 193 } |
| 194 | 194 |
| 195 void TouchInjectorWin::AddNewTouchPoints(const TouchEvent& event) { | 195 void TouchInjectorWin::AddNewTouchPoints(const TouchEvent& event) { |
| 196 DCHECK_EQ(event.event_type(), TouchEvent::TOUCH_POINT_START); | 196 DCHECK_EQ(event.event_type(), TouchEvent::TOUCH_POINT_START); |
| 197 | 197 |
| 198 std::vector<POINTER_TOUCH_INFO> touches; | 198 std::vector<POINTER_TOUCH_INFO> touches; |
| 199 // Must inject already touching points as move events. | 199 // Must inject already touching points as move events. |
| 200 AppendMapValuesToVector(&touches_in_contact_, &touches); | 200 AppendMapValuesToVector(&touches_in_contact_, &touches); |
| 201 | 201 |
| 202 for (const TouchEventPoint& touch_point : event.touch_points()) { | 202 for (const TouchEventPoint& touch_point : event.touch_points()) { |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 271 touches.push_back(pointer_touch_info); | 271 touches.push_back(pointer_touch_info); |
| 272 } | 272 } |
| 273 | 273 |
| 274 AppendMapValuesToVector(&touches_in_contact_, &touches); | 274 AppendMapValuesToVector(&touches_in_contact_, &touches); |
| 275 if (delegate_->InjectTouchInput(touches.size(), touches.data()) == 0) { | 275 if (delegate_->InjectTouchInput(touches.size(), touches.data()) == 0) { |
| 276 PLOG(ERROR) << "Failed to inject a touch cancel event."; | 276 PLOG(ERROR) << "Failed to inject a touch cancel event."; |
| 277 } | 277 } |
| 278 } | 278 } |
| 279 | 279 |
| 280 } // namespace remoting | 280 } // namespace remoting |
| OLD | NEW |