Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/client/chromoting_session.h" | 5 #include "remoting/client/chromoting_session.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/callback_helpers.h" | 10 #include "base/callback_helpers.h" |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 197 if (!usb_key_code) { | 197 if (!usb_key_code) { |
| 198 LOG(WARNING) << "Ignoring unknown key code: " << key_code | 198 LOG(WARNING) << "Ignoring unknown key code: " << key_code |
| 199 << " scan code: " << scan_code; | 199 << " scan code: " << scan_code; |
| 200 return false; | 200 return false; |
| 201 } | 201 } |
| 202 | 202 |
| 203 SendKeyEventInternal(usb_key_code, key_down); | 203 SendKeyEventInternal(usb_key_code, key_down); |
| 204 return true; | 204 return true; |
| 205 } | 205 } |
| 206 | 206 |
| 207 bool ChromotingSession::SendKeyEvent(int key_code, bool key_down) { | |
| 208 SendKeyEventInternal(key_code, key_down); | |
| 209 return true; | |
| 210 } | |
|
joedow
2017/05/12 19:13:17
Drive-by: This code looks a bit like the function
nicholss
2017/05/12 20:45:57
I have updated to use usb_key_code as the param na
| |
| 211 | |
| 207 void ChromotingSession::SendTextEvent(const std::string& text) { | 212 void ChromotingSession::SendTextEvent(const std::string& text) { |
| 208 if (!runtime_->network_task_runner()->BelongsToCurrentThread()) { | 213 if (!runtime_->network_task_runner()->BelongsToCurrentThread()) { |
| 209 runtime_->network_task_runner()->PostTask( | 214 runtime_->network_task_runner()->PostTask( |
| 210 FROM_HERE, | 215 FROM_HERE, |
| 211 base::Bind(&ChromotingSession::SendTextEvent, GetWeakPtr(), text)); | 216 base::Bind(&ChromotingSession::SendTextEvent, GetWeakPtr(), text)); |
| 212 return; | 217 return; |
| 213 } | 218 } |
| 214 | 219 |
| 215 protocol::TextEvent event; | 220 protocol::TextEvent event; |
| 216 event.set_text(text); | 221 event.set_text(text); |
| (...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 449 video_renderer_.reset(); | 454 video_renderer_.reset(); |
| 450 signaling_.reset(); | 455 signaling_.reset(); |
| 451 perf_tracker_.reset(); | 456 perf_tracker_.reset(); |
| 452 client_context_.reset(); | 457 client_context_.reset(); |
| 453 cursor_shape_stub_.reset(); | 458 cursor_shape_stub_.reset(); |
| 454 | 459 |
| 455 weak_factory_.InvalidateWeakPtrs(); | 460 weak_factory_.InvalidateWeakPtrs(); |
| 456 } | 461 } |
| 457 | 462 |
| 458 } // namespace remoting | 463 } // namespace remoting |
| OLD | NEW |