Chromium Code Reviews| 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_CHROME_LAYOUT_PROVIDER_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_HARMONY_CHROME_LAYOUT_PROVIDER_H_ |
| 6 #define CHROME_BROWSER_UI_VIEWS_HARMONY_CHROME_LAYOUT_PROVIDER_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_HARMONY_CHROME_LAYOUT_PROVIDER_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 13 matching lines...) Expand all Loading... | |
| 24 DISTANCE_RELATED_CONTROL_VERTICAL_SMALL, | 24 DISTANCE_RELATED_CONTROL_VERTICAL_SMALL, |
| 25 // Horizontal spacing between an item such as an icon or checkbox and a | 25 // Horizontal spacing between an item such as an icon or checkbox and a |
| 26 // label related to it. | 26 // label related to it. |
| 27 DISTANCE_RELATED_LABEL_HORIZONTAL, | 27 DISTANCE_RELATED_LABEL_HORIZONTAL, |
| 28 // Horizontal spacing between an item and the related label, in the context of | 28 // Horizontal spacing between an item and the related label, in the context of |
| 29 // a row of such items. E.g. the bookmarks bar. | 29 // a row of such items. E.g. the bookmarks bar. |
| 30 DISTANCE_RELATED_LABEL_HORIZONTAL_LIST, | 30 DISTANCE_RELATED_LABEL_HORIZONTAL_LIST, |
| 31 // Horizontal indent of a subsection relative to related items above, e.g. | 31 // Horizontal indent of a subsection relative to related items above, e.g. |
| 32 // checkboxes below explanatory text/headings. | 32 // checkboxes below explanatory text/headings. |
| 33 DISTANCE_SUBSECTION_HORIZONTAL_INDENT, | 33 DISTANCE_SUBSECTION_HORIZONTAL_INDENT, |
| 34 // Vertical margin for controls in a toast. | |
| 35 DISTANCE_TOAST_CONTROL_VERTICAL, | |
| 36 // Vertical margin for labels in a toast. | |
| 37 DISTANCE_TOAST_LABEL_VERTICAL, | |
| 34 // Horizontal spacing between controls that are logically unrelated. | 38 // Horizontal spacing between controls that are logically unrelated. |
| 35 DISTANCE_UNRELATED_CONTROL_HORIZONTAL, | 39 DISTANCE_UNRELATED_CONTROL_HORIZONTAL, |
| 36 // Larger horizontal spacing between unrelated controls. | 40 // Larger horizontal spacing between unrelated controls. |
| 37 DISTANCE_UNRELATED_CONTROL_HORIZONTAL_LARGE, | 41 DISTANCE_UNRELATED_CONTROL_HORIZONTAL_LARGE, |
| 38 // Larger vertical spacing between unrelated controls. | 42 // Larger vertical spacing between unrelated controls. |
| 39 DISTANCE_UNRELATED_CONTROL_VERTICAL_LARGE, | 43 DISTANCE_UNRELATED_CONTROL_VERTICAL_LARGE, |
| 40 }; | 44 }; |
| 41 | 45 |
| 46 enum InsetsMetric { | |
|
Peter Kasting
2017/07/15 07:38:36
This has to be ChromeInsetsMetric, or you have a n
ananta
2017/07/17 19:11:04
Done.
| |
| 47 // Margins used by toasts. | |
| 48 INSETS_TOAST = views::VIEWS_INSETS_END, | |
| 49 }; | |
| 50 | |
| 42 class ChromeLayoutProvider : public views::LayoutProvider { | 51 class ChromeLayoutProvider : public views::LayoutProvider { |
| 43 public: | 52 public: |
| 44 ChromeLayoutProvider() {} | 53 ChromeLayoutProvider() {} |
| 45 ~ChromeLayoutProvider() override {} | 54 ~ChromeLayoutProvider() override {} |
| 46 | 55 |
| 47 static ChromeLayoutProvider* Get(); | 56 static ChromeLayoutProvider* Get(); |
| 48 static std::unique_ptr<views::LayoutProvider> CreateLayoutProvider(); | 57 static std::unique_ptr<views::LayoutProvider> CreateLayoutProvider(); |
| 49 | 58 |
| 50 // views::LayoutProvider: | 59 // views::LayoutProvider: |
| 51 int GetDistanceMetric(int metric) const override; | 60 int GetDistanceMetric(int metric) const override; |
| 52 const views::TypographyProvider& GetTypographyProvider() const override; | 61 const views::TypographyProvider& GetTypographyProvider() const override; |
| 62 gfx::Insets GetInsetsMetric(int metric) const override; | |
|
Peter Kasting
2017/07/15 07:38:36
Nit: Please match the base class order
ananta
2017/07/17 19:11:04
Done.
| |
| 53 | 63 |
| 54 // Returns the alignment used for control labels in a GridLayout; for example, | 64 // Returns the alignment used for control labels in a GridLayout; for example, |
| 55 // in this GridLayout: | 65 // in this GridLayout: |
| 56 // --------------------------- | 66 // --------------------------- |
| 57 // | Label 1 Checkbox 1 | | 67 // | Label 1 Checkbox 1 | |
| 58 // | Label 2 Checkbox 2 | | 68 // | Label 2 Checkbox 2 | |
| 59 // --------------------------- | 69 // --------------------------- |
| 60 // This value controls the alignment used for "Label 1" and "Label 2". | 70 // This value controls the alignment used for "Label 1" and "Label 2". |
| 61 virtual views::GridLayout::Alignment GetControlLabelGridAlignment() const; | 71 virtual views::GridLayout::Alignment GetControlLabelGridAlignment() const; |
| 62 | 72 |
| (...skipping 10 matching lines...) Expand all Loading... | |
| 73 // types, e.g. by adding a new LayoutDistance value that means what you need. | 83 // types, e.g. by adding a new LayoutDistance value that means what you need. |
| 74 // | 84 // |
| 75 // TODO(pkasting): Fix callers and remove this. | 85 // TODO(pkasting): Fix callers and remove this. |
| 76 virtual bool IsHarmonyMode() const; | 86 virtual bool IsHarmonyMode() const; |
| 77 | 87 |
| 78 private: | 88 private: |
| 79 DISALLOW_COPY_AND_ASSIGN(ChromeLayoutProvider); | 89 DISALLOW_COPY_AND_ASSIGN(ChromeLayoutProvider); |
| 80 }; | 90 }; |
| 81 | 91 |
| 82 #endif // CHROME_BROWSER_UI_VIEWS_HARMONY_CHROME_LAYOUT_PROVIDER_H_ | 92 #endif // CHROME_BROWSER_UI_VIEWS_HARMONY_CHROME_LAYOUT_PROVIDER_H_ |
| OLD | NEW |