Commit d9da0824 authored by Yuwei Huang's avatar Yuwei Huang Committed by Commit Bot

Revert "[CRD iOS] Translate "\n" into an enter keypress"

This reverts commit 8b79a3c6.

Reason for revert: This change is not good enough to fix the keypress issue we see. We need to rework the way we send keypress, which will undo the change we do here.

Original change's description:
> [CRD iOS] Translate "\n" into an enter keypress
> 
> iOS is sending a "\n" unicode text event to the host when the user taps
> the `return` key. On Windows this doesn't always generate a newline.
> 
> This CL fixes this issue by translating the "\n" text event into a
> ENTER keypress before sending it to the host.
> 
> Bug: 830959
> Change-Id: Ib94caf6ce2036cc5654f1b59f1e0136c81c9eec1
> Reviewed-on: https://chromium-review.googlesource.com/1003598
> Commit-Queue: Yuwei Huang <yuweih@chromium.org>
> Reviewed-by: Jamie Walch <jamiewalch@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#549385}

TBR=jamiewalch@chromium.org,yuweih@chromium.org

Change-Id: Icba4c28dccc7154f30a41b90dc2cbc62feae2824
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 830959
Reviewed-on: https://chromium-review.googlesource.com/1005697Reviewed-by: default avatarYuwei Huang <yuweih@chromium.org>
Commit-Queue: Yuwei Huang <yuweih@chromium.org>
Cr-Commit-Position: refs/heads/master@{#549633}
parent 0a8d4154
......@@ -85,16 +85,4 @@ void KeyboardInterpreter::HandlePrintScreenEvent() {
input_strategy_->HandleKeysEvent(keys);
}
void KeyboardInterpreter::HandleEnterEvent() {
if (!input_strategy_) {
return;
}
base::queue<KeyEvent> keys;
keys.push({static_cast<uint32_t>(ui::DomCode::ENTER), true});
keys.push({static_cast<uint32_t>(ui::DomCode::ENTER), false});
input_strategy_->HandleKeysEvent(keys);
return;
}
} // namespace remoting
......@@ -35,10 +35,6 @@ class KeyboardInterpreter {
// Assembles PRINT_SCREEN key event and then delegates to
// |KeyboardInputStrategy| send the keys.
void HandlePrintScreenEvent();
// Assembles ENTER key event and then delegates to |KeyboardInputStrategy| to
// send the keys. Do not send a single "\n" text event to the host to inject
// enter as it has undefined behavior on Windows.
void HandleEnterEvent();
private:
std::unique_ptr<KeyboardInputStrategy> input_strategy_;
......
......@@ -326,10 +326,6 @@ static NSString* const kFeedbackContext = @"InSessionFeedbackContext";
0);
}
- (void)clientKeyboardShouldSendEnter {
_client.keyboardInterpreter->HandleEnterEvent();
}
- (void)clientKeyboardShouldDelete {
_client.keyboardInterpreter->HandleDeleteEvent(0);
}
......
......@@ -10,7 +10,6 @@
@protocol ClientKeyboardDelegate<NSObject>
- (void)clientKeyboardShouldSend:(NSString*)text;
- (void)clientKeyboardShouldSendEnter;
- (void)clientKeyboardShouldDelete;
@end
......
......@@ -49,11 +49,7 @@
#pragma mark - UIKeyInput
- (void)insertText:(NSString*)text {
if ([text isEqualToString:@"\n"]) {
[_delegate clientKeyboardShouldSendEnter];
} else {
[_delegate clientKeyboardShouldSend:text];
}
}
- (void)deleteBackward {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment