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

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

Issue 2748133004: [Payments] View controllers no longer have access to PaymentRequest (Closed)
Patch Set: Initial Created 3 years, 9 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.cc
diff --git a/chrome/browser/ui/views/payments/credit_card_editor_view_controller.cc b/chrome/browser/ui/views/payments/credit_card_editor_view_controller.cc
index afff094908bfd31fbb7f7e0e08e572b6b83596de..647ac325f39a9c75031f50fbba41e40e4a01fdd2 100644
--- a/chrome/browser/ui/views/payments/credit_card_editor_view_controller.cc
+++ b/chrome/browser/ui/views/payments/credit_card_editor_view_controller.cc
@@ -28,8 +28,8 @@
#include "components/autofill/core/browser/validation.h"
#include "components/autofill/core/common/autofill_clock.h"
#include "components/autofill/core/common/autofill_constants.h"
-#include "components/payments/content/payment_request.h"
#include "components/payments/content/payment_request_spec.h"
+#include "components/payments/content/payment_request_state.h"
#include "components/strings/grit/components_strings.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/native_theme/native_theme.h"
@@ -80,9 +80,10 @@ std::vector<base::string16> GetExpirationYearItems() {
} // namespace
CreditCardEditorViewController::CreditCardEditorViewController(
- PaymentRequest* request,
+ PaymentRequestSpec* spec,
+ PaymentRequestState* state,
PaymentRequestDialogView* dialog)
- : EditorViewController(request, dialog) {}
+ : EditorViewController(spec, state, dialog) {}
CreditCardEditorViewController::~CreditCardEditorViewController() {}
@@ -124,7 +125,7 @@ CreditCardEditorViewController::CreateHeaderView() {
constexpr gfx::Size kCardIconSize = gfx::Size(30, 18);
for (const std::string& supported_network :
- request()->spec()->supported_card_networks()) {
+ spec()->supported_card_networks()) {
const std::string autofill_card_type =
autofill::data_util::GetCardTypeForBasicCardPaymentType(
supported_network);
@@ -190,7 +191,7 @@ bool CreditCardEditorViewController::ValidateModelAndSave() {
return false;
// Add the card (will not add a duplicate).
- request()->state()->GetPersonalDataManager()->AddCreditCard(credit_card);
+ state()->GetPersonalDataManager()->AddCreditCard(credit_card);
return true;
}
@@ -204,7 +205,7 @@ CreditCardEditorViewController::CreateValidationDelegate(
CreditCardEditorViewController::CreditCardValidationDelegate>(
field, this,
field.type == autofill::CREDIT_CARD_NUMBER
- ? request()->spec()->supported_card_networks()
+ ? spec()->supported_card_networks()
: std::vector<std::string>());
}

Powered by Google App Engine
This is Rietveld 408576698