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

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

Issue 1033913003: Touch Events capability negotiation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: changes from review Created 5 years, 8 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
Index: remoting/client/plugin/chromoting_instance.cc
diff --git a/remoting/client/plugin/chromoting_instance.cc b/remoting/client/plugin/chromoting_instance.cc
index d4ad35f51487e7cefaacb8b8e3f58485fda627b0..d62331363a9fd148d855176a9b88e287afe9d3e2 100644
--- a/remoting/client/plugin/chromoting_instance.cc
+++ b/remoting/client/plugin/chromoting_instance.cc
@@ -355,7 +355,7 @@ void ChromotingInstance::HandleMessage(const pp::Var& message) {
} else if (method == "enableDebugRegion") {
HandleEnableDebugRegion(*data);
} else if (method == "enableTouchEvents") {
- HandleEnableTouchEvents();
+ HandleEnableTouchEvents(*data);
}
}
@@ -988,8 +988,19 @@ void ChromotingInstance::HandleEnableDebugRegion(
video_renderer_->EnableDebugDirtyRegion(enable);
}
-void ChromotingInstance::HandleEnableTouchEvents() {
- RequestInputEvents(PP_INPUTEVENT_CLASS_TOUCH);
+void ChromotingInstance::HandleEnableTouchEvents(
+ const base::DictionaryValue& data) {
+ bool enable = false;
+ if (!data.GetBoolean("enable", &enable)) {
+ LOG(ERROR) << "Invalid handleTouchEvents.";
+ return;
+ }
+
+ if (enable) {
+ RequestInputEvents(PP_INPUTEVENT_CLASS_TOUCH);
+ } else {
+ ClearInputEventRequest(PP_INPUTEVENT_CLASS_TOUCH);
+ }
}
void ChromotingInstance::Disconnect() {

Powered by Google App Engine
This is Rietveld 408576698