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

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

Issue 2713873002: [Payments] Add validation for unsupported credit card types in editor. (Closed)
Patch Set: un format 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/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 c13e8f7a6000940311b250c3f85c510cf4794744..86116bf95bf0277ebae8b6eda261068b79cecd17 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
@@ -5,6 +5,8 @@
#ifndef CHROME_BROWSER_UI_VIEWS_PAYMENTS_CREDIT_CARD_EDITOR_VIEW_CONTROLLER_H_
#define CHROME_BROWSER_UI_VIEWS_PAYMENTS_CREDIT_CARD_EDITOR_VIEW_CONTROLLER_H_
+#include <set>
+
#include "base/macros.h"
#include "chrome/browser/ui/views/payments/editor_view_controller.h"
#include "chrome/browser/ui/views/payments/validation_delegate.h"
@@ -35,8 +37,14 @@ class CreditCardEditorViewController : public EditorViewController {
private:
class CreditCardValidationDelegate : public ValidationDelegate {
public:
- CreditCardValidationDelegate(const EditorField& field,
- EditorViewController* controller);
+ // Used to validate |field| type. A reference to the |controller| should
+ // outlive this delegate, and a list of |supported_card_networks| can be
+ // passed in if it's thought to be used to validate |field| (the data will
anthonyvd 2017/02/23 16:42:27 nit: not sure what "if it's thought to be used to
Mathieu 2017/02/23 16:48:31 Done.
+ // be copied to the delegate).
+ CreditCardValidationDelegate(
+ const EditorField& field,
+ EditorViewController* controller,
+ const std::vector<std::string>& supported_card_networks);
~CreditCardValidationDelegate() override;
// ValidationDelegate:
@@ -50,6 +58,8 @@ class CreditCardEditorViewController : public EditorViewController {
EditorField field_;
// Outlives this class.
EditorViewController* controller_;
+ // The list of supported basic card networks.
+ std::set<std::string> supported_card_networks_;
DISALLOW_COPY_AND_ASSIGN(CreditCardValidationDelegate);
};

Powered by Google App Engine
This is Rietveld 408576698