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 2625183002: [WebPayments] Adding Shipping Address and Contact Info display to order summary (Closed)
Patch Set: Rebasing with anthonyvd changes Created 3 years, 11 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 06ec2b4f46562699b0baa795d00e07d512754bd2..6580c39d46c9491bc56198605b63906497171916 100644
--- a/components/payments/payment_request.cc
+++ b/components/payments/payment_request.cc
@@ -74,6 +74,19 @@ CurrencyFormatter* PaymentRequest::GetOrCreateCurrencyFormatter(
return currency_formatter_.get();
}
+autofill::AutofillProfile* PaymentRequest::GetCurrentlySelectedProfile() {
+ // TODO(tmartino): Implement more sophisticated algorithm for populating
+ // this when it starts empty.
+ if (!profile_) {
+ autofill::PersonalDataManager* data_manager =
+ delegate_->GetPersonalDataManager();
+ auto profiles = data_manager->GetProfiles();
please use gerrit instead 2017/01/18 18:50:48 By the way, GetPersonalDataManager() and GetProfil
+ if (!profiles.empty())
+ profile_ = profiles[0];
+ }
+ return profile_ ? profile_.value() : nullptr;
+}
+
autofill::CreditCard* PaymentRequest::GetCurrentlySelectedCreditCard() {
// TODO(anthonyvd): Change this code to prioritize server cards and implement
// a way to modify this function's return value.
« components/payments/payment_request.h ('K') | « components/payments/payment_request.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698