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

Unified Diff: chrome/browser/ui/cocoa/autofill/autofill_section_container.mm

Issue 82193002: [rAC, OSX] Autofill text field hot keys. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Review fixes. Created 7 years, 1 month 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
« no previous file with comments | « chrome/browser/ui/cocoa/autofill/autofill_input_field.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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];
« no previous file with comments | « chrome/browser/ui/cocoa/autofill/autofill_input_field.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698