Chromium Code Reviews| 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/win/session_input_injector.h" | 5 #include "remoting/host/win/session_input_injector.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 59 virtual void Start(scoped_ptr<ClipboardStub> client_clipboard) override; | 59 virtual void Start(scoped_ptr<ClipboardStub> client_clipboard) override; |
| 60 | 60 |
| 61 // protocol::ClipboardStub implementation. | 61 // protocol::ClipboardStub implementation. |
| 62 virtual void InjectClipboardEvent(const ClipboardEvent& event) override; | 62 virtual void InjectClipboardEvent(const ClipboardEvent& event) override; |
| 63 | 63 |
| 64 // protocol::InputStub implementation. | 64 // protocol::InputStub implementation. |
| 65 virtual void InjectKeyEvent(const KeyEvent& event) override; | 65 virtual void InjectKeyEvent(const KeyEvent& event) override; |
| 66 virtual void InjectTextEvent(const TextEvent& event) override; | 66 virtual void InjectTextEvent(const TextEvent& event) override; |
| 67 virtual void InjectMouseEvent(const MouseEvent& event) override; | 67 virtual void InjectMouseEvent(const MouseEvent& event) override; |
| 68 virtual void InjectTouchEvent(const TouchEvent& event) override; | 68 virtual void InjectTouchEvent(const TouchEvent& event) override; |
| 69 virtual bool CanInjectTouch() override; | |
| 69 | 70 |
| 70 private: | 71 private: |
| 71 friend class base::RefCountedThreadSafe<Core>; | 72 friend class base::RefCountedThreadSafe<Core>; |
| 72 virtual ~Core(); | 73 virtual ~Core(); |
| 73 | 74 |
| 74 // Switches to the desktop receiving a user input if different from | 75 // Switches to the desktop receiving a user input if different from |
| 75 // the current one. | 76 // the current one. |
| 76 void SwitchToInputDesktop(); | 77 void SwitchToInputDesktop(); |
| 77 | 78 |
| 78 scoped_refptr<base::SingleThreadTaskRunner> input_task_runner_; | 79 scoped_refptr<base::SingleThreadTaskRunner> input_task_runner_; |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 193 if (!input_task_runner_->BelongsToCurrentThread()) { | 194 if (!input_task_runner_->BelongsToCurrentThread()) { |
| 194 input_task_runner_->PostTask( | 195 input_task_runner_->PostTask( |
| 195 FROM_HERE, base::Bind(&Core::InjectTouchEvent, this, event)); | 196 FROM_HERE, base::Bind(&Core::InjectTouchEvent, this, event)); |
| 196 return; | 197 return; |
| 197 } | 198 } |
| 198 | 199 |
| 199 SwitchToInputDesktop(); | 200 SwitchToInputDesktop(); |
| 200 nested_executor_->InjectTouchEvent(event); | 201 nested_executor_->InjectTouchEvent(event); |
| 201 } | 202 } |
| 202 | 203 |
| 204 bool SessionInputInjectorWin::Core::CanInjectTouch() { | |
| 205 return nested_executor_->CanInjectTouch(); | |
|
Wez
2015/04/09 22:58:59
You're accessing the |nested_executor_| from the c
Rintaro Kuroiwa
2015/04/20 18:20:03
N/A for latest patch.
| |
| 206 } | |
| 207 | |
| 203 SessionInputInjectorWin::Core::~Core() { | 208 SessionInputInjectorWin::Core::~Core() { |
| 204 } | 209 } |
| 205 | 210 |
| 206 void SessionInputInjectorWin::Core::SwitchToInputDesktop() { | 211 void SessionInputInjectorWin::Core::SwitchToInputDesktop() { |
| 207 // Switch to the desktop receiving user input if different from the current | 212 // Switch to the desktop receiving user input if different from the current |
| 208 // one. | 213 // one. |
| 209 scoped_ptr<webrtc::Desktop> input_desktop( | 214 scoped_ptr<webrtc::Desktop> input_desktop( |
| 210 webrtc::Desktop::GetInputDesktop()); | 215 webrtc::Desktop::GetInputDesktop()); |
| 211 if (input_desktop.get() != nullptr && !desktop_.IsSame(*input_desktop)) { | 216 if (input_desktop.get() != nullptr && !desktop_.IsSame(*input_desktop)) { |
| 212 // If SetThreadDesktop() fails, the thread is still assigned a desktop. | 217 // If SetThreadDesktop() fails, the thread is still assigned a desktop. |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 249 void SessionInputInjectorWin::InjectMouseEvent( | 254 void SessionInputInjectorWin::InjectMouseEvent( |
| 250 const protocol::MouseEvent& event) { | 255 const protocol::MouseEvent& event) { |
| 251 core_->InjectMouseEvent(event); | 256 core_->InjectMouseEvent(event); |
| 252 } | 257 } |
| 253 | 258 |
| 254 void SessionInputInjectorWin::InjectTouchEvent( | 259 void SessionInputInjectorWin::InjectTouchEvent( |
| 255 const protocol::TouchEvent& event) { | 260 const protocol::TouchEvent& event) { |
| 256 core_->InjectTouchEvent(event); | 261 core_->InjectTouchEvent(event); |
| 257 } | 262 } |
| 258 | 263 |
| 264 bool SessionInputInjectorWin::CanInjectTouch() { | |
| 265 return core_->CanInjectTouch(); | |
| 266 } | |
| 267 | |
| 259 } // namespace remoting | 268 } // namespace remoting |
| OLD | NEW |