Chromium Code Reviews| 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..91bee1e611178dcd74a156bf1ec91fa9693fb500 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. |
|
Robert Sesek
2013/11/22 16:52:39
This isn't only handling keyDown. This is merely n
groby-ooo-7-16
2013/11/22 21:31:32
Done.
|
| + if (webEvent.type == content::NativeWebKeyboardEvent::KeyUp) |
| + 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]; |