Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2016 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 CHROME_BROWSER_UI_VIEWS_HARMONY_LAYOUT_DELEGATE_H_ | |
| 6 #define CHROME_BROWSER_UI_VIEWS_HARMONY_LAYOUT_DELEGATE_H_ | |
| 7 | |
| 8 #include "ui/views/layout/grid_layout.h" | |
| 9 | |
| 10 class LayoutDelegate { | |
| 11 public: | |
| 12 enum class LayoutDistanceType { | |
| 13 PANEL_VERT_MARGIN, | |
| 14 RELATED_CONTROL_HORIZONTAL_SPACING, | |
| 15 RELATED_CONTROL_VERTICAL_SPACING, | |
| 16 RELATED_BUTTON_HORIZONTAL_SPACING, | |
| 17 UNRELATED_CONTROL_VERTICAL_SPACING, | |
| 18 UNRELATED_CONTROL_LARGE_VERTICAL_SPACING, | |
| 19 BUTTON_HEDGE_MARGIN_NEW, | |
| 20 BUTTON_VEDGE_MARGIN_NEW, | |
| 21 }; | |
| 22 | |
| 23 LayoutDelegate() {} | |
| 24 virtual ~LayoutDelegate() {} | |
| 25 | |
| 26 // Returns the singleton LayoutDelegate instance. | |
| 27 static LayoutDelegate* Get(); | |
|
sky
2016/11/15 17:43:38
Thanks for the improved docs in GetActiveInstance.
Elly Fong-Jones
2016/11/15 19:47:26
Done.
| |
| 28 | |
| 29 // Returns the active LayoutDelegate singleton, depending on UI configuration. | |
| 30 // By default, this is the same instance returned by Get(), but if Harmony | |
| 31 // or another UI style is enabled, this may be an instance of a LayoutDelegate | |
| 32 // subclass instead. | |
| 33 static LayoutDelegate* GetActiveInstance(); | |
| 34 | |
| 35 // Returns a layout distance, indexed by |type|. These distances are in | |
| 36 // device-independent units. | |
| 37 virtual int GetLayoutDistance(LayoutDistanceType type) const; | |
| 38 | |
| 39 // Returns the alignment used for control labels in a GridLayout; for example, | |
| 40 // in this GridLayout: | |
| 41 // --------------------------- | |
| 42 // | Label 1 Checkbox 1 | | |
| 43 // | Label 2 Checkbox 2 | | |
| 44 // --------------------------- | |
| 45 // This value controls the alignment used for "Label 1" and "Label 2". | |
| 46 virtual views::GridLayout::Alignment GetControlLabelGridAlignment() const; | |
| 47 | |
| 48 // Returns whether to use extra padding on dialogs. If this is false, content | |
| 49 // Views for dialogs should not insert extra padding at their own edges. | |
| 50 virtual bool UseExtraDialogPadding() const; | |
| 51 | |
| 52 private: | |
| 53 DISALLOW_COPY_AND_ASSIGN(LayoutDelegate); | |
|
sky
2016/11/15 17:43:38
I think you want DISALLOW_IMPLICIT_CONSTRUCTORS.
Elly Fong-Jones
2016/11/15 19:47:26
It has an explicitly-declared LayoutDelegate() abo
| |
| 54 }; | |
| 55 | |
| 56 #endif // CHROME_BROWSER_UI_VIEWS_HARMONY_LAYOUT_DELEGATE_H_ | |
| OLD | NEW |