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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 59 class ChromeLayoutProvider : public views::LayoutProvider { | 59 class ChromeLayoutProvider : public views::LayoutProvider { |
| 60 public: | 60 public: |
| 61 ChromeLayoutProvider() {} | 61 ChromeLayoutProvider() {} |
| 62 ~ChromeLayoutProvider() override {} | 62 ~ChromeLayoutProvider() override {} |
| 63 | 63 |
| 64 static ChromeLayoutProvider* Get(); | 64 static ChromeLayoutProvider* Get(); |
| 65 static std::unique_ptr<views::LayoutProvider> CreateLayoutProvider(); | 65 static std::unique_ptr<views::LayoutProvider> CreateLayoutProvider(); |
| 66 | 66 |
| 67 int GetDistanceMetric(int metric) const override; | 67 int GetDistanceMetric(int metric) const override; |
| 68 | 68 |
| 69 const views::TypographyProvider& GetTypographyProvider() const override; | 69 const views::TypographyProvider& GetTypographyProvider() const override; |
|
Peter Kasting
2017/04/19 19:26:13
Nit: Let's just kill the blank lines between these
Elly Fong-Jones
2017/04/20 19:53:59
Done.
| |
| 70 | 70 |
| 71 int GetSnappedDialogWidth(int min_width) const override; | |
| 72 | |
| 71 // Returns the alignment used for control labels in a GridLayout; for example, | 73 // Returns the alignment used for control labels in a GridLayout; for example, |
| 72 // in this GridLayout: | 74 // in this GridLayout: |
| 73 // --------------------------- | 75 // --------------------------- |
| 74 // | Label 1 Checkbox 1 | | 76 // | Label 1 Checkbox 1 | |
| 75 // | Label 2 Checkbox 2 | | 77 // | Label 2 Checkbox 2 | |
| 76 // --------------------------- | 78 // --------------------------- |
| 77 // This value controls the alignment used for "Label 1" and "Label 2". | 79 // This value controls the alignment used for "Label 1" and "Label 2". |
| 78 virtual views::GridLayout::Alignment GetControlLabelGridAlignment() const; | 80 virtual views::GridLayout::Alignment GetControlLabelGridAlignment() const; |
| 79 | 81 |
| 80 // Returns whether to use extra padding on dialogs. If this is false, content | 82 // Returns whether to use extra padding on dialogs. If this is false, content |
| 81 // Views for dialogs should not insert extra padding at their own edges. | 83 // Views for dialogs should not insert extra padding at their own edges. |
| 82 virtual bool UseExtraDialogPadding() const; | 84 virtual bool UseExtraDialogPadding() const; |
| 83 | 85 |
| 84 // Returns whether to show the icon next to the title text on a dialog. | 86 // Returns whether to show the icon next to the title text on a dialog. |
| 85 virtual bool ShouldShowWindowIcon() const; | 87 virtual bool ShouldShowWindowIcon() const; |
| 86 | 88 |
| 87 // DEPRECATED. Returns whether Harmony mode is enabled. | 89 // DEPRECATED. Returns whether Harmony mode is enabled. |
| 88 // | 90 // |
| 89 // Instead of using this, create a generic solution that works for all UI | 91 // 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. | 92 // types, e.g. by adding a new LayoutDistance value that means what you need. |
| 91 // | 93 // |
| 92 // TODO(pkasting): Fix callers and remove this. | 94 // TODO(pkasting): Fix callers and remove this. |
| 93 virtual bool IsHarmonyMode() const; | 95 virtual bool IsHarmonyMode() const; |
| 94 | 96 |
| 95 // Returns the preferred width in DIPs for a dialog of the specified |width|. | |
| 96 // May return 0 if the dialog has no preferred width. | |
| 97 virtual int GetDialogPreferredWidth(DialogWidth width) const; | |
| 98 | |
| 99 private: | 97 private: |
| 100 DISALLOW_COPY_AND_ASSIGN(ChromeLayoutProvider); | 98 DISALLOW_COPY_AND_ASSIGN(ChromeLayoutProvider); |
| 101 }; | 99 }; |
| 102 | 100 |
| 103 #endif // CHROME_BROWSER_UI_VIEWS_HARMONY_CHROME_LAYOUT_PROVIDER_H_ | 101 #endif // CHROME_BROWSER_UI_VIEWS_HARMONY_CHROME_LAYOUT_PROVIDER_H_ |
| OLD | NEW |