Commit 45a0c323 authored by Gauthier Ambard's avatar Gauthier Ambard Committed by Commit Bot

[iOS] Make BVC able to become first responder

Allowing BVC to become first responder is letting it answer keyboard
shortcuts.
It also makes sure that the BVC is set as first responder when shown.

Fixed: 1088068
Change-Id: I04cab9d4d9e20487778f64b0cbba49d64f611408
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2235849Reviewed-by: default avatarMark Cogan <marq@chromium.org>
Commit-Queue: Gauthier Ambard <gambard@chromium.org>
Cr-Commit-Position: refs/heads/master@{#776923}
parent 65c41318
...@@ -1337,6 +1337,10 @@ NSString* const kBrowserViewControllerSnackbarCategory = ...@@ -1337,6 +1337,10 @@ NSString* const kBrowserViewControllerSnackbarCategory =
#pragma mark - UIResponder #pragma mark - UIResponder
- (BOOL)canBecomeFirstResponder {
return YES;
}
- (NSArray*)keyCommands { - (NSArray*)keyCommands {
if (![self shouldRegisterKeyboardCommands]) { if (![self shouldRegisterKeyboardCommands]) {
return nil; return nil;
......
...@@ -381,6 +381,8 @@ ...@@ -381,6 +381,8 @@
toBrowser:self.bvcContainer toBrowser:self.bvcContainer
withCompletion:^{ withCompletion:^{
extendedCompletion(); extendedCompletion();
[self.bvcContainer
.currentBVC becomeFirstResponder];
}]; }];
} else { } else {
......
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