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

Unified Diff: components/payments/payment_request.cc

Issue 2673753005: [Payments] Basic validation in the credit card editor. (Closed)
Patch Set: more tests 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: components/payments/payment_request.cc
diff --git a/components/payments/payment_request.cc b/components/payments/payment_request.cc
index d7302df59c70c7fcda437a4df50d89570d0d376a..fd2fc4f54f366cd201807bc14cfc42f360bdb452 100644
--- a/components/payments/payment_request.cc
+++ b/components/payments/payment_request.cc
@@ -5,9 +5,7 @@
#include "components/payments/payment_request.h"
#include "base/memory/ptr_util.h"
-#include "components/autofill/core/browser/personal_data_manager.h"
#include "components/payments/payment_details_validation.h"
-#include "components/payments/payment_request_delegate.h"
#include "components/payments/payment_request_web_contents_manager.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/web_contents.h"
@@ -123,11 +121,8 @@ const std::vector<autofill::AutofillProfile*>&
autofill::CreditCard* PaymentRequest::GetCurrentlySelectedCreditCard() {
// TODO(anthonyvd): Change this code to prioritize server cards and implement
// a way to modify this function's return value.
- autofill::PersonalDataManager* data_manager =
- delegate_->GetPersonalDataManager();
-
const std::vector<autofill::CreditCard*> cards =
- data_manager->GetCreditCardsToSuggest();
+ personal_data_manager()->GetCreditCardsToSuggest();
auto first_complete_card = std::find_if(
cards.begin(),
@@ -140,10 +135,8 @@ autofill::CreditCard* PaymentRequest::GetCurrentlySelectedCreditCard() {
}
void PaymentRequest::PopulateProfileCache() {
- autofill::PersonalDataManager* data_manager =
- delegate_->GetPersonalDataManager();
std::vector<autofill::AutofillProfile*> profiles =
- data_manager->GetProfilesToSuggest();
+ personal_data_manager()->GetProfilesToSuggest();
// PaymentRequest may outlive the Profiles returned by the Data Manager.
// Thus, we store copies, and return a vector of pointers to these copies

Powered by Google App Engine
This is Rietveld 408576698