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

Unified Diff: components/payments/content/payment_request_state.cc

Issue 2841643002: When a new Payments address is created from the editor, use it as the chosen address (Closed)
Patch Set: And yet another small goof fix... :-( Created 3 years, 8 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
« no previous file with comments | « components/payments/content/payment_request_state.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/payments/content/payment_request_state.cc
diff --git a/components/payments/content/payment_request_state.cc b/components/payments/content/payment_request_state.cc
index 2d7768295648c8e79b77eaccb767030fdeec287e..5628fadf082bc092d1a9dd21c379a2b2d38253bf 100644
--- a/components/payments/content/payment_request_state.cc
+++ b/components/payments/content/payment_request_state.cc
@@ -105,6 +105,20 @@ void PaymentRequestState::AddAutofillPaymentInstrument(
SetSelectedInstrument(available_instruments_.back().get());
}
+void PaymentRequestState::AddAutofillShippingProfile(
+ bool selected,
+ const autofill::AutofillProfile& profile) {
+ profile_cache_.push_back(
+ base::MakeUnique<autofill::AutofillProfile>(profile));
+ // TODO(tmartino): Implement deduplication rules specific to shipping
+ // profiles.
+ autofill::AutofillProfile* new_cached_profile = profile_cache_.back().get();
+ shipping_profiles_.push_back(new_cached_profile);
+
+ if (selected)
+ SetSelectedShippingProfile(new_cached_profile);
+}
+
void PaymentRequestState::SetSelectedShippingOption(
const std::string& shipping_option_id) {
spec_->StartWaitingForUpdateWith(
« no previous file with comments | « components/payments/content/payment_request_state.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698