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

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: Merge fluke fix 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/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 863e4e3be2ddf76027cccafe5da3e3b679f90793..7f20d50a841b7122896ab5946e67eff99a21fde6 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
@@ -63,6 +63,10 @@ class CreditCardEditorViewController : public EditorViewController {
std::unique_ptr<ui::ComboboxModel> GetComboboxModelForType(
const autofill::ServerFieldType& type) override;
+ // Exposed for validation delegate.
+ bool IsValidCreditCardNumber(const base::string16& card_number,
+ base::string16* error_message);
+
protected:
// PaymentRequestSheetController:
void FillContentView(views::View* content_view) override;
@@ -73,12 +77,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,
- EditorViewController* controller,
- const std::vector<std::string>& supported_card_networks);
+ // outlive this delegate.
+ CreditCardValidationDelegate(const EditorField& field,
+ CreditCardEditorViewController* controller);
~CreditCardValidationDelegate() override;
// ValidationDelegate:
@@ -97,9 +98,7 @@ 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_;
+ CreditCardEditorViewController* controller_;
DISALLOW_COPY_AND_ASSIGN(CreditCardValidationDelegate);
};
@@ -124,6 +123,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);
};

Powered by Google App Engine
This is Rietveld 408576698