Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(252)

Unified Diff: remoting/client/plugin/chromoting_instance.cc

Issue 799233004: Add touch events to the protocol, the stub layer, and to the client plugin. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebased Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « remoting/client/plugin/chromoting_instance.h ('k') | remoting/client/plugin/pepper_input_handler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/client/plugin/chromoting_instance.cc
diff --git a/remoting/client/plugin/chromoting_instance.cc b/remoting/client/plugin/chromoting_instance.cc
index e770efb49c245dd21be91dc3a13406e6c405c1eb..6012d2dbc4b64552e6ff5c3689deb9ba669d1c93 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_scaler_(&input_tracker_),
+ key_mapper_(&touch_input_scaler_),
cursor_setter_(this),
empty_cursor_filter_(&cursor_setter_),
text_input_controller_(this),
@@ -352,6 +353,8 @@ void ChromotingInstance::HandleMessage(const pp::Var& message) {
HandleDelegateLargeCursors();
} else if (method == "enableDebugRegion") {
HandleEnableDebugRegion(*data);
+ } else if (method == "enableTouchEvents") {
+ HandleEnableTouchEvents();
}
}
@@ -370,8 +373,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_scaler_.set_input_size(size);
if (video_renderer_)
video_renderer_->OnViewChanged(view);
@@ -403,8 +408,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_scaler_.set_output_size(size);
scoped_ptr<base::DictionaryValue> data(new base::DictionaryValue());
data->SetInteger("width", size.width());
@@ -688,9 +694,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_scaler_.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_scaler_.set_input_size(size);
}
// Setup the signal strategy.
@@ -979,6 +988,10 @@ void ChromotingInstance::HandleEnableDebugRegion(
video_renderer_->EnableDebugDirtyRegion(enable);
}
+void ChromotingInstance::HandleEnableTouchEvents() {
+ RequestInputEvents(PP_INPUTEVENT_CLASS_TOUCH);
+}
+
void ChromotingInstance::Disconnect() {
DCHECK(plugin_task_runner_->BelongsToCurrentThread());
« no previous file with comments | « remoting/client/plugin/chromoting_instance.h ('k') | remoting/client/plugin/pepper_input_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698