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

Unified Diff: chrome/browser/autofill/autofill_text_field_mac.mm

Issue 2878050: AutoFill credit card settings dialog should display obfuscated number in edit field (Closed)
Patch Set: Created 10 years, 5 months 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/autofill/autofill_text_field_mac.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/autofill/autofill_text_field_mac.mm
diff --git a/chrome/browser/autofill/autofill_text_field_mac.mm b/chrome/browser/autofill/autofill_text_field_mac.mm
index ff5b1a0bd39911f0c06edd66e063b567920a34a2..509b1a6e3c65f0035a6380d53537d645e322e355 100644
--- a/chrome/browser/autofill/autofill_text_field_mac.mm
+++ b/chrome/browser/autofill/autofill_text_field_mac.mm
@@ -10,22 +10,18 @@
@implementation AutoFillTextField
- (void)awakeFromNib {
- if ([self tag] == AUTOFILL_CC_TAG)
+ // Fields tagged with this value in the nib file will be treated as credit
+ // card number fields.
+ const int kAutoFillCreditCardTag = 22;
+
+ if ([self tag] == kAutoFillCreditCardTag) {
isCreditCardField_ = YES;
-}
-// Override NSResponder method for when the text field may gain focus. We
-// call |scrollRectToVisible| to ensure that this text field is visible within
-// the scrolling area.
-- (BOOL)becomeFirstResponder {
- // Vertical inset is negative to indicate "outset". Provides some visual
- // space above and below when tabbing between fields.
- const CGFloat kVerticalInset = -40.0;
- BOOL becoming = [super becomeFirstResponder];
- if (becoming) {
- [self scrollRectToVisible:NSInsetRect([self bounds], 0.0, kVerticalInset)];
+ // KVO bindings initialize fields prior to |awakeFromNib|. In the credit
+ // card field case we need to re-initialize the value to the obfuscated
+ // version.
+ [self setObjectValue:[self objectValue]];
}
- return becoming;
}
- (void)setObjectValue:(id)object {
@@ -51,6 +47,7 @@
// fetched if it is changed, and since we force selection, that should clear
// the obfuscation. Nevertheless, we'll be paranoid here since we don't want
// the obfuscating ***s to end up in the database.
+ NOTREACHED();
return obfuscatedValue_.get();
} else {
return [super objectValue];
« no previous file with comments | « chrome/browser/autofill/autofill_text_field_mac.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698