| 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/session_event_executor_win.h" | 5 #include "remoting/host/session_event_executor_win.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/command_line.h" | |
| 11 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| 11 #include "base/location.h" |
| 12 #include "base/single_thread_task_runner.h" | 12 #include "base/single_thread_task_runner.h" |
| 13 #include "base/win/windows_version.h" | 13 #include "base/win/windows_version.h" |
| 14 #include "ipc/ipc_channel.h" | |
| 15 #include "ipc/ipc_channel_proxy.h" | |
| 16 #include "remoting/host/chromoting_messages.h" | |
| 17 #include "remoting/host/sas_injector.h" | 14 #include "remoting/host/sas_injector.h" |
| 18 #include "remoting/host/win/desktop.h" | 15 #include "remoting/host/win/desktop.h" |
| 19 #include "remoting/proto/event.pb.h" | 16 #include "remoting/proto/event.pb.h" |
| 20 | 17 |
| 21 namespace { | 18 namespace { |
| 22 | 19 |
| 23 const uint32 kUsbLeftControl = 0x0700e0; | 20 const uint32 kUsbLeftControl = 0x0700e0; |
| 24 const uint32 kUsbRightControl = 0x0700e4; | 21 const uint32 kUsbRightControl = 0x0700e4; |
| 25 const uint32 kUsbLeftAlt = 0x0700e2; | 22 const uint32 kUsbLeftAlt = 0x0700e2; |
| 26 const uint32 kUsbRightAlt = 0x0700e6; | 23 const uint32 kUsbRightAlt = 0x0700e6; |
| (...skipping 11 matching lines...) Expand all Loading... |
| 38 } // namespace | 35 } // namespace |
| 39 | 36 |
| 40 namespace remoting { | 37 namespace remoting { |
| 41 | 38 |
| 42 using protocol::ClipboardEvent; | 39 using protocol::ClipboardEvent; |
| 43 using protocol::MouseEvent; | 40 using protocol::MouseEvent; |
| 44 using protocol::KeyEvent; | 41 using protocol::KeyEvent; |
| 45 | 42 |
| 46 SessionEventExecutorWin::SessionEventExecutorWin( | 43 SessionEventExecutorWin::SessionEventExecutorWin( |
| 47 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, | 44 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner, |
| 48 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner, | |
| 49 scoped_ptr<EventExecutor> nested_executor) | 45 scoped_ptr<EventExecutor> nested_executor) |
| 50 : nested_executor_(nested_executor.Pass()), | 46 : nested_executor_(nested_executor.Pass()), |
| 51 task_runner_(main_task_runner), | 47 task_runner_(main_task_runner), |
| 52 ALLOW_THIS_IN_INITIALIZER_LIST(weak_ptr_factory_(this)), | 48 ALLOW_THIS_IN_INITIALIZER_LIST(weak_ptr_factory_(this)), |
| 53 weak_ptr_(weak_ptr_factory_.GetWeakPtr()) { | 49 weak_ptr_(weak_ptr_factory_.GetWeakPtr()) { |
| 54 // Let |weak_ptr_| be used on the |task_runner_| thread. | 50 // Let |weak_ptr_| be used on the |task_runner_| thread. |
| 55 // |weak_ptr_| and |weak_ptr_factory_| share a ThreadChecker, so the | 51 // |weak_ptr_| and |weak_ptr_factory_| share a ThreadChecker, so the |
| 56 // following line affects both of them. | 52 // following line affects both of them. |
| 57 weak_ptr_factory_.DetachFromThread(); | 53 weak_ptr_factory_.DetachFromThread(); |
| 58 } | 54 } |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 // one. | 146 // one. |
| 151 scoped_ptr<Desktop> input_desktop = Desktop::GetInputDesktop(); | 147 scoped_ptr<Desktop> input_desktop = Desktop::GetInputDesktop(); |
| 152 if (input_desktop.get() != NULL && !desktop_.IsSame(*input_desktop)) { | 148 if (input_desktop.get() != NULL && !desktop_.IsSame(*input_desktop)) { |
| 153 // If SetThreadDesktop() fails, the thread is still assigned a desktop. | 149 // If SetThreadDesktop() fails, the thread is still assigned a desktop. |
| 154 // So we can continue capture screen bits, just from a diffected desktop. | 150 // So we can continue capture screen bits, just from a diffected desktop. |
| 155 desktop_.SetThreadDesktop(input_desktop.Pass()); | 151 desktop_.SetThreadDesktop(input_desktop.Pass()); |
| 156 } | 152 } |
| 157 } | 153 } |
| 158 | 154 |
| 159 } // namespace remoting | 155 } // namespace remoting |
| OLD | NEW |