Chromium Code Reviews| 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. |