Index: chrome/browser/ui/cocoa/autofill/autofill_section_container.mm |
diff --git a/chrome/browser/ui/cocoa/autofill/autofill_section_container.mm b/chrome/browser/ui/cocoa/autofill/autofill_section_container.mm |
index 24ea4616ccfb50b4beab99c8b6edeb94864c04f4..be76f04169b309345865a3df79f8dcc5b7c97aeb 100644 |
--- a/chrome/browser/ui/cocoa/autofill/autofill_section_container.mm |
+++ b/chrome/browser/ui/cocoa/autofill/autofill_section_container.mm |
@@ -20,6 +20,7 @@ |
#import "chrome/browser/ui/cocoa/image_button_cell.h" |
#import "chrome/browser/ui/cocoa/menu_button.h" |
#include "components/autofill/core/browser/autofill_type.h" |
+#include "content/public/browser/native_web_keyboard_event.h" |
#include "grit/theme_resources.h" |
#import "ui/base/cocoa/menu_controller.h" |
#include "ui/base/l10n/l10n_util_mac.h" |
@@ -251,6 +252,19 @@ bool CompareInputRows(const autofill::DetailInput* input1, |
[view_ setFrameSize:viewFrame.size]; |
} |
+- (KeyEventHandled)keyEvent:(NSEvent*)event forInput:(id)sender { |
+ content::NativeWebKeyboardEvent webEvent(event); |
+ |
+ // Only handle keyDown, to handle key repeats without duplicates. |
+ if (webEvent.type != content::NativeWebKeyboardEvent::KeyDown) |
+ return kKeyEventNotHandled; |
+ |
+ // Allow the delegate to intercept key messages. |
+ if (delegate_->HandleKeyPressEventInInput(webEvent)) |
+ return kKeyEventHandled; |
+ return kKeyEventNotHandled; |
+} |
+ |
- (void)onMouseDown:(NSControl<AutofillInputField>*)field { |
[self textfieldEditedOrActivated:field edited:NO]; |
[validationDelegate_ updateMessageForField:field]; |