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

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

Issue 2881643002: Focus first invalid field of payment request editor (Closed)
Patch Set: Rebase 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..e82bc0bde70a66d7c152218185ab85e6fabf7be8 100644
--- a/chrome/browser/ui/views/payments/validating_textfield.cc
+++ b/chrome/browser/ui/views/payments/validating_textfield.cc
@@ -22,7 +22,7 @@ void ValidatingTextfield::OnBlur() {
// removed.
if (!was_blurred_ && !being_removed_) {
was_blurred_ = true;
- Validate();
+ Validate(/*display_error=*/true);
}
}
@@ -38,12 +38,12 @@ void ValidatingTextfield::OnContentsChanged() {
if (!was_blurred_)
return;
- Validate();
+ Validate(/*display_error=*/true);
}
-void ValidatingTextfield::Validate() {
+void ValidatingTextfield::Validate(bool display_error) {
// ValidateTextfield may have side-effects, such as displaying errors.
- SetInvalid(!delegate_->ValidateTextfield(this));
+ SetInvalid(!delegate_->ValidateTextfield(this, display_error));
}
} // namespace payments

Powered by Google App Engine
This is Rietveld 408576698