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