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

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

Issue 2734113006: "Bootstrap" a toolkit-views Typography spec. (Closed)
Patch Set: Rebase 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..c3eb70b477d7d6299336fc5bfd0128e17b856473
--- /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::typography::VIEWS_TEXT_CONTEXT_END + 1,
Peter Kasting 2017/03/17 02:26:00 Nit: No need for + 1, and it's confusing (2 places
tapted 2017/03/17 10:33:10 Done.
+
+ // "Body 1". Usually 13pt.
+ CONTEXT_DIALOG_MESSAGE,
Peter Kasting 2017/03/17 02:26:00 The one discomfort I have with putting "DIALOG" in
tapted 2017/03/17 10:33:10 How about BODY_TEXT_LARGE, BODY_TEXT_SMALL? (done)
Peter Kasting 2017/03/17 20:59:39 Yeah, I hear your concerns. What if we called the
tapted 2017/03/20 07:33:35 The specs don't really settle on one or the other
+
+ // "Body 2". Usually 12pt.
+ CONTEXT_DIALOG_TEXT_SMALL,
Peter Kasting 2017/03/17 02:25:59 Nit: "MESSAGE" above and "TEXT" here seem like the
tapted 2017/03/17 10:33:10 (see previous comment)
+
+ // ResourceBundle::SmallFont (11 pt).
Peter Kasting 2017/03/17 02:26:00 Nit: If this is "DEPRECATED", talk about what that
tapted 2017/03/17 10:33:10 Done.
+ CONTEXT_DEPRECATED_SMALL,
+};
+
+enum ChromeTextStyle {
+ // Secondary text. May be lighter than views::typography::PRIMARY.
+ STYLE_SECONDARY = views::typography::VIEWS_TEXT_STYLE_END + 1,
+
+ // "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 web domain.
Peter Kasting 2017/03/17 02:26:00 Without reading the code, I'd have asked: Does thi
tapted 2017/03/17 10:33:10 I like STYLE_EMPHASIZED for now - it's a little to
+ STYLE_WEB_DOMAIN,
+
+ // Used to draw attention to an extension name.
+ STYLE_EXTENSION_NAME,
+};
+
+// 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