Index: remoting/client/plugin/chromoting_instance.cc |
diff --git a/remoting/client/plugin/chromoting_instance.cc b/remoting/client/plugin/chromoting_instance.cc |
index ff8a06a1824a7631d82e06dffaeedb2f654d7092..d9400879fa96c20fa186f7bbb6db5f90281ee360 100644 |
--- a/remoting/client/plugin/chromoting_instance.cc |
+++ b/remoting/client/plugin/chromoting_instance.cc |
@@ -187,7 +187,8 @@ ChromotingInstance::ChromotingInstance(PP_Instance pp_instance) |
plugin_task_runner_(new PluginThreadTaskRunner(&plugin_thread_delegate_)), |
context_(plugin_task_runner_.get()), |
input_tracker_(&mouse_input_filter_), |
- key_mapper_(&input_tracker_), |
+ touch_input_filter_(&input_tracker_), |
+ key_mapper_(&touch_input_filter_), |
cursor_setter_(this), |
empty_cursor_filter_(&cursor_setter_), |
text_input_controller_(this), |
@@ -215,6 +216,7 @@ ChromotingInstance::ChromotingInstance(PP_Instance pp_instance) |
#endif |
// Register for mouse, wheel and keyboard events. |
+ // TODO(rkuroiwa): Add PP_INPUTEVENT_CLASS_TOUCH when ready. |
Wez
2015/01/21 03:08:37
Shouldn't you be doing the registration in the Han
Rintaro Kuroiwa
2015/01/28 01:12:29
Moved. But it *should* check for capabilities as w
Wez
2015/02/05 02:09:06
Check what for capabilities? The client? Or the ho
Rintaro Kuroiwa
2015/02/06 23:35:00
The capabilities. IIUC, the javascript layer check
|
RequestInputEvents(PP_INPUTEVENT_CLASS_MOUSE | PP_INPUTEVENT_CLASS_WHEEL); |
RequestFilteringInputEvents(PP_INPUTEVENT_CLASS_KEYBOARD); |
@@ -350,6 +352,8 @@ void ChromotingInstance::HandleMessage(const pp::Var& message) { |
HandleSendMouseInputWhenUnfocused(); |
} else if (method == "delegateLargeCursors") { |
HandleDelegateLargeCursors(); |
+ } else if (method == "sendTouchEvents") { |
+ HandleSendTouchEvents(); |
} |
} |
@@ -368,8 +372,10 @@ void ChromotingInstance::DidChangeView(const pp::View& view) { |
DCHECK(plugin_task_runner_->BelongsToCurrentThread()); |
plugin_view_ = view; |
- mouse_input_filter_.set_input_size( |
+ webrtc::DesktopSize size( |
webrtc::DesktopSize(view.GetRect().width(), view.GetRect().height())); |
+ mouse_input_filter_.set_input_size(size); |
+ touch_input_filter_.set_input_size(size); |
if (video_renderer_) |
video_renderer_->OnViewChanged(view); |
@@ -401,8 +407,9 @@ void ChromotingInstance::OnVideoFirstFrameReceived() { |
} |
void ChromotingInstance::OnVideoSize(const webrtc::DesktopSize& size, |
- const webrtc::DesktopVector& dpi) { |
+ const webrtc::DesktopVector& dpi) { |
mouse_input_filter_.set_output_size(size); |
+ touch_input_filter_.set_output_size(size); |
scoped_ptr<base::DictionaryValue> data(new base::DictionaryValue()); |
data->SetInteger("width", size.width()); |
@@ -664,9 +671,12 @@ void ChromotingInstance::HandleConnect(const base::DictionaryValue& data) { |
// Connect the input pipeline to the protocol stub & initialize components. |
mouse_input_filter_.set_input_stub(client_->input_stub()); |
+ touch_input_filter_.set_input_stub(client_->input_stub()); |
if (!plugin_view_.is_null()) { |
- mouse_input_filter_.set_input_size(webrtc::DesktopSize( |
- plugin_view_.GetRect().width(), plugin_view_.GetRect().height())); |
+ webrtc::DesktopSize size(plugin_view_.GetRect().width(), |
+ plugin_view_.GetRect().height()); |
+ mouse_input_filter_.set_input_size(size); |
+ touch_input_filter_.set_input_size(size); |
} |
// Setup the signal strategy. |
@@ -944,6 +954,10 @@ void ChromotingInstance::HandleDelegateLargeCursors() { |
cursor_setter_.set_delegate_stub(this); |
} |
+void ChromotingInstance::HandleSendTouchEvents() { |
+ input_handler_.set_send_touch_events(true); |
Wez
2015/01/21 03:08:37
Rather than setting a flag on the PepperInputHandl
Rintaro Kuroiwa
2015/01/28 01:12:29
Done.
|
+} |
+ |
void ChromotingInstance::Disconnect() { |
DCHECK(plugin_task_runner_->BelongsToCurrentThread()); |