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

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

Issue 2904823002: Inactive toast ux changes (Closed)
Patch Set: remove the need for a font_list Created 3 years, 5 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
index 84bb16f3782e7d1da6b20fb24febac5d9a43e3c8..865193b4eb1d68f08b74c43c82b083cb9f854549 100644
--- a/chrome/browser/ui/views/harmony/chrome_typography.h
+++ b/chrome/browser/ui/views/harmony/chrome_typography.h
@@ -6,6 +6,7 @@
#define CHROME_BROWSER_UI_VIEWS_HARMONY_CHROME_TYPOGRAPHY_H_
#include "base/macros.h"
+#include "ui/gfx/platform_font.h"
#include "ui/views/style/typography.h"
#include "ui/views/style/typography_provider.h"
@@ -29,6 +30,9 @@ enum ChromeTextContext {
// "Body 2". Usually 12pt.
CONTEXT_BODY_TEXT_SMALL,
+ // Appropriate comment
tapted 2017/07/07 01:51:21 I see you took my code fragment literally... I gu
skare_ 2017/07/07 03:04:10 Done (sorry, just checking the approach in an inte
+ CONTEXT_WINDOWS10_NATIVE,
+
// 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.
@@ -50,11 +54,26 @@ enum ChromeTextStyle {
// A solid shade of green.
STYLE_GREEN,
+ // Style for (Windows)
+ STYLE_WINDOWS_10,
tapted 2017/07/07 01:51:21 I don't think this is used (The parallel I use for
skare_ 2017/07/07 03:04:10 Done.
+
// Used to draw attention to a section of body text such as an extension name
// or hostname.
STYLE_EMPHASIZED,
};
+// Sets the |size_delta| and |font_weight| for specific text contexts.
tapted 2017/07/07 01:51:21 // Sets the |size_delta| and |font_weight| for tex
skare_ 2017/07/07 03:04:10 Done.
+static void ApplyCommonFontStyles(int context,
tapted 2017/07/07 01:51:21 split declaration/definition
skare_ 2017/07/07 03:04:10 Done.
+ int style,
+ int* size_delta,
+ gfx::Font::Weight* weight) {
+ if (context == CONTEXT_WINDOWS10_NATIVE) {
+ *size_delta = 15 - gfx::PlatformFont::kDefaultBaseFontSize;
+ *weight = views::TypographyProvider::WeightNotLighterThanNormal(
+ gfx::Font::Weight::MEDIUM);
+ }
+}
+
// TypographyProvider that provides pre-Harmony fonts in Chrome.
class LegacyTypographyProvider : public views::DefaultTypographyProvider {
public:

Powered by Google App Engine
This is Rietveld 408576698