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

Unified Diff: remoting/ios/app/host_view_controller.mm

Issue 2891603002: [CRD iOS] Trackpad Input Mode (Closed)
Patch Set: Fix 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/ui/trackpad_input_strategy.cc ('k') | remoting/ios/client_gestures.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/ios/app/host_view_controller.mm
diff --git a/remoting/ios/app/host_view_controller.mm b/remoting/ios/app/host_view_controller.mm
index 155945d3421d0af8fb3ed3c46fafe5d9fb852d31..67a440cd5fa0246f26a907059178559b80ee1f24 100644
--- a/remoting/ios/app/host_view_controller.mm
+++ b/remoting/ios/app/host_view_controller.mm
@@ -82,6 +82,10 @@ static const CGFloat kKeyboardAnimationTime = 0.3;
// the surface is not ready to handle the transformation matrix.
// Call onSurfaceChanged here to cover that case.
[_client surfaceChanged:self.view.frame];
+
+ // TODO(yuweih): This should be loaded from and stored into user defaults.
+ _client.gestureInterpreter->SetInputMode(
+ remoting::GestureInterpreter::DIRECT_INPUT_MODE);
}
- (void)viewDidDisappear:(BOOL)animated {
@@ -210,6 +214,23 @@ static const CGFloat kKeyboardAnimationTime = 0.3;
style:UIAlertActionStyleDefault
handler:showKeyboardHandler]];
}
+
+ remoting::GestureInterpreter::InputMode currentInputMode =
+ _client.gestureInterpreter->GetInputMode();
+ NSString* switchInputModeTitle =
+ currentInputMode == remoting::GestureInterpreter::DIRECT_INPUT_MODE
+ ? @"Trackpad Mode"
+ : @"Touch Mode";
+ void (^switchInputModeHandler)(UIAlertAction*) = ^(UIAlertAction*) {
+ _client.gestureInterpreter->SetInputMode(
+ currentInputMode == remoting::GestureInterpreter::DIRECT_INPUT_MODE
+ ? remoting::GestureInterpreter::TRACKPAD_INPUT_MODE
+ : remoting::GestureInterpreter::DIRECT_INPUT_MODE);
+ };
+ [alert addAction:[UIAlertAction actionWithTitle:switchInputModeTitle
+ style:UIAlertActionStyleDefault
+ handler:switchInputModeHandler]];
+
void (^disconnectHandler)(UIAlertAction*) = ^(UIAlertAction*) {
[_client disconnectFromHost];
[self dismissViewControllerAnimated:YES completion:nil];
« no previous file with comments | « remoting/client/ui/trackpad_input_strategy.cc ('k') | remoting/ios/client_gestures.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698