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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/views/harmony/layout_delegate.h
diff --git a/chrome/browser/ui/views/harmony/layout_delegate.h b/chrome/browser/ui/views/harmony/layout_delegate.h
index e37879f86ed5e5433edaf45c5a8b4f31ef58058a..54a445e1ded0f7338a4cf273e0ba7223dbd123a5 100644
--- a/chrome/browser/ui/views/harmony/layout_delegate.h
+++ b/chrome/browser/ui/views/harmony/layout_delegate.h
@@ -6,6 +6,51 @@
#define CHROME_BROWSER_UI_VIEWS_HARMONY_LAYOUT_DELEGATE_H_
#include "ui/views/layout/grid_layout.h"
+#include "ui/views/style/typography.h"
+
+// Inherit privately to prevent use of views constants scoped to this.
+class ChromeTextContext : private views::TextContext {
+ public:
+ // Headline text. Usually 20pt. Never multi-line.
+ static constexpr const Value HEADLINE = VIEWS_MAX + 1;
+
+ // "Body 1". Usually 13pt.
+ static constexpr const Value DIALOG_MESSAGE = VIEWS_MAX + 2;
+
+ // "Body 2". Usually 12pt.
+ static constexpr const Value DIALOG_TEXT_SMALL = VIEWS_MAX + 3;
+
+ // ResourceBundle::SmallFont (11 pt).
+ static constexpr const Value DEPRECATED_SMALL = VIEWS_MAX + 4;
+
+ private:
+ // Users should declare a views::TextContext, not a ChromeTextContext.
+ DISALLOW_IMPLICIT_CONSTRUCTORS(ChromeTextContext);
+};
+
+class ChromeTextStyle : private views::TextStyle {
+ public:
+ // Secondary text: may be lighter than PRIMARY.
+ static constexpr const Value SECONDARY = VIEWS_MAX + 1;
+
+ // "Hint" text, usually a line that gives context to something more important.
+ static constexpr const Value HINT = VIEWS_MAX + 2;
+
+ // A solid shade of red.
+ static constexpr const Value RED = VIEWS_MAX + 3;
+
+ // A solid shade of green.
+ static constexpr const Value GREEN = VIEWS_MAX + 4;
+
+ // Used to draw attention to a web domain.
+ static constexpr const Value WEB_DOMAIN = VIEWS_MAX + 5;
+
+ // Used to draw attention to an extension name.
+ static constexpr const Value EXTENSION_NAME = VIEWS_MAX + 6;
+
+ private:
+ DISALLOW_IMPLICIT_CONSTRUCTORS(ChromeTextStyle);
+};
class LayoutDelegate {
public:

Powered by Google App Engine
This is Rietveld 408576698