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

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

Issue 2689363004: [Payments] Add combobox support to editors. (Closed)
Patch Set: re-enable test, addressed comments Created 3 years, 10 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 96361cc1d2c84df8b7b6ac44dfbeca4bafd2d44f..5b33619368648401a18eff081c7a806afd78ee12 100644
--- a/chrome/browser/ui/views/payments/validating_textfield.cc
+++ b/chrome/browser/ui/views/payments/validating_textfield.cc
@@ -9,8 +9,8 @@
namespace payments {
ValidatingTextfield::ValidatingTextfield(
- std::unique_ptr<ValidatingTextfield::Delegate> delegate)
- : Textfield(), delegate_(std::move(delegate)) {}
+ std::unique_ptr<ValidationDelegate> delegate)
+ : Textfield(), delegate_(std::move(delegate)), was_blurred_(false) {}
ValidatingTextfield::~ValidatingTextfield() {}
@@ -19,8 +19,8 @@ void ValidatingTextfield::OnBlur() {
// The first validation should be on a blur. The subsequent validations will
// occur when the content changes.
- if (!was_validated_) {
- was_validated_ = true;
+ if (!was_blurred_) {
+ was_blurred_ = true;
Validate();
}
}
@@ -28,7 +28,7 @@ void ValidatingTextfield::OnBlur() {
void ValidatingTextfield::OnContentsChanged() {
// Validation on every keystroke only happens if the field has been validated
// before as part of a blur.
- if (!was_validated_)
+ if (!was_blurred_)
return;
Validate();

Powered by Google App Engine
This is Rietveld 408576698