| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/desktop_session_agent.h" | 5 #include "remoting/host/desktop_session_agent.h" |
| 6 | 6 |
| 7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "ipc/ipc_channel_proxy.h" | 9 #include "ipc/ipc_channel_proxy.h" |
| 10 #include "ipc/ipc_message.h" | 10 #include "ipc/ipc_message.h" |
| (...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 430 DCHECK(caller_task_runner()->BelongsToCurrentThread()); | 430 DCHECK(caller_task_runner()->BelongsToCurrentThread()); |
| 431 | 431 |
| 432 protocol::KeyEvent event; | 432 protocol::KeyEvent event; |
| 433 if (!event.ParseFromString(serialized_event)) { | 433 if (!event.ParseFromString(serialized_event)) { |
| 434 LOG(ERROR) << "Failed to parse protocol::KeyEvent."; | 434 LOG(ERROR) << "Failed to parse protocol::KeyEvent."; |
| 435 return; | 435 return; |
| 436 } | 436 } |
| 437 | 437 |
| 438 // Ignore unknown keycodes. | 438 // Ignore unknown keycodes. |
| 439 if (event.has_usb_keycode() && | 439 if (event.has_usb_keycode() && |
| 440 UsbKeycodeToNativeKeycode(event.usb_keycode()) == kInvalidKeycode) { | 440 (UsbKeycodeToNativeKeycode(event.usb_keycode()) == |
| 441 InvalidNativeKeycode())) { |
| 441 LOG(ERROR) << "KeyEvent: unknown USB keycode: " | 442 LOG(ERROR) << "KeyEvent: unknown USB keycode: " |
| 442 << std::hex << event.usb_keycode() << std::dec; | 443 << std::hex << event.usb_keycode() << std::dec; |
| 443 return; | 444 return; |
| 444 } | 445 } |
| 445 | 446 |
| 446 remote_input_filter_->InjectKeyEvent(event); | 447 remote_input_filter_->InjectKeyEvent(event); |
| 447 } | 448 } |
| 448 | 449 |
| 449 void DesktopSessionAgent::OnInjectMouseEvent( | 450 void DesktopSessionAgent::OnInjectMouseEvent( |
| 450 const std::string& serialized_event) { | 451 const std::string& serialized_event) { |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 552 base::ClosePlatformFile(desktop_pipe_.fd); | 553 base::ClosePlatformFile(desktop_pipe_.fd); |
| 553 #else // !defined(OS_POSIX) | 554 #else // !defined(OS_POSIX) |
| 554 #error Unsupported platform. | 555 #error Unsupported platform. |
| 555 #endif // !defined(OS_POSIX) | 556 #endif // !defined(OS_POSIX) |
| 556 | 557 |
| 557 desktop_pipe_ = IPC::InvalidPlatformFileForTransit(); | 558 desktop_pipe_ = IPC::InvalidPlatformFileForTransit(); |
| 558 } | 559 } |
| 559 } | 560 } |
| 560 | 561 |
| 561 } // namespace remoting | 562 } // namespace remoting |
| OLD | NEW |