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

Unified Diff: chrome/browser/ui/views/omnibox/omnibox_result_view.cc

Issue 1819753003: Allow various font weights in gfx. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add a lost comment and modify a render text unittest to not test black because of test env font con… Created 4 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: chrome/browser/ui/views/omnibox/omnibox_result_view.cc
diff --git a/chrome/browser/ui/views/omnibox/omnibox_result_view.cc b/chrome/browser/ui/views/omnibox/omnibox_result_view.cc
index 8dc6d54a0d73bbed8a32e40473bac8be5a4c17ee..8c58424a105b06651fb875d2dd71bf6d80557ce8 100644
--- a/chrome/browser/ui/views/omnibox/omnibox_result_view.cc
+++ b/chrome/browser/ui/views/omnibox/omnibox_result_view.cc
@@ -191,9 +191,9 @@ OmniboxResultView::OmniboxResultView(OmniboxPopupContentsView* model,
model_index_(model_index),
location_bar_view_(location_bar_view),
font_list_(font_list),
- font_height_(
- std::max(font_list.GetHeight(),
- font_list.DeriveWithStyle(gfx::Font::BOLD).GetHeight())),
+ font_height_(std::max(
+ font_list.GetHeight(),
+ font_list.DeriveWithWeight(gfx::Font::Weight::BOLD).GetHeight())),
mirroring_context_(new MirroringContext()),
keyword_icon_(new views::ImageView()),
animation_(new gfx::SlideAnimation(this)) {
@@ -470,7 +470,7 @@ std::unique_ptr<gfx::RenderText> OmniboxResultView::CreateClassifiedRenderText(
// Calculate style-related data.
if (classifications[i].style & ACMatchClassification::MATCH)
- render_text->ApplyStyle(gfx::BOLD, true, current_range);
+ render_text->ApplyWeight(gfx::Font::Weight::BOLD, current_range);
ColorKind color_kind = TEXT;
if (classifications[i].style & ACMatchClassification::URL) {
@@ -798,7 +798,8 @@ void OmniboxResultView::AppendAnswerTextHelper(gfx::RenderText* destination,
const TextStyle& text_style = GetTextStyle(text_type);
// TODO(dschuyler): follow up on the problem of different font sizes within
// one RenderText. Maybe with destination->SetFontList(...).
- destination->ApplyStyle(gfx::BOLD, is_bold, range);
+ destination->ApplyWeight(
+ is_bold ? gfx::Font::Weight::BOLD : gfx::Font::Weight::NORMAL, range);
destination->ApplyColor(
GetNativeTheme()->GetSystemColor(text_style.colors[GetState()]), range);
destination->ApplyBaselineStyle(text_style.baseline, range);
« no previous file with comments | « chrome/browser/ui/views/first_run_bubble.cc ('k') | chrome/browser/ui/views/platform_keys_certificate_selector_chromeos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698