Index: chrome/browser/ui/views/harmony/chrome_typography.cc |
diff --git a/chrome/browser/ui/views/harmony/chrome_typography.cc b/chrome/browser/ui/views/harmony/chrome_typography.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..a210de638a54bef34f0a38319ee83d6ff02c1d97 |
--- /dev/null |
+++ b/chrome/browser/ui/views/harmony/chrome_typography.cc |
@@ -0,0 +1,44 @@ |
+// Copyright 2017 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#include "chrome/browser/ui/views/harmony/chrome_typography.h" |
+ |
+#include "ui/base/default_style.h" |
+#include "ui/base/resource/resource_bundle.h" |
+ |
+const gfx::FontList& LegacyTypographyProvider::GetFont(int text_context, |
+ int text_style) const { |
+ constexpr int kHeadlineDelta = 8; |
+ constexpr int kDialogMessageDelta = 1; |
+ |
+ int size_delta; |
+ gfx::Font::Weight font_weight; |
+ GetDefaultFont(text_context, text_style, &size_delta, &font_weight); |
+ |
+ switch (text_context) { |
+ case CONTEXT_HEADLINE: |
+ size_delta = kHeadlineDelta; |
+ break; |
+ case CONTEXT_DIALOG_MESSAGE: |
+ // Note: Not using ui::kMessageFontSizeDelta, so 13pt in most cases. |
+ size_delta = kDialogMessageDelta; |
+ break; |
+ case CONTEXT_DIALOG_TEXT_SMALL: |
+ size_delta = ui::kLabelFontSizeDelta; |
+ break; |
+ case CONTEXT_DEPRECATED_SMALL: |
+ size_delta = ui::ResourceBundle::kSmallFontDelta; |
+ break; |
+ } |
+ |
+ switch (text_style) { |
+ case STYLE_WEB_DOMAIN: |
+ case STYLE_EXTENSION_NAME: |
+ font_weight = gfx::Font::Weight::BOLD; |
+ break; |
+ } |
+ constexpr gfx::Font::FontStyle kFontStyle = gfx::Font::NORMAL; |
+ return ui::ResourceBundle::GetSharedInstance().GetFontListWithDelta( |
+ size_delta, kFontStyle, font_weight); |
+} |