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

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

Issue 2807363003: [Payments] After adding/editing a credit card, instrument is selected. (Closed)
Patch Set: include 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 | « no previous file | chrome/browser/ui/views/payments/credit_card_editor_view_controller.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/payments/credit_card_editor_view_controller.h
diff --git a/chrome/browser/ui/views/payments/credit_card_editor_view_controller.h b/chrome/browser/ui/views/payments/credit_card_editor_view_controller.h
index d10a2fbdb0d37438ef6bdaeedf2598d5f34a1553..3ee16784e6004a5cbc1ec9afefc31b07ee6d3718 100644
--- a/chrome/browser/ui/views/payments/credit_card_editor_view_controller.h
+++ b/chrome/browser/ui/views/payments/credit_card_editor_view_controller.h
@@ -10,6 +10,7 @@
#include <string>
#include <vector>
+#include "base/callback_forward.h"
#include "base/macros.h"
#include "chrome/browser/ui/views/payments/editor_view_controller.h"
#include "chrome/browser/ui/views/payments/validation_delegate.h"
@@ -32,10 +33,13 @@ class CreditCardEditorViewController : public EditorViewController {
// Additionally, |credit_card| could be nullptr if we are adding a card. Else,
// it's a valid pointer to a card that needs to be updated, and which will
// outlive this controller.
- CreditCardEditorViewController(PaymentRequestSpec* spec,
- PaymentRequestState* state,
- PaymentRequestDialogView* dialog,
- autofill::CreditCard* credit_card);
+ CreditCardEditorViewController(
+ PaymentRequestSpec* spec,
+ PaymentRequestState* state,
+ PaymentRequestDialogView* dialog,
+ base::OnceClosure on_edited,
+ base::OnceCallback<void(const autofill::CreditCard&)> on_added,
+ autofill::CreditCard* credit_card);
~CreditCardEditorViewController() override;
// EditorViewController:
@@ -82,6 +86,12 @@ class CreditCardEditorViewController : public EditorViewController {
DISALLOW_COPY_AND_ASSIGN(CreditCardValidationDelegate);
};
+ // Called when |credit_card_to_edit_| was successfully edited.
+ base::OnceClosure on_edited_;
+ // Called when a new card was added. The const reference is short-lived, and
+ // the callee should make a copy.
+ base::OnceCallback<void(const autofill::CreditCard&)> on_added_;
+
// If non-nullptr, a pointer to an object to be edited. Must outlive this
// controller.
autofill::CreditCard* credit_card_to_edit_;
« no previous file with comments | « no previous file | chrome/browser/ui/views/payments/credit_card_editor_view_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698