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 40dde774ca62ad2a9a292d9a2bfc90005bb79453..4240992b8f1ac943d6fcd4a9fffedc671e73ef5f 100644 |
--- a/remoting/ios/app/host_view_controller.mm |
+++ b/remoting/ios/app/host_view_controller.mm |
@@ -17,11 +17,13 @@ |
#import "remoting/ios/client_keyboard.h" |
#import "remoting/ios/session/remoting_client.h" |
+#include "base/strings/sys_string_conversions.h" |
#include "remoting/client/gesture_interpreter.h" |
+#include "remoting/client/input/keyboard_interpreter.h" |
static const CGFloat kFabInset = 15.f; |
-@interface HostViewController () { |
+@interface HostViewController ()<ClientKeyboardDelegate> { |
RemotingClient* _client; |
MDCFloatingButton* _floatingButton; |
ClientGestures* _clientGestures; |
@@ -132,6 +134,7 @@ static const CGFloat kFabInset = 15.f; |
- (void)showKeyboard { |
if (!_clientKeyboard) { |
_clientKeyboard = [[ClientKeyboard alloc] init]; |
+ _clientKeyboard.delegate = self; |
[self.view addSubview:_clientKeyboard]; |
// TODO(nicholss): need to pass some keyboard injection interface here. |
} |
@@ -171,6 +174,17 @@ static const CGFloat kFabInset = 15.f; |
_keyboardSize = CGSizeZero; |
} |
+#pragma mark - ClientKeyboardDelegate |
+ |
+- (void)clientKeyboardShouldSend:(NSString*)text { |
+ _client.keyboardInterpreter->HandleTextEvent(base::SysNSStringToUTF8(text), |
+ 0); |
+} |
+ |
+- (void)clientKeyboardShouldDelete { |
+ _client.keyboardInterpreter->HandleDeleteEvent(0); |
+} |
+ |
#pragma mark - Private |
- (void)didTap:(id)sender { |