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

Unified Diff: chrome/browser/ui/views/payments/payment_method_view_controller.cc

Issue 2849523003: Add billing address as a mandatory field of Payments credit cards. (Closed)
Patch Set: Components Unittests 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/payment_method_view_controller.cc
diff --git a/chrome/browser/ui/views/payments/payment_method_view_controller.cc b/chrome/browser/ui/views/payments/payment_method_view_controller.cc
index 2a2aea501d380dfd1ec735d65dbbbb0c4621a2e3..1e62d5f457aac7c70d85ec220b908c94e73347b9 100644
--- a/chrome/browser/ui/views/payments/payment_method_view_controller.cc
+++ b/chrome/browser/ui/views/payments/payment_method_view_controller.cc
@@ -44,6 +44,8 @@ enum class PaymentMethodViewControllerTags : int {
// The tag for the button that triggers the "add card" flow. Starts at
// |kFirstTagValue| not to conflict with tags common to all views.
ADD_CREDIT_CARD_BUTTON = kFirstTagValue,
+ // This value is passed to inner views so they can use it as a starting tag.
+ MAX_TAG,
};
class PaymentMethodListItem : public payments::PaymentRequestItemList::Item {
@@ -121,9 +123,11 @@ class PaymentMethodListItem : public payments::PaymentRequestItemList::Item {
case PaymentInstrument::Type::AUTOFILL:
// Since we are a list item, we only care about the on_edited callback.
dialog_->ShowCreditCardEditor(
- /*on_edited=*/base::BindOnce(
- &PaymentRequestState::SetSelectedInstrument,
- base::Unretained(state()), instrument_),
+ BackNavigationType::kPaymentSheet,
+ static_cast<int>(PaymentMethodViewControllerTags::MAX_TAG),
+ /*on_edited=*/
+ base::BindOnce(&PaymentRequestState::SetSelectedInstrument,
+ base::Unretained(state()), instrument_),
/*on_added=*/
base::OnceCallback<void(const autofill::CreditCard&)>(),
static_cast<AutofillPaymentInstrument*>(instrument_)
@@ -199,6 +203,8 @@ void PaymentMethodViewController::ButtonPressed(views::Button* sender,
PaymentMethodViewControllerTags::ADD_CREDIT_CARD_BUTTON):
// Only provide the |on_added| callback, in response to this button.
dialog()->ShowCreditCardEditor(
+ BackNavigationType::kPaymentSheet,
+ static_cast<int>(PaymentMethodViewControllerTags::MAX_TAG),
/*on_edited=*/base::OnceClosure(),
/*on_added=*/
base::BindOnce(&PaymentRequestState::AddAutofillPaymentInstrument,

Powered by Google App Engine
This is Rietveld 408576698