| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_UI_VIEWS_HARMONY_LAYOUT_DELEGATE_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_HARMONY_LAYOUT_DELEGATE_H_ |
| 6 #define CHROME_BROWSER_UI_VIEWS_HARMONY_LAYOUT_DELEGATE_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_HARMONY_LAYOUT_DELEGATE_H_ |
| 7 | 7 |
| 8 #include "ui/views/layout/grid_layout.h" | 8 #include "ui/views/layout/grid_layout.h" |
| 9 | 9 |
| 10 namespace views { |
| 11 class TypographyProvider; |
| 12 } |
| 13 |
| 10 class LayoutDelegate { | 14 class LayoutDelegate { |
| 11 public: | 15 public: |
| 12 enum class Metric { | 16 enum class Metric { |
| 13 // Padding on the left and right side of a button's label. | 17 // Padding on the left and right side of a button's label. |
| 14 BUTTON_HORIZONTAL_PADDING, | 18 BUTTON_HORIZONTAL_PADDING, |
| 15 // The maximum width a button can have and still influence the sizes of | 19 // The maximum width a button can have and still influence the sizes of |
| 16 // other linked buttons. This allows short buttons to have linked widths | 20 // other linked buttons. This allows short buttons to have linked widths |
| 17 // without long buttons making things overly wide. | 21 // without long buttons making things overly wide. |
| 18 BUTTON_MAX_LINKABLE_WIDTH, | 22 BUTTON_MAX_LINKABLE_WIDTH, |
| 19 // Default minimum width of a button. | 23 // Default minimum width of a button. |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 // | Label 1 Checkbox 1 | | 81 // | Label 1 Checkbox 1 | |
| 78 // | Label 2 Checkbox 2 | | 82 // | Label 2 Checkbox 2 | |
| 79 // --------------------------- | 83 // --------------------------- |
| 80 // This value controls the alignment used for "Label 1" and "Label 2". | 84 // This value controls the alignment used for "Label 1" and "Label 2". |
| 81 virtual views::GridLayout::Alignment GetControlLabelGridAlignment() const; | 85 virtual views::GridLayout::Alignment GetControlLabelGridAlignment() const; |
| 82 | 86 |
| 83 // Returns whether to use extra padding on dialogs. If this is false, content | 87 // Returns whether to use extra padding on dialogs. If this is false, content |
| 84 // Views for dialogs should not insert extra padding at their own edges. | 88 // Views for dialogs should not insert extra padding at their own edges. |
| 85 virtual bool UseExtraDialogPadding() const; | 89 virtual bool UseExtraDialogPadding() const; |
| 86 | 90 |
| 91 // Returns whether to show the icon next to the title text on a dialog. |
| 92 virtual bool ShouldShowWindowIcon() const; |
| 93 |
| 87 // DEPRECATED. Returns whether Harmony mode is enabled. | 94 // DEPRECATED. Returns whether Harmony mode is enabled. |
| 88 // | 95 // |
| 89 // Instead of using this, create a generic solution that works for all UI | 96 // Instead of using this, create a generic solution that works for all UI |
| 90 // types, e.g. by adding a new LayoutDistance value that means what you need. | 97 // types, e.g. by adding a new LayoutDistance value that means what you need. |
| 91 // | 98 // |
| 92 // TODO(pkasting): Fix callers and remove this. | 99 // TODO(pkasting): Fix callers and remove this. |
| 93 virtual bool IsHarmonyMode() const; | 100 virtual bool IsHarmonyMode() const; |
| 94 | 101 |
| 95 // Returns the preferred width in DIPs for a dialog of the specified |width|. | 102 // Returns the preferred width in DIPs for a dialog of the specified |width|. |
| 96 // May return 0 if the dialog has no preferred width. | 103 // May return 0 if the dialog has no preferred width. |
| 97 virtual int GetDialogPreferredWidth(DialogWidth width) const; | 104 virtual int GetDialogPreferredWidth(DialogWidth width) const; |
| 98 | 105 |
| 99 // Returns whether to show the icon next to the title text on a dialog. | 106 // Returns the class that maps views::style values (TextContext and TextStyle) |
| 100 virtual bool ShouldShowWindowIcon() const; | 107 // to specific font properties (e.g. typeface, size, color, line spacing). |
| 108 virtual const views::TypographyProvider& GetTypographyProvider() const; |
| 101 | 109 |
| 102 private: | 110 private: |
| 103 DISALLOW_COPY_AND_ASSIGN(LayoutDelegate); | 111 DISALLOW_COPY_AND_ASSIGN(LayoutDelegate); |
| 104 }; | 112 }; |
| 105 | 113 |
| 106 #endif // CHROME_BROWSER_UI_VIEWS_HARMONY_LAYOUT_DELEGATE_H_ | 114 #endif // CHROME_BROWSER_UI_VIEWS_HARMONY_LAYOUT_DELEGATE_H_ |
| OLD | NEW |