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

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

Issue 2905733002: [WebPayments] Disabling done button when form invalid (Closed)
Patch Set: nits 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/contact_info_editor_view_controller.cc
diff --git a/chrome/browser/ui/views/payments/contact_info_editor_view_controller.cc b/chrome/browser/ui/views/payments/contact_info_editor_view_controller.cc
index f500fd02f1d56f920f0d4686e7e3f531d6c0637b..abd4fcbb165fd299d5e2f4de7d1ab4d4b3eab4d4 100644
--- a/chrome/browser/ui/views/payments/contact_info_editor_view_controller.cc
+++ b/chrome/browser/ui/views/payments/contact_info_editor_view_controller.cc
@@ -82,7 +82,7 @@ base::string16 ContactInfoEditorViewController::GetInitialValueForType(
bool ContactInfoEditorViewController::ValidateModelAndSave() {
// TODO(crbug.com/712224): Move this method and its helpers to a base class
// shared with the Shipping Address editor.
- if (!ValidateModel())
+ if (!ValidateInputFields())
return false;
if (profile_to_edit_) {
@@ -125,16 +125,6 @@ base::string16 ContactInfoEditorViewController::GetSheetTitle() {
IDS_PAYMENTS_ADD_CONTACT_DETAILS_LABEL);
}
-bool ContactInfoEditorViewController::ValidateModel() {
- for (const auto& field : text_fields()) {
- // Force a blur, as validation only occurs after the first blur.
- field.first->OnBlur();
- if (field.first->invalid())
- return false;
- }
- return true;
-}
-
void ContactInfoEditorViewController::PopulateProfile(
autofill::AutofillProfile* profile) {
for (const auto& field : text_fields()) {

Powered by Google App Engine
This is Rietveld 408576698