[Payments] Basic validation in the credit card editor.

Introducting the ValidatingTextfield class, which will be used to validate only on first blur, and on every subsequent contents change.

Created validation methods in autofill code, which will return the proper error messages (to be displayed in a follow-up CL).

BUG=687601
TEST=ValidatingTextfieldTest unit_tests, PaymentRequest* interactive_ui_tests, AutofillValidation components_unittests

Review-Url: https://codereview.chromium.org/2673753005
Cr-Commit-Position: refs/heads/master@{#449409}
diff --git a/components/payments/payment_request.h b/components/payments/payment_request.h
index a2caab9..cd54b7c 100644
--- a/components/payments/payment_request.h
+++ b/components/payments/payment_request.h
@@ -9,8 +9,10 @@
 #include <string>
 #include <vector>
 
+#include "components/autofill/core/browser/personal_data_manager.h"
 #include "components/payments/currency_formatter.h"
 #include "components/payments/payment_request.mojom.h"
+#include "components/payments/payment_request_delegate.h"
 #include "mojo/public/cpp/bindings/binding.h"
 
 namespace autofill {
@@ -24,7 +26,6 @@
 
 namespace payments {
 
-class PaymentRequestDelegate;
 class PaymentRequestWebContentsManager;
 
 class PaymentRequest : payments::mojom::PaymentRequest {
@@ -95,6 +96,10 @@
   // card.
   autofill::CreditCard* GetCurrentlySelectedCreditCard();
 
+  autofill::PersonalDataManager* personal_data_manager() {
+    return delegate_->GetPersonalDataManager();
+  }
+
   payments::mojom::PaymentDetails* details() { return details_.get(); }
   content::WebContents* web_contents() { return web_contents_; }