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

Unified Diff: chrome/browser/ui/views/payments/shipping_address_editor_view_controller.h

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/shipping_address_editor_view_controller.h
diff --git a/chrome/browser/ui/views/payments/shipping_address_editor_view_controller.h b/chrome/browser/ui/views/payments/shipping_address_editor_view_controller.h
index 13e44b8d33eccf808aff6880439a22aac8e3ff76..4051673385eda1194576c548ed06479991c4d404 100644
--- a/chrome/browser/ui/views/payments/shipping_address_editor_view_controller.h
+++ b/chrome/browser/ui/views/payments/shipping_address_editor_view_controller.h
@@ -27,10 +27,13 @@ class PaymentRequestDialogView;
class ShippingAddressEditorViewController : public EditorViewController {
public:
// Does not take ownership of the arguments, which should outlive this object.
Mathieu 2017/04/24 20:05:19 it does take ownership of the callbacks :)
MAD 2017/04/25 14:23:49 Done.
- ShippingAddressEditorViewController(PaymentRequestSpec* spec,
- PaymentRequestState* state,
- PaymentRequestDialogView* dialog,
- autofill::AutofillProfile* profile);
+ ShippingAddressEditorViewController(
+ PaymentRequestSpec* spec,
+ PaymentRequestState* state,
+ PaymentRequestDialogView* dialog,
+ base::OnceClosure on_edited,
+ base::OnceCallback<void(const autofill::AutofillProfile&)> on_added,
+ autofill::AutofillProfile* profile);
~ShippingAddressEditorViewController() override;
// EditorViewController:
@@ -74,6 +77,12 @@ class ShippingAddressEditorViewController : public EditorViewController {
};
friend class ShippingAddressValidationDelegate;
+ // Called when |profile_to_edit_| was successfully edited.
+ base::OnceClosure on_edited_;
+ // Called when a new profile was added. The const reference is short-lived,
+ // and the callee should make a copy.
+ base::OnceCallback<void(const autofill::AutofillProfile&)> on_added_;
+
// If non-nullptr, a point to an object to be edited, which should outlive
// this controller.
autofill::AutofillProfile* profile_to_edit_;

Powered by Google App Engine
This is Rietveld 408576698