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

Unified Diff: ui/app_list/views/app_list_item_view.cc

Issue 119963002: Clean-up: Replaces gfx::Font with gfx::FontList in ui/app_list. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Synced. Created 7 years 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
« no previous file with comments | « no previous file | ui/app_list/views/search_result_actions_view.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/app_list/views/app_list_item_view.cc
diff --git a/ui/app_list/views/app_list_item_view.cc b/ui/app_list/views/app_list_item_view.cc
index 1e70e420674b3436c2e8bbd81c1ff48e96f868a3..525b7299c8cb5059d210e9d9d5cd18b2a29e9d3e 100644
--- a/ui/app_list/views/app_list_item_view.cc
+++ b/ui/app_list/views/app_list_item_view.cc
@@ -20,7 +20,7 @@
#include "ui/compositor/scoped_layer_animation_settings.h"
#include "ui/gfx/animation/throb_animation.h"
#include "ui/gfx/canvas.h"
-#include "ui/gfx/font.h"
+#include "ui/gfx/font_list.h"
#include "ui/gfx/image/image_skia_operations.h"
#include "ui/gfx/point.h"
#include "ui/gfx/transform_util.h"
@@ -70,7 +70,7 @@ AppListItemView::AppListItemView(AppsGridView* apps_grid_view,
title_->SetBackgroundColor(0);
title_->SetAutoColorReadabilityEnabled(false);
title_->SetEnabledColor(kGridTitleColor);
- title_->SetFont(rb.GetFont(kItemTextFontStyle));
+ title_->SetFontList(rb.GetFontList(kItemTextFontStyle));
title_->SetHorizontalAlignment(gfx::ALIGN_LEFT);
title_->SetVisible(!model_->is_installing());
title_->Invalidate();
@@ -261,8 +261,8 @@ const char* AppListItemView::GetClassName() const {
void AppListItemView::Layout() {
gfx::Rect rect(GetContentsBounds());
- const int left_right_padding = kLeftRightPaddingChars *
- title_->font().GetAverageCharacterWidth();
+ const int left_right_padding =
+ title_->font_list().GetExpectedTextWidth(kLeftRightPaddingChars);
rect.Inset(left_right_padding, kTopPadding, left_right_padding, 0);
const int y = rect.y();
« no previous file with comments | « no previous file | ui/app_list/views/search_result_actions_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698