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

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

Issue 2894943002: Prevent existing card number to be used for new credit cards in the Payment Request (Closed)
Patch Set: Fixed unit tests crash 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
« no previous file with comments | « no previous file | 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 1b08203db3db8182c7dc91272db72c2516acb53e..3ca4168b463d95b181f2385d46f498e59c4480a6 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
@@ -67,6 +67,10 @@ class CreditCardEditorViewController : public EditorViewController {
// higher opacity. If empty string, selects none of them (all full opacity).
void SelectBasicCardNetworkIcon(const std::string& basic_card_network);
+ // Exposed for validation delegate.
+ bool IsValidCreditCardNumber(const base::string16& card_number,
+ base::string16* error_message);
+
protected:
// PaymentRequestSheetController:
void FillContentView(views::View* content_view) override;
@@ -77,12 +81,9 @@ class CreditCardEditorViewController : public EditorViewController {
class CreditCardValidationDelegate : public ValidationDelegate {
public:
// 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 to validate |field| (the data will be copied to the delegate).
- CreditCardValidationDelegate(
- const EditorField& field,
- CreditCardEditorViewController* controller,
- const std::vector<std::string>& supported_card_networks);
+ // outlive this delegate.
+ CreditCardValidationDelegate(const EditorField& field,
+ CreditCardEditorViewController* controller);
~CreditCardValidationDelegate() override;
// ValidationDelegate:
@@ -105,8 +106,6 @@ class CreditCardEditorViewController : public EditorViewController {
EditorField field_;
// Outlives this class.
CreditCardEditorViewController* controller_;
- // The list of supported basic card networks.
- std::set<std::string> supported_card_networks_;
DISALLOW_COPY_AND_ASSIGN(CreditCardValidationDelegate);
};
@@ -135,6 +134,9 @@ class CreditCardEditorViewController : public EditorViewController {
// The value to use for the add billing address button tag.
int add_billing_address_button_tag_;
+ // The list of supported basic card networks.
+ std::set<std::string> supported_card_networks_;
+
DISALLOW_COPY_AND_ASSIGN(CreditCardEditorViewController);
};
« no previous file with comments | « no previous file | 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