Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(343)

Side by Side Diff: chrome/browser/ui/views/harmony/layout_delegate.h

Issue 2734113006: "Bootstrap" a toolkit-views Typography spec. (Closed)
Patch Set: Shred Typography class, follow-up on some other things. fix compile. Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 #include "ui/views/style/typography.h"
10
11 // Inherit privately to prevent use of views constants scoped to this.
12 class ChromeTextContext : private views::TextContext {
13 public:
14 // Headline text. Usually 20pt. Never multi-line.
15 static constexpr const Value HEADLINE = VIEWS_MAX + 1;
16
17 // "Body 1". Usually 13pt.
18 static constexpr const Value DIALOG_MESSAGE = VIEWS_MAX + 2;
19
20 // "Body 2". Usually 12pt.
21 static constexpr const Value DIALOG_TEXT_SMALL = VIEWS_MAX + 3;
22
23 // ResourceBundle::SmallFont (11 pt).
24 static constexpr const Value DEPRECATED_SMALL = VIEWS_MAX + 4;
25
26 private:
27 // Users should declare a views::TextContext, not a ChromeTextContext.
28 DISALLOW_IMPLICIT_CONSTRUCTORS(ChromeTextContext);
29 };
30
31 class ChromeTextStyle : private views::TextStyle {
32 public:
33 // Secondary text: may be lighter than PRIMARY.
34 static constexpr const Value SECONDARY = VIEWS_MAX + 1;
35
36 // "Hint" text, usually a line that gives context to something more important.
37 static constexpr const Value HINT = VIEWS_MAX + 2;
38
39 // A solid shade of red.
40 static constexpr const Value RED = VIEWS_MAX + 3;
41
42 // A solid shade of green.
43 static constexpr const Value GREEN = VIEWS_MAX + 4;
44
45 // Used to draw attention to a web domain.
46 static constexpr const Value WEB_DOMAIN = VIEWS_MAX + 5;
47
48 // Used to draw attention to an extension name.
49 static constexpr const Value EXTENSION_NAME = VIEWS_MAX + 6;
50
51 private:
52 DISALLOW_IMPLICIT_CONSTRUCTORS(ChromeTextStyle);
53 };
9 54
10 class LayoutDelegate { 55 class LayoutDelegate {
11 public: 56 public:
12 enum class Metric { 57 enum class Metric {
13 // Padding on the left and right side of a button's label. 58 // Padding on the left and right side of a button's label.
14 BUTTON_HORIZONTAL_PADDING, 59 BUTTON_HORIZONTAL_PADDING,
15 // The maximum width a button can have and still influence the sizes of 60 // 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 61 // other linked buttons. This allows short buttons to have linked widths
17 // without long buttons making things overly wide. 62 // without long buttons making things overly wide.
18 BUTTON_MAX_LINKABLE_WIDTH, 63 BUTTON_MAX_LINKABLE_WIDTH,
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 139
95 // Returns the preferred width in DIPs for a dialog of the specified |width|. 140 // Returns the preferred width in DIPs for a dialog of the specified |width|.
96 // May return 0 if the dialog has no preferred width. 141 // May return 0 if the dialog has no preferred width.
97 virtual int GetDialogPreferredWidth(DialogWidth width) const; 142 virtual int GetDialogPreferredWidth(DialogWidth width) const;
98 143
99 private: 144 private:
100 DISALLOW_COPY_AND_ASSIGN(LayoutDelegate); 145 DISALLOW_COPY_AND_ASSIGN(LayoutDelegate);
101 }; 146 };
102 147
103 #endif // CHROME_BROWSER_UI_VIEWS_HARMONY_LAYOUT_DELEGATE_H_ 148 #endif // CHROME_BROWSER_UI_VIEWS_HARMONY_LAYOUT_DELEGATE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698