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

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

Issue 1689623004: Start removing enum ui::ResourceBundle::FontStyle, fix MacViews font sizes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix transcription error Created 4 years, 10 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
« no previous file with comments | « ui/views/controls/combobox/combobox.cc ('k') | ui/views/controls/tabbed_pane/tabbed_pane.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/label.cc
diff --git a/ui/views/controls/label.cc b/ui/views/controls/label.cc
index 99137e6eb9421daa3525394b102fbc89bf8fa193..66ce8b654d2dd02b4beb73b951639ad51ca2a961 100644
--- a/ui/views/controls/label.cc
+++ b/ui/views/controls/label.cc
@@ -18,6 +18,8 @@
#include "base/strings/string_split.h"
#include "base/strings/utf_string_conversions.h"
#include "ui/accessibility/ax_view_state.h"
+#include "ui/base/default_style.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"
@@ -25,17 +27,23 @@
#include "ui/native_theme/native_theme.h"
namespace views {
+namespace {
+
+const gfx::FontList& GetDefaultFontList() {
+ ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
+ return rb.GetFontListWithDelta(ui::kLabelFontSizeDelta);
+}
+
+} // namespace
// static
const char Label::kViewClassName[] = "Label";
const int Label::kFocusBorderPadding = 1;
-Label::Label() {
- Init(base::string16(), gfx::FontList());
+Label::Label() : Label(base::string16()) {
}
-Label::Label(const base::string16& text) {
- Init(text, gfx::FontList());
+Label::Label(const base::string16& text) : Label(text, GetDefaultFontList()) {
}
Label::Label(const base::string16& text, const gfx::FontList& font_list) {
« no previous file with comments | « ui/views/controls/combobox/combobox.cc ('k') | ui/views/controls/tabbed_pane/tabbed_pane.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698