Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef UI_VIEWS_LAYOUT_VIEWS_LAYOUT_DELEGATE_H_ | |
| 6 #define UI_VIEWS_LAYOUT_VIEWS_LAYOUT_DELEGATE_H_ | |
| 7 | |
| 8 #include "base/macros.h" | |
| 9 #include "ui/gfx/geometry/insets.h" | |
| 10 #include "ui/views/style/typography_provider.h" | |
| 11 #include "ui/views/views_export.h" | |
| 12 | |
| 13 namespace views { | |
| 14 | |
| 15 enum InsetsMetric { | |
| 16 // The margins that should be applied around a bubble dialog. | |
| 17 BUBBLE_DIALOG, | |
| 18 // The insets that should be applied around a DialogClientView. Note that | |
| 19 // the top inset is used for the distance between the buttons and the | |
| 20 // DialogClientView's content view. | |
| 21 DIALOG_BUTTON, | |
| 22 // The insets that should be applied around a dialog's frame view. | |
| 23 DIALOG_FRAME_VIEW, | |
| 24 // Padding to add to vector image buttons to increase their click and touch | |
| 25 // target size. | |
| 26 VECTOR_IMAGE_BUTTON, | |
| 27 }; | |
| 28 | |
| 29 enum DistanceMetric { | |
| 30 // The default padding to add on each side of a button's label. | |
| 31 BUTTON_HORIZONTAL_PADDING, | |
| 32 // The distance between a dialog's edge and the close button in the upper | |
| 33 // trailing corner. | |
| 34 CLOSE_BUTTON_MARGIN, | |
| 35 // The default minimum width of a dialog button. | |
| 36 DIALOG_BUTTON_MINIMUM_WIDTH, | |
| 37 // The spacing between a pair of related horizontal buttons, used for | |
| 38 // dialog layout. | |
| 39 RELATED_BUTTON_HORIZONTAL, | |
| 40 // Horizontal spacing between controls that are logically related. | |
| 41 RELATED_CONTROL_HORIZONTAL, | |
| 42 // The spacing between a pair of related vertical controls, used for | |
| 43 // dialog layout. | |
| 44 RELATED_CONTROL_VERTICAL, | |
| 45 }; | |
| 46 | |
| 47 class VIEWS_EXPORT ViewsLayoutDelegate { | |
|
Peter Kasting
2017/04/04 02:08:56
Can we just call this LayoutDelegate, and call the
kylix_rd
2017/04/04 20:28:23
Now that the original LayoutDelegate and HarmonyLa
| |
| 48 public: | |
| 49 ViewsLayoutDelegate(); | |
| 50 virtual ~ViewsLayoutDelegate(); | |
| 51 | |
| 52 static ViewsLayoutDelegate* Get(); | |
| 53 | |
| 54 // Returns the insets metric according to the given enumeration element. | |
| 55 virtual gfx::Insets GetInsetsMetric(InsetsMetric metric) const; | |
| 56 | |
| 57 // Returns the distance metric between elements according to the given | |
| 58 // enumeration element. | |
|
Peter Kasting
2017/04/04 02:08:56
Nit: "Returns the distance for the given metric"?
kylix_rd
2017/04/04 20:28:23
Done.
Peter Kasting
2017/04/05 19:30:10
It seems at best unnecessary to me, but if you fee
| |
| 59 virtual int GetDistanceMetric(DistanceMetric metric) const; | |
| 60 | |
| 61 // Returns the TypographyProvider, used to configure text properties such as | |
| 62 // font, weight, color, size, and line height. Never null. | |
| 63 virtual const TypographyProvider& GetTypographyProvider() const; | |
| 64 | |
| 65 private: | |
| 66 DefaultTypographyProvider typography_provider_; | |
|
Peter Kasting
2017/04/04 02:08:56
Seems like this should be a static local in GetTyp
kylix_rd
2017/04/04 20:28:23
OK. I just moved the implementation from ViewsDele
| |
| 67 | |
| 68 DISALLOW_COPY_AND_ASSIGN(ViewsLayoutDelegate); | |
| 69 }; | |
| 70 | |
| 71 } // namespace views | |
| 72 | |
| 73 #endif // CHROME_BROWSER_UI_VIEWS_HARMONY_LAYOUT_DELEGATE_H_ | |
| OLD | NEW |