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

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

Issue 2873002: AutoFill Mac UI : Validation, CVC Removal, Credit Card year list. (Closed)
Patch Set: Sync with ToT Created 10 years, 6 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
Index: chrome/browser/autofill/autofill_dialog_controller_mac.mm
diff --git a/chrome/browser/autofill/autofill_dialog_controller_mac.mm b/chrome/browser/autofill/autofill_dialog_controller_mac.mm
index 7d37d85d55e753fcaac5ca8f1248d071b71fca3b..d39c4568b45ff2cd99b764fef152b7dbeb5ae51a 100644
--- a/chrome/browser/autofill/autofill_dialog_controller_mac.mm
+++ b/chrome/browser/autofill/autofill_dialog_controller_mac.mm
@@ -764,6 +764,12 @@ void PersonalDataManagerObserver::OnPersonalDataLoaded() {
- (id)transformedValue:(id)string {
NSImage* image = nil;
ResourceBundle& rb = ResourceBundle::GetSharedInstance();
+
+ // We display no validation icon when input has not yet been entered.
+ if (string == nil || [string length] == 0)
+ return nil;
+
+ // If we have input then display alert icon if we have an invalid number.
if (string != nil && [string length] != 0) {
// TODO(dhollowa): Using SetInfo() call to validate phone number. Should
// have explicit validation method. More robust validation is needed as
@@ -778,6 +784,7 @@ void PersonalDataManagerObserver::OnPersonalDataLoaded() {
}
}
+ // No alert icon, so must be valid input.
if (!image) {
image = rb.GetNSImageNamed(IDR_INPUT_GOOD);
DCHECK(image);

Powered by Google App Engine
This is Rietveld 408576698