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

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

Issue 2871873003: [Payments] Fix up field widths in desktop editors. (Closed)
Patch Set: rebase 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..e5340ce6ea69ab86db777073bee57b7934bc056c 100644
--- a/chrome/browser/ui/views/payments/editor_view_controller.h
+++ b/chrome/browser/ui/views/payments/editor_view_controller.h
@@ -107,13 +107,12 @@ 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;
-
virtual std::unique_ptr<views::View> CreateHeaderView();
virtual std::unique_ptr<views::View> CreateCustomFieldView(
autofill::ServerFieldType type);
+ virtual std::unique_ptr<views::View> CreateExtraViewForField(
anthonyvd 2017/05/11 00:32:14 nit: add comment
Mathieu 2017/05/11 01:16:24 Done.
+ autofill::ServerFieldType type);
+
// Returns the field definitions used to build the UI.
virtual std::vector<EditorField> GetFieldDefinitions() = 0;
virtual base::string16 GetInitialValueForType(
@@ -160,6 +159,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