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

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

Issue 2801583002: Use views::style for buttons, bootstrap ash_typography to do so. (Closed)
Patch Set: placate gn check. new_avatar_button now just avatar_button Created 3 years, 7 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 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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_TYPOGRAPHY_H_ 5 #ifndef CHROME_BROWSER_UI_VIEWS_HARMONY_CHROME_TYPOGRAPHY_H_
6 #define CHROME_BROWSER_UI_VIEWS_HARMONY_CHROME_TYPOGRAPHY_H_ 6 #define CHROME_BROWSER_UI_VIEWS_HARMONY_CHROME_TYPOGRAPHY_H_
7 7
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "ui/views/style/typography.h" 9 #include "ui/views/style/typography.h"
10 #include "ui/views/style/typography_provider.h" 10 #include "ui/views/style/typography_provider.h"
11 11
12 #if defined(USE_ASH)
13 #include "ash/public/cpp/ash_typography.h"
14 #endif
15
12 enum ChromeTextContext { 16 enum ChromeTextContext {
17 #if defined(USE_ASH)
18 CHROME_TEXT_CONTEXT_START = ash::ASH_TEXT_CONTEXT_END,
19 #else
20 CHROME_TEXT_CONTEXT_START = views::style::VIEWS_TEXT_CONTEXT_END,
21 #endif
22
13 // Headline text. Usually 20pt. Never multi-line. 23 // Headline text. Usually 20pt. Never multi-line.
14 CONTEXT_HEADLINE = views::style::VIEWS_TEXT_CONTEXT_END, 24 CONTEXT_HEADLINE = CHROME_TEXT_CONTEXT_START,
15 25
16 // "Body 1". Usually 13pt. 26 // "Body 1". Usually 13pt.
17 CONTEXT_BODY_TEXT_LARGE, 27 CONTEXT_BODY_TEXT_LARGE,
18 28
19 // "Body 2". Usually 12pt. 29 // "Body 2". Usually 12pt.
20 CONTEXT_BODY_TEXT_SMALL, 30 CONTEXT_BODY_TEXT_SMALL,
21 31
22 // ResourceBundle::SmallFont (11 pt). There is no equivalent in the Harmony 32 // ResourceBundle::SmallFont (11 pt). There is no equivalent in the Harmony
23 // spec, so new code should not be using this. It is only provided to avoid 33 // spec, so new code should not be using this. It is only provided to avoid
24 // changing existing UI and it will eventually be removed. 34 // changing existing UI and it will eventually be removed.
25 CONTEXT_DEPRECATED_SMALL, 35 CONTEXT_DEPRECATED_SMALL,
26 }; 36 };
27 37
28 enum ChromeTextStyle { 38 enum ChromeTextStyle {
39 CHROME_TEXT_STYLE_START = views::style::VIEWS_TEXT_STYLE_END,
40
29 // Secondary text. May be lighter than views::style::PRIMARY. 41 // Secondary text. May be lighter than views::style::PRIMARY.
30 STYLE_SECONDARY = views::style::VIEWS_TEXT_STYLE_END, 42 STYLE_SECONDARY = CHROME_TEXT_STYLE_START,
31 43
32 // "Hint" text, usually a line that gives context to something more important. 44 // "Hint" text, usually a line that gives context to something more important.
33 STYLE_HINT, 45 STYLE_HINT,
34 46
35 // A solid shade of red. 47 // A solid shade of red.
36 STYLE_RED, 48 STYLE_RED,
37 49
38 // A solid shade of green. 50 // A solid shade of green.
39 STYLE_GREEN, 51 STYLE_GREEN,
40 52
41 // Used to draw attention to a section of body text such as an extension name 53 // Used to draw attention to a section of body text such as an extension name
42 // or hostname. 54 // or hostname.
43 STYLE_EMPHASIZED, 55 STYLE_EMPHASIZED,
44 }; 56 };
45 57
46 // TypographyProvider that provides pre-Harmony fonts in Chrome. 58 // TypographyProvider that provides pre-Harmony fonts in Chrome.
47 class LegacyTypographyProvider : public views::DefaultTypographyProvider { 59 class LegacyTypographyProvider : public views::DefaultTypographyProvider {
48 public: 60 public:
49 LegacyTypographyProvider() = default; 61 LegacyTypographyProvider() = default;
50 62
51 // DefaultTypographyProvider: 63 // DefaultTypographyProvider:
52 const gfx::FontList& GetFont(int text_context, int text_style) const override; 64 const gfx::FontList& GetFont(int text_context, int text_style) const override;
53 65
54 private: 66 private:
55 DISALLOW_COPY_AND_ASSIGN(LegacyTypographyProvider); 67 DISALLOW_COPY_AND_ASSIGN(LegacyTypographyProvider);
56 }; 68 };
57 69
58 #endif // CHROME_BROWSER_UI_VIEWS_HARMONY_CHROME_TYPOGRAPHY_H_ 70 #endif // CHROME_BROWSER_UI_VIEWS_HARMONY_CHROME_TYPOGRAPHY_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698