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

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

Issue 2871873003: [Payments] Fix up field widths in desktop editors. (Closed)
Patch Set: addressed comments 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 0a1a28c14ce430770d7cdef1efb4292446323d50..0246bfdf8d6a275c7daee7a2f82f848564a896a2 100644
--- a/chrome/browser/ui/views/payments/editor_view_controller.h
+++ b/chrome/browser/ui/views/payments/editor_view_controller.h
@@ -107,13 +107,16 @@ class EditorViewController : public PaymentRequestSheetController,
const TextFieldsMap& text_fields() const { return text_fields_; }
protected:
- // A very long label will wrap. Value picked so that left + right label
- // padding bring the label to half-way in the dialog (~225).
- static constexpr int kMaximumLabelWidth = 192;
-
+ // Create a header view to be inserted before all fields.
virtual std::unique_ptr<views::View> CreateHeaderView();
+ // Create a custom view for the specified |type|.
virtual std::unique_ptr<views::View> CreateCustomFieldView(
autofill::ServerFieldType type);
+ // Create an extra view to go to the right of the field with |type|, which
+ // can either be a textfield, combobox, or custom view.
+ virtual std::unique_ptr<views::View> CreateExtraViewForField(
+ autofill::ServerFieldType type);
+
// Returns the field definitions used to build the UI.
virtual std::vector<EditorField> GetFieldDefinitions() = 0;
virtual base::string16 GetInitialValueForType(
@@ -160,6 +163,10 @@ class EditorViewController : public PaymentRequestSheetController,
// added (see implementation).
void CreateInputField(views::GridLayout* layout, const EditorField& field);
+ // Returns the widest column width of across all extra views of a certain
+ // |size| type.
+ int ComputeWidestExtraViewWidth(EditorField::LengthHint size);
+
// Used to remember the association between the input field UI element and the
// original field definition. The ValidatingTextfield* and ValidatingCombobox*
// are owned by their parent view, this only keeps a reference that is good as

Powered by Google App Engine
This is Rietveld 408576698