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

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

Issue 2805263003: [Payments] Selecting incomplete items will open editors (Closed)
Patch Set: fix ios test for realz 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 c3f5b6caef24e2ec4e2f6d73c8aca23ee659a593..d10a2fbdb0d37438ef6bdaeedf2598d5f34a1553 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
@@ -15,6 +15,10 @@
#include "chrome/browser/ui/views/payments/validation_delegate.h"
#include "ui/base/models/simple_combobox_model.h"
+namespace autofill {
+class CreditCard;
+} // namespace autofill
+
namespace payments {
class PaymentRequestSpec;
@@ -25,14 +29,20 @@ class PaymentRequestDialogView;
class CreditCardEditorViewController : public EditorViewController {
public:
// Does not take ownership of the arguments, which should outlive this object.
+ // 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);
+ PaymentRequestDialogView* dialog,
+ autofill::CreditCard* credit_card);
~CreditCardEditorViewController() override;
// EditorViewController:
std::unique_ptr<views::View> CreateHeaderView() override;
std::vector<EditorField> GetFieldDefinitions() override;
+ base::string16 GetInitialValueForType(
+ autofill::ServerFieldType type) override;
bool ValidateModelAndSave() override;
std::unique_ptr<ValidationDelegate> CreateValidationDelegate(
const EditorField& field) override;
@@ -72,6 +82,10 @@ class CreditCardEditorViewController : public EditorViewController {
DISALLOW_COPY_AND_ASSIGN(CreditCardValidationDelegate);
};
+ // If non-nullptr, a pointer to an object to be edited. Must outlive this
+ // controller.
+ autofill::CreditCard* credit_card_to_edit_;
+
DISALLOW_COPY_AND_ASSIGN(CreditCardEditorViewController);
};
« 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