Index: chrome/browser/ui/cocoa/autofill/autofill_details_container.mm |
diff --git a/chrome/browser/ui/cocoa/autofill/autofill_details_container.mm b/chrome/browser/ui/cocoa/autofill/autofill_details_container.mm |
index 633bdf2342ccf1ae36a60e68948b74d4e1d8fb0b..5e7a3c2ee55b4a4b34d8f0a1152090b21a639b0a 100644 |
--- a/chrome/browser/ui/cocoa/autofill/autofill_details_container.mm |
+++ b/chrome/browser/ui/cocoa/autofill/autofill_details_container.mm |
@@ -100,6 +100,8 @@ typedef BOOL (^FieldFilterBlock)(NSView<AutofillInputField>*); |
} |
- (BOOL)validate { |
+ errorBubbleAnchorView_ = nil; |
Ilya Sherman
2014/01/08 00:25:37
Hmm, why does this reset the anchor view? Might b
groby-ooo-7-16
2014/01/08 20:15:31
You asked for it. It's long :)
|
+ |
bool allValid = true; |
for (AutofillSectionContainer* details in details_.get()) { |
if (![[details view] isHidden]) |
@@ -156,11 +158,20 @@ typedef BOOL (^FieldFilterBlock)(NSView<AutofillInputField>*); |
name:NSWindowWillCloseNotification |
object:[errorBubbleController_ window]]; |
errorBubbleController_ = nil; |
+ errorBubbleAnchorView_ = nil; |
} |
- (void)showErrorBubbleForField:(NSControl<AutofillInputField>*)field { |
- if (errorBubbleController_) |
+ // If there is already a bubble controller handling this field, reuse. |
+ if (errorBubbleController_ && errorBubbleAnchorView_ == field) { |
+ [errorBubbleController_ setMessage:[field validityMessage]]; |
+ |
+ return; |
+ } |
+ |
+ if (errorBubbleController_) { |
[errorBubbleController_ close]; |
+ } |
Ilya Sherman
2014/01/08 00:25:37
nit: Why curlies?
groby-ooo-7-16
2014/01/08 20:15:31
Habit. Done.
|
DCHECK(!errorBubbleController_); |
NSWindow* parentWindow = [field window]; |
DCHECK(parentWindow); |
@@ -203,6 +214,7 @@ typedef BOOL (^FieldFilterBlock)(NSView<AutofillInputField>*); |
[errorBubbleController_ setAnchorPoint: |
[parentWindow convertBaseToScreen:anchorPoint]]; |
+ errorBubbleAnchorView_ = field; |
[errorBubbleController_ showWindow:self]; |
} |