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

Unified Diff: ui/views/style/typography_provider.h

Issue 2801583002: Use views::style for buttons, bootstrap ash_typography to do so. (Closed)
Patch Set: rebase for epic ash file move Created 3 years, 8 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..684f751f9c43ba5225a5153d7fc0c8da6e9f5bbf 100644
--- a/ui/views/style/typography_provider.h
+++ b/ui/views/style/typography_provider.h
@@ -31,6 +31,11 @@ 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;
+ // A user's gfx::Weight::NORMAL font may already "bold enough" and requesting
+ // a MEDIUM font can 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 +57,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