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

Unified Diff: remoting/client/ios/client_gestures.mm

Issue 2862893003: [CRD iOS] Inject mouse events to the host (Closed)
Patch Set: Resolve Feedback Created 3 years, 7 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/input_strategy.h ('k') | remoting/client/ios/session/remoting_client.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/client/ios/client_gestures.mm
diff --git a/remoting/client/ios/client_gestures.mm b/remoting/client/ios/client_gestures.mm
index 336902259a928f4cdb2e8303a2796afda69ce245..f67beac120a2cc9807ceb13a42f3bd796d5dc2e5 100644
--- a/remoting/client/ios/client_gestures.mm
+++ b/remoting/client/ios/client_gestures.mm
@@ -114,16 +114,8 @@
}
- (IBAction)tapGestureTriggered:(UITapGestureRecognizer*)sender {
- // LOG_TRACE(INFO) << "tapGestureTriggered";
- // CGPoint touchPoint = [sender locationInView:self.view];
- // if ([_scene containsTouchPoint:touchPoint]) {
- // if (_inputScheme == HostInputSchemeTouch) {
- // [_scene setMouseLocationFromLocationInView:touchPoint];
- // _circle.expandedRadius = 11.0f;
- // [_circle doExpandingAnimationAtLocation:[_scene mouseLocationInView]];
- // }
- // [Utility leftClickOn:_clientToHostProxy at:_scene.mousePosition];
- // }
+ CGPoint touchPoint = [sender locationInView:_view];
+ _client.gestureInterpreter->Tap(touchPoint.x, touchPoint.y);
}
// Change position of scene. This can occur during a pinch or long press.
@@ -238,6 +230,20 @@
// Click-Drag mouse operation. This can occur during a Pan.
- (IBAction)longPressGestureTriggered:(UILongPressGestureRecognizer*)sender {
+ CGPoint touchPoint = [sender locationInView:_view];
+ remoting::GestureInterpreter::GestureState state;
+ switch ([sender state]) {
+ case UIGestureRecognizerStateBegan:
+ state = remoting::GestureInterpreter::GESTURE_BEGAN;
+ break;
+ case UIGestureRecognizerStateChanged:
+ state = remoting::GestureInterpreter::GESTURE_CHANGED;
+ break;
+ default:
+ state = remoting::GestureInterpreter::GESTURE_ENDED;
+ }
+ _client.gestureInterpreter->LongPress(touchPoint.x, touchPoint.y, state);
+
// LOG_TRACE(INFO) << "longPressGestureTriggered";
// if ([sender state] == UIGestureRecognizerStateBegan) {
// if (_inputScheme == HostInputSchemeTouch) {
@@ -271,14 +277,8 @@
}
- (IBAction)twoFingerTapGestureTriggered:(UITapGestureRecognizer*)sender {
- // LOG_TRACE(INFO) << "twoFingerTapGestureTriggered";
- if (_inputScheme == HostInputSchemeTouch) {
- // disabled
- return;
- }
- // if ([_scene containsTouchPoint:[sender locationInView:self.view]]) {
- // [Utility rightClickOn:_clientToHostProxy at:_scene.mousePosition];
- // }
+ CGPoint touchPoint = [sender locationInView:_view];
+ _client.gestureInterpreter->TwoFingerTap(touchPoint.x, touchPoint.y);
}
- (IBAction)threeFingerTapGestureTriggered:(UITapGestureRecognizer*)sender {
« no previous file with comments | « remoting/client/input_strategy.h ('k') | remoting/client/ios/session/remoting_client.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698