| 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];
|
|
|