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

Unified Diff: ui/views/style/typography_provider.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 side-by-side diff with in-line comments
Download patch
Index: ui/views/style/typography_provider.h
diff --git a/ui/views/style/typography_provider.h b/ui/views/style/typography_provider.h
index aab1c0e997d7a325fd33671e07f3756dcea28cfd..76d6b6848aba2fcd7fe95d9e1b34b230b980b705 100644
--- a/ui/views/style/typography_provider.h
+++ b/ui/views/style/typography_provider.h
@@ -31,6 +31,14 @@ class VIEWS_EXPORT TypographyProvider {
// Gets the line spacing, or 0 if it should be provided by gfx::FontList.
virtual int GetLineHeight(int context, int style) const = 0;
+ // The system may indicate a "bold" UI font is preferred (e.g. by selecting
+ // the "Bold" checkbox in Windows under "Change only the text size" in
+ // Control Panel). In this case, a user's gfx::Weight::NORMAL font will
+ // already be bold, and requesting a MEDIUM font will result in a font that is
+ // less bold. So this method returns NORMAL, if the NORMAL font is at least as
+ // bold as |weight|.
+ static gfx::Font::Weight WeightNotLighterThanNormal(gfx::Font::Weight weight);
+
protected:
TypographyProvider() = default;
@@ -52,10 +60,10 @@ class VIEWS_EXPORT DefaultTypographyProvider : public TypographyProvider {
// Sets the |size_delta| and |font_weight| that the the default GetFont()
// implementation uses. Always sets values, even for styles it doesn't know
// about.
- void GetDefaultFont(int context,
- int style,
- int* size_delta,
- gfx::Font::Weight* font_weight) const;
+ static void GetDefaultFont(int context,
+ int style,
+ int* size_delta,
+ gfx::Font::Weight* font_weight);
private:
DISALLOW_COPY_AND_ASSIGN(DefaultTypographyProvider);

Powered by Google App Engine
This is Rietveld 408576698