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

Unified Diff: chrome/browser/ui/views/harmony/harmony_typography_provider.cc

Issue 2801583002: Use views::style for buttons, bootstrap ash_typography to do so. (Closed)
Patch Set: More self review 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: chrome/browser/ui/views/harmony/harmony_typography_provider.cc
diff --git a/chrome/browser/ui/views/harmony/harmony_typography_provider.cc b/chrome/browser/ui/views/harmony/harmony_typography_provider.cc
index 21caf0cb832f7db4b16030d0338632a8d7852927..65a428f8101b214eed07633e1590dcc7b12dc6c1 100644
--- a/chrome/browser/ui/views/harmony/harmony_typography_provider.cc
+++ b/chrome/browser/ui/views/harmony/harmony_typography_provider.cc
@@ -8,6 +8,10 @@
#include "ui/base/resource/resource_bundle.h"
#include "ui/gfx/platform_font.h"
+#if defined(USE_ASH)
+#include "ash/common/ash_typography.h"
+#endif
+
const gfx::FontList& HarmonyTypographyProvider::GetFont(int text_context,
int text_style) const {
// "Target" font size constants from the Harmony spec.
@@ -34,14 +38,19 @@ const gfx::FontList& HarmonyTypographyProvider::GetFont(int text_context,
case CONTEXT_BODY_TEXT_LARGE:
size_delta = kBodyTextLargeSize - gfx::PlatformFont::kDefaultBaseFontSize;
break;
- case views::style::CONTEXT_BUTTON:
- font_weight = kButtonFontWeight;
+ case views::style::CONTEXT_BUTTON_MD:
+ font_weight = WeightNotLighterThanNormal(kButtonFontWeight);
break;
default:
break;
}
// Ignore |text_style| since it only affects color in the Harmony spec.
+
+#if defined(USE_ASH)
+ ash::GetDefaultAshFont(text_context, text_style, &size_delta, &font_weight);
Peter Kasting 2017/04/08 01:38:54 Nit: I liked doing this above the switch, as you d
tapted 2017/04/10 12:27:33 Done.
+#endif
+
return ui::ResourceBundle::GetSharedInstance().GetFontListWithDelta(
size_delta, gfx::Font::NORMAL, font_weight);
}

Powered by Google App Engine
This is Rietveld 408576698