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

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

Issue 2868383003: [CRD iOS] Send key events to the session. (Closed)
Patch Set: Clean up old key input code. No longer used. 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
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 {

Powered by Google App Engine
This is Rietveld 408576698