| 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/local_input_monitor.h" | 5 #include "remoting/host/local_input_monitor.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "base/location.h" | 9 #include "base/location.h" |
| 10 #include "base/single_thread_task_runner.h" | 10 #include "base/single_thread_task_runner.h" |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 ui::EventType type = ui::EventTypeFromNative(event); | 108 ui::EventType type = ui::EventTypeFromNative(event); |
| 109 if (type == ui::ET_MOUSE_MOVED) { | 109 if (type == ui::ET_MOUSE_MOVED) { |
| 110 HandleMouseMove(event); | 110 HandleMouseMove(event); |
| 111 } else if (type == ui::ET_KEY_PRESSED) { | 111 } else if (type == ui::ET_KEY_PRESSED) { |
| 112 HandleKeyPressed(event); | 112 HandleKeyPressed(event); |
| 113 } | 113 } |
| 114 } | 114 } |
| 115 | 115 |
| 116 void LocalInputMonitorChromeos::Core::HandleMouseMove( | 116 void LocalInputMonitorChromeos::Core::HandleMouseMove( |
| 117 const ui::PlatformEvent& event) { | 117 const ui::PlatformEvent& event) { |
| 118 gfx::PointF mouse_position = ui::EventLocationFromNative(event); | 118 auto mouse_position = gfx::PointF(ui::EventLocationFromNative(event)); |
| 119 mouse_position = point_transformer_->FromScreenCoordinates(mouse_position); | 119 mouse_position = point_transformer_->FromScreenCoordinates(mouse_position); |
| 120 | 120 |
| 121 caller_task_runner_->PostTask( | 121 caller_task_runner_->PostTask( |
| 122 FROM_HERE, | 122 FROM_HERE, |
| 123 base::Bind( | 123 base::Bind( |
| 124 &ClientSessionControl::OnLocalMouseMoved, client_session_control_, | 124 &ClientSessionControl::OnLocalMouseMoved, client_session_control_, |
| 125 webrtc::DesktopVector(mouse_position.x(), mouse_position.y()))); | 125 webrtc::DesktopVector(mouse_position.x(), mouse_position.y()))); |
| 126 } | 126 } |
| 127 | 127 |
| 128 void LocalInputMonitorChromeos::Core::HandleKeyPressed( | 128 void LocalInputMonitorChromeos::Core::HandleKeyPressed( |
| (...skipping 13 matching lines...) Expand all Loading... |
| 142 scoped_ptr<LocalInputMonitor> LocalInputMonitor::Create( | 142 scoped_ptr<LocalInputMonitor> LocalInputMonitor::Create( |
| 143 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner, | 143 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner, |
| 144 scoped_refptr<base::SingleThreadTaskRunner> input_task_runner, | 144 scoped_refptr<base::SingleThreadTaskRunner> input_task_runner, |
| 145 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner, | 145 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner, |
| 146 base::WeakPtr<ClientSessionControl> client_session_control) { | 146 base::WeakPtr<ClientSessionControl> client_session_control) { |
| 147 return make_scoped_ptr(new LocalInputMonitorChromeos( | 147 return make_scoped_ptr(new LocalInputMonitorChromeos( |
| 148 caller_task_runner, input_task_runner, client_session_control)); | 148 caller_task_runner, input_task_runner, client_session_control)); |
| 149 } | 149 } |
| 150 | 150 |
| 151 } // namespace remoting | 151 } // namespace remoting |
| OLD | NEW |