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

Unified Diff: chrome/browser/ui/views/payments/credit_card_editor_view_controller.h

Issue 2673753005: [Payments] Basic validation in the credit card editor. (Closed)
Patch Set: rebase 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
« no previous file with comments | « chrome/browser/ui/BUILD.gn ('k') | chrome/browser/ui/views/payments/credit_card_editor_view_controller.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/payments/credit_card_editor_view_controller.h
diff --git a/chrome/browser/ui/views/payments/credit_card_editor_view_controller.h b/chrome/browser/ui/views/payments/credit_card_editor_view_controller.h
index c30a3e67a9c5957910ac4baaff8996ac608c65ee..15e07fc6eef20bce22e62b52e261eff10e3688c6 100644
--- a/chrome/browser/ui/views/payments/credit_card_editor_view_controller.h
+++ b/chrome/browser/ui/views/payments/credit_card_editor_view_controller.h
@@ -7,6 +7,7 @@
#include "base/macros.h"
#include "chrome/browser/ui/views/payments/editor_view_controller.h"
+#include "chrome/browser/ui/views/payments/validating_textfield.h"
namespace payments {
@@ -21,11 +22,27 @@ class CreditCardEditorViewController : public EditorViewController {
PaymentRequestDialogView* dialog);
~CreditCardEditorViewController() override;
- // EditorViewController implementation.
+ // EditorViewController:
std::vector<EditorField> GetFieldDefinitions() override;
bool ValidateModelAndSave() override;
+ std::unique_ptr<ValidatingTextfield::Delegate> CreateValidationDelegate(
+ const EditorField& field) override;
private:
+ class ValidationDelegate : public ValidatingTextfield::Delegate {
+ public:
+ explicit ValidationDelegate(const EditorField& field);
+ ~ValidationDelegate() override;
+
+ // ValidatingTextfield::Delegate:
+ bool ValidateTextfield(views::Textfield* textfield) override;
+
+ private:
+ EditorField field_;
+
+ DISALLOW_COPY_AND_ASSIGN(ValidationDelegate);
+ };
+
DISALLOW_COPY_AND_ASSIGN(CreditCardEditorViewController);
};
« no previous file with comments | « chrome/browser/ui/BUILD.gn ('k') | chrome/browser/ui/views/payments/credit_card_editor_view_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698