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

Unified Diff: chrome/browser/ui/views/payments/validating_textfield.cc

Issue 2881643002: Focus first invalid field of payment request editor (Closed)
Patch Set: Last final nit :-) Created 3 years, 7 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/ui/views/payments/validating_textfield.cc
diff --git a/chrome/browser/ui/views/payments/validating_textfield.cc b/chrome/browser/ui/views/payments/validating_textfield.cc
index 0f5204c4c5cceb328b57a76bb59f360f21d0e4ee..fe3d02d22062309f6ae8205ee86349fdf68d66d0 100644
--- a/chrome/browser/ui/views/payments/validating_textfield.cc
+++ b/chrome/browser/ui/views/payments/validating_textfield.cc
@@ -41,9 +41,15 @@ void ValidatingTextfield::OnContentsChanged() {
Validate();
}
+bool ValidatingTextfield::IsValid() {
+ bool valid = delegate_->IsValidTextfield(this);
+ SetInvalid(!valid);
+ return valid;
+}
+
void ValidatingTextfield::Validate() {
- // ValidateTextfield may have side-effects, such as displaying errors.
- SetInvalid(!delegate_->ValidateTextfield(this));
+ // TextfieldValueChanged may have side-effects, such as displaying errors.
+ SetInvalid(!delegate_->TextfieldValueChanged(this));
}
} // namespace payments

Powered by Google App Engine
This is Rietveld 408576698