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

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

Issue 2849523003: Add billing address as a mandatory field of Payments credit cards. (Closed)
Patch Set: Moved label creation back to base class Created 3 years, 7 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/editor_view_controller.h
diff --git a/chrome/browser/ui/views/payments/editor_view_controller.h b/chrome/browser/ui/views/payments/editor_view_controller.h
index 402d6673a1b636747967ddb08d8a7753337f72a7..28a63f679d30f9ff24ed0a774a07f0bac37b136c 100644
--- a/chrome/browser/ui/views/payments/editor_view_controller.h
+++ b/chrome/browser/ui/views/payments/editor_view_controller.h
@@ -15,6 +15,7 @@
#include "base/macros.h"
#include "base/memory/ptr_util.h"
#include "base/strings/string16.h"
+#include "chrome/browser/ui/views/payments/payment_request_dialog_view.h"
#include "chrome/browser/ui/views/payments/payment_request_sheet_controller.h"
#include "chrome/browser/ui/views/payments/validation_delegate.h"
#include "components/autofill/core/browser/field_types.h"
@@ -37,14 +38,13 @@ namespace payments {
class PaymentRequestSpec;
class PaymentRequestState;
-class PaymentRequestDialogView;
class ValidatingCombobox;
class ValidatingTextfield;
// Field definition for an editor field, used to build the UI.
struct EditorField {
enum class LengthHint : int { HINT_LONG, HINT_SHORT };
- enum class ControlType : int { TEXTFIELD, COMBOBOX };
+ enum class ControlType : int { TEXTFIELD, COMBOBOX, CUSTOMFIELD };
EditorField(autofill::ServerFieldType type,
base::string16 label,
@@ -89,9 +89,13 @@ class EditorViewController : public PaymentRequestSheetController,
std::map<const EditorField, views::Label*, EditorField::Compare>;
// Does not take ownership of the arguments, which should outlive this object.
+ // |back_navigation_type| identifies what sort of back navigation should be
+ // done when editing is successful. This is independent of the back arrow
+ // which always goes back one step.
EditorViewController(PaymentRequestSpec* spec,
PaymentRequestState* state,
- PaymentRequestDialogView* dialog);
+ PaymentRequestDialogView* dialog,
+ BackNavigationType back_navigation_type);
~EditorViewController() override;
// Will display |error_message| alongside the input field represented by
@@ -104,6 +108,8 @@ class EditorViewController : public PaymentRequestSheetController,
protected:
virtual std::unique_ptr<views::View> CreateHeaderView() = 0;
+ virtual std::unique_ptr<views::View> CreateCustomFieldView(
+ autofill::ServerFieldType type) = 0;
// Returns the field definitions used to build the UI.
virtual std::vector<EditorField> GetFieldDefinitions() = 0;
virtual base::string16 GetInitialValueForType(
@@ -131,11 +137,11 @@ class EditorViewController : public PaymentRequestSheetController,
// UpdateEditorView.
virtual void UpdateEditorView();
- private:
// PaymentRequestSheetController:
void ButtonPressed(views::Button* sender, const ui::Event& event) override;
views::View* GetFirstFocusedView() override;
+ private:
// views::TextfieldController:
void ContentsChanged(views::Textfield* sender,
const base::string16& new_contents) override;
@@ -162,6 +168,9 @@ class EditorViewController : public PaymentRequestSheetController,
// The first label in the editor, used to set the initial focus.
views::View* first_field_view_;
+ // Identifies where to go back when the editing completes successfully.
+ BackNavigationType back_navigation_type_;
+
DISALLOW_COPY_AND_ASSIGN(EditorViewController);
};

Powered by Google App Engine
This is Rietveld 408576698