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

Unified Diff: chrome/browser/ui/views/harmony/chrome_typography.h

Issue 2734113006: "Bootstrap" a toolkit-views Typography spec. (Closed)
Patch Set: Rebase (conflict in layout_delegate.h due to r457774) 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/views/harmony/chrome_typography.h
diff --git a/chrome/browser/ui/views/harmony/chrome_typography.h b/chrome/browser/ui/views/harmony/chrome_typography.h
new file mode 100644
index 0000000000000000000000000000000000000000..9f89400f179020d59b62268fb20e7b4f9597aa13
--- /dev/null
+++ b/chrome/browser/ui/views/harmony/chrome_typography.h
@@ -0,0 +1,58 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_UI_VIEWS_HARMONY_CHROME_TYPOGRAPHY_H_
+#define CHROME_BROWSER_UI_VIEWS_HARMONY_CHROME_TYPOGRAPHY_H_
+
+#include "base/macros.h"
+#include "ui/views/style/typography.h"
+#include "ui/views/style/typography_provider.h"
+
+enum ChromeTextContext {
+ // Headline text. Usually 20pt. Never multi-line.
+ CONTEXT_HEADLINE = views::style::VIEWS_TEXT_CONTEXT_END,
+
+ // "Body 1". Usually 13pt.
+ CONTEXT_BODY_TEXT_LARGE,
+
+ // "Body 2". Usually 12pt.
+ CONTEXT_BODY_TEXT_SMALL,
+
+ // ResourceBundle::SmallFont (11 pt). There is no equivalent in the Harmony
+ // spec, so new code should not be using this. It is only provided to avoid
+ // changing existing UI and it will eventually be removed.
+ CONTEXT_DEPRECATED_SMALL,
+};
+
+enum ChromeTextStyle {
+ // Secondary text. May be lighter than views::style::PRIMARY.
+ STYLE_SECONDARY = views::style::VIEWS_TEXT_STYLE_END,
+
+ // "Hint" text, usually a line that gives context to something more important.
+ STYLE_HINT,
+
+ // A solid shade of red.
+ STYLE_RED,
+
+ // A solid shade of green.
+ STYLE_GREEN,
+
+ // Used to draw attention to a section of body text such as an extension name
+ // or hostname.
+ STYLE_EMPHASIZED,
+};
+
+// TypographyProvider that provides pre-Harmony fonts in Chrome.
+class LegacyTypographyProvider : public views::DefaultTypographyProvider {
+ public:
+ LegacyTypographyProvider() = default;
+
+ // DefaultTypographyProvider:
+ const gfx::FontList& GetFont(int text_context, int text_style) const override;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(LegacyTypographyProvider);
+};
+
+#endif // CHROME_BROWSER_UI_VIEWS_HARMONY_CHROME_TYPOGRAPHY_H_

Powered by Google App Engine
This is Rietveld 408576698