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

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

Issue 51933002: [rAC, OSX] Autofill popup should be shown on 2nd click. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix test helper. 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_textfield.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_textfield.mm
diff --git a/chrome/browser/ui/cocoa/autofill/autofill_textfield.mm b/chrome/browser/ui/cocoa/autofill/autofill_textfield.mm
index 0d855ca863abbcce1e2141dd67d24f2346e29aa1..6ee5aa9eb8cb5beb63ef45a0885cdb588715d419 100644
--- a/chrome/browser/ui/cocoa/autofill/autofill_textfield.mm
+++ b/chrome/browser/ui/cocoa/autofill/autofill_textfield.mm
@@ -40,11 +40,30 @@ const CGFloat kMinimumHeight = 27.0; // Enforced minimum height for text cells.
- (BOOL)becomeFirstResponder {
BOOL result = [super becomeFirstResponder];
- if (result && delegate_)
+ if (result && delegate_) {
[delegate_ fieldBecameFirstResponder:self];
+ shouldFilterClick_ = YES;
+ }
return result;
}
+- (void)onEditorMouseDown:(id)sender {
+ // Since the dialog does not care about clicks that gave firstResponder
+ // status, swallow those.
+ if (!handlingFirstClick_)
+ [delegate_ onMouseDown: self];
+}
+
+- (void)mouseDown:(NSEvent*)theEvent {
+ // mouseDown: is only invoked for a click that actually gave firstResponder
+ // status to the NSTextField, and clicks to the border area. Further clicks
+ // into the content are are handled by the field editor instead.
+ handlingFirstClick_ = shouldFilterClick_;
+ [super mouseDown:theEvent];
+ handlingFirstClick_ = NO;
+ shouldFilterClick_ = NO;
+}
+
- (void)controlTextDidEndEditing:(NSNotification*)notification {
if (delegate_)
[delegate_ didEndEditing:self];
@@ -90,6 +109,7 @@ const CGFloat kMinimumHeight = 27.0; // Enforced minimum height for text cells.
@end
+
@implementation AutofillTextFieldCell
@synthesize invalid = invalid_;
« no previous file with comments | « chrome/browser/ui/cocoa/autofill/autofill_textfield.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698