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

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

Issue 2841643002: When a new Payments address is created from the editor, use it as the chosen address (Closed)
Patch Set: Self CR 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
Index: chrome/browser/ui/views/payments/profile_list_view_controller.cc
diff --git a/chrome/browser/ui/views/payments/profile_list_view_controller.cc b/chrome/browser/ui/views/payments/profile_list_view_controller.cc
index 419b51e4fc07ec05fb7e9b87d7a7c7c1bd70c037..167dc5b7c7656f07bf9e78623e6cca8ed4b86e3a 100644
--- a/chrome/browser/ui/views/payments/profile_list_view_controller.cc
+++ b/chrome/browser/ui/views/payments/profile_list_view_controller.cc
@@ -81,7 +81,12 @@ class ProfileItem : public PaymentRequestItemList::Item {
}
void PerformSelectionFallback() override {
- dialog_->ShowShippingAddressEditor(profile_);
+ dialog_->ShowShippingAddressEditor(
+ /*on_edited=*/base::BindOnce(
+ &PaymentRequestState::SetSelectedShippingProfile,
+ base::Unretained(state()), profile_),
+ /*on_added=*/
+ base::OnceCallback<void(const autofill::AutofillProfile&)>(), profile_);
}
ProfileListViewController* parent_view_;
@@ -145,7 +150,12 @@ class ShippingProfileViewController : public ProfileListViewController {
}
void OnSecondaryButtonPressed() override {
- dialog()->ShowShippingAddressEditor();
+ dialog()->ShowShippingAddressEditor(
+ /*on_edited=*/base::OnceClosure(),
+ /*on_added=*/
+ base::BindOnce(&PaymentRequestState::AddAutofillShippingProfile,
+ base::Unretained(state()), /*selected=*/true),
+ /*profile=*/nullptr);
}
private:

Powered by Google App Engine
This is Rietveld 408576698