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

Unified Diff: ui/views/controls/label.cc

Issue 2734113006: "Bootstrap" a toolkit-views Typography spec. (Closed)
Patch Set: Rebase (conflict in layout_delegate.h due to r457774) Created 3 years, 9 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/controls/label.cc
diff --git a/ui/views/controls/label.cc b/ui/views/controls/label.cc
index 05322303bb6f85fef8affab9e3170459c0fbaa93..f2d891d4e17ea5c329b77ce0e71d087107ccd48e 100644
--- a/ui/views/controls/label.cc
+++ b/ui/views/controls/label.cc
@@ -23,7 +23,6 @@
#include "ui/base/cursor/cursor.h"
#include "ui/base/default_style.h"
#include "ui/base/material_design/material_design_controller.h"
-#include "ui/base/resource/resource_bundle.h"
#include "ui/gfx/canvas.h"
#include "ui/gfx/color_utils.h"
#include "ui/gfx/geometry/insets.h"
@@ -44,12 +43,17 @@ const int Label::kFocusBorderPadding = 1;
Label::Label() : Label(base::string16()) {
}
-Label::Label(const base::string16& text) : Label(text, GetDefaultFontList()) {
+Label::Label(const base::string16& text)
+ : Label(text, style::CONTEXT_LABEL, style::STYLE_PRIMARY) {}
+
+Label::Label(const base::string16& text, int text_context, int text_style)
+ : context_menu_contents_(this) {
+ Init(text, style::GetFont(text_context, text_style));
}
-Label::Label(const base::string16& text, const gfx::FontList& font_list)
+Label::Label(const base::string16& text, const CustomFont& font)
: context_menu_contents_(this) {
- Init(text, font_list);
+ Init(text, font.font_list);
}
Label::~Label() {
@@ -57,8 +61,7 @@ Label::~Label() {
// static
const gfx::FontList& Label::GetDefaultFontList() {
- ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
- return rb.GetFontListWithDelta(ui::kLabelFontSizeDelta);
+ return style::GetFont(style::CONTEXT_LABEL, style::STYLE_PRIMARY);
}
void Label::SetFontList(const gfx::FontList& font_list) {

Powered by Google App Engine
This is Rietveld 408576698