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/client/plugin/chromoting_instance.h" | 5 #include "remoting/client/plugin/chromoting_instance.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #if defined(OS_NACL) | 10 #if defined(OS_NACL) |
(...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
346 HandleExtensionMessage(*data); | 346 HandleExtensionMessage(*data); |
347 } else if (method == "allowMouseLock") { | 347 } else if (method == "allowMouseLock") { |
348 HandleAllowMouseLockMessage(); | 348 HandleAllowMouseLockMessage(); |
349 } else if (method == "sendMouseInputWhenUnfocused") { | 349 } else if (method == "sendMouseInputWhenUnfocused") { |
350 HandleSendMouseInputWhenUnfocused(); | 350 HandleSendMouseInputWhenUnfocused(); |
351 } else if (method == "delegateLargeCursors") { | 351 } else if (method == "delegateLargeCursors") { |
352 HandleDelegateLargeCursors(); | 352 HandleDelegateLargeCursors(); |
353 } else if (method == "enableDebugRegion") { | 353 } else if (method == "enableDebugRegion") { |
354 HandleEnableDebugRegion(*data); | 354 HandleEnableDebugRegion(*data); |
355 } else if (method == "enableTouchEvents") { | 355 } else if (method == "enableTouchEvents") { |
356 HandleEnableTouchEvents(); | 356 HandleEnableTouchEvents(*data); |
357 } | 357 } |
358 } | 358 } |
359 | 359 |
360 void ChromotingInstance::DidChangeFocus(bool has_focus) { | 360 void ChromotingInstance::DidChangeFocus(bool has_focus) { |
361 DCHECK(plugin_task_runner_->BelongsToCurrentThread()); | 361 DCHECK(plugin_task_runner_->BelongsToCurrentThread()); |
362 | 362 |
363 if (!IsConnected()) | 363 if (!IsConnected()) |
364 return; | 364 return; |
365 | 365 |
366 input_handler_.DidChangeFocus(has_focus); | 366 input_handler_.DidChangeFocus(has_focus); |
(...skipping 611 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
978 const base::DictionaryValue& data) { | 978 const base::DictionaryValue& data) { |
979 bool enable = false; | 979 bool enable = false; |
980 if (!data.GetBoolean("enable", &enable)) { | 980 if (!data.GetBoolean("enable", &enable)) { |
981 LOG(ERROR) << "Invalid enableDebugRegion."; | 981 LOG(ERROR) << "Invalid enableDebugRegion."; |
982 return; | 982 return; |
983 } | 983 } |
984 | 984 |
985 video_renderer_->EnableDebugDirtyRegion(enable); | 985 video_renderer_->EnableDebugDirtyRegion(enable); |
986 } | 986 } |
987 | 987 |
988 void ChromotingInstance::HandleEnableTouchEvents() { | 988 void ChromotingInstance::HandleEnableTouchEvents( |
989 RequestInputEvents(PP_INPUTEVENT_CLASS_TOUCH); | 989 const base::DictionaryValue& data) { |
| 990 bool enable = false; |
| 991 if (!data.GetBoolean("enable", &enable)) { |
| 992 LOG(ERROR) << "Invalid handleTouchEvents."; |
| 993 return; |
| 994 } |
| 995 |
| 996 if (enable) { |
| 997 RequestInputEvents(PP_INPUTEVENT_CLASS_TOUCH); |
| 998 } else { |
| 999 ClearInputEventRequest(PP_INPUTEVENT_CLASS_TOUCH); |
| 1000 } |
990 } | 1001 } |
991 | 1002 |
992 void ChromotingInstance::Disconnect() { | 1003 void ChromotingInstance::Disconnect() { |
993 DCHECK(plugin_task_runner_->BelongsToCurrentThread()); | 1004 DCHECK(plugin_task_runner_->BelongsToCurrentThread()); |
994 | 1005 |
995 VLOG(0) << "Disconnecting from host."; | 1006 VLOG(0) << "Disconnecting from host."; |
996 | 1007 |
997 // Disconnect the input pipeline and teardown the connection. | 1008 // Disconnect the input pipeline and teardown the connection. |
998 mouse_input_filter_.set_input_stub(nullptr); | 1009 mouse_input_filter_.set_input_stub(nullptr); |
999 client_.reset(); | 1010 client_.reset(); |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1185 | 1196 |
1186 #if !defined(OS_NACL) | 1197 #if !defined(OS_NACL) |
1187 // Log messages are forwarded to the webapp only in PNaCl version of the | 1198 // Log messages are forwarded to the webapp only in PNaCl version of the |
1188 // plugin, so ProcessLogToUI() needs to be called explicitly in the non-PNaCl | 1199 // plugin, so ProcessLogToUI() needs to be called explicitly in the non-PNaCl |
1189 // version. | 1200 // version. |
1190 ProcessLogToUI(message); | 1201 ProcessLogToUI(message); |
1191 #endif // !defined(OS_NACL) | 1202 #endif // !defined(OS_NACL) |
1192 } | 1203 } |
1193 | 1204 |
1194 } // namespace remoting | 1205 } // namespace remoting |
OLD | NEW |