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 59343e0d281c3a237bc0100b1f0107035637d7e5..242afdf4835e76960a2833406ddb076d835a734d 100644 |
--- a/chrome/browser/ui/cocoa/autofill/autofill_section_container.mm |
+++ b/chrome/browser/ui/cocoa/autofill/autofill_section_container.mm |
@@ -262,16 +262,22 @@ bool CompareInputRows(const autofill::DetailInput* input1, |
[view_ setFrameSize:viewFrame.size]; |
} |
-- (void)fieldBecameFirstResponder:(NSControl<AutofillInputField>*)field { |
+- (void)onMouseDown:(NSControl<AutofillInputField>*)field { |
[self textfieldEditedOrActivated:field edited:NO]; |
[validationDelegate_ updateMessageForField:field]; |
} |
+- (void)fieldBecameFirstResponder:(NSControl<AutofillInputField>*)field { |
+ [validationDelegate_ updateMessageForField:field]; |
+} |
+ |
- (void)didChange:(id)sender { |
[self textfieldEditedOrActivated:sender edited:YES]; |
} |
- (void)didEndEditing:(id)sender { |
+ delegate_->FocusMoved(); |
+ [validationDelegate_ hideErrorBubble]; |
[self validateFor:autofill::VALIDATE_EDIT]; |
} |
@@ -392,11 +398,11 @@ bool CompareInputRows(const autofill::DetailInput* input1, |
gfx::Rect textFrameRect(NSRectToCGRect(textFrameInScreen)); |
delegate_->UserEditedOrActivatedInput(section_, |
- [self detailInputForType:type], |
- [self view], |
- textFrameRect, |
- fieldValue, |
- edited); |
+ [self detailInputForType:type], |
+ [self view], |
+ textFrameRect, |
+ fieldValue, |
+ edited); |
// If the field is marked as invalid, check if the text is now valid. |
// Many fields (i.e. CC#) are invalid for most of the duration of editing, |
@@ -634,6 +640,7 @@ bool CompareInputRows(const autofill::DetailInput* input1, |
NSControl<AutofillInputField>* field = [inputs_ viewWithTag:input.type]; |
[[field window] makeFirstResponder:field]; |
+ [self textfieldEditedOrActivated:field edited:NO]; |
} |
@end |