OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef UI_VIEWS_CONTROLS_LABEL_H_ | 5 #ifndef UI_VIEWS_CONTROLS_LABEL_H_ |
6 #define UI_VIEWS_CONTROLS_LABEL_H_ | 6 #define UI_VIEWS_CONTROLS_LABEL_H_ |
7 | 7 |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/gtest_prod_util.h" | 9 #include "base/gtest_prod_util.h" |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
11 #include "ui/gfx/render_text.h" | 11 #include "ui/gfx/render_text.h" |
12 #include "ui/views/view.h" | 12 #include "ui/views/view.h" |
13 | 13 |
14 namespace views { | 14 namespace views { |
15 | 15 |
16 // A view subclass that can display a string. | 16 // A view subclass that can display a string. |
17 class VIEWS_EXPORT Label : public View { | 17 class VIEWS_EXPORT Label : public View { |
18 public: | 18 public: |
19 // Internal class name. | 19 // Internal class name. |
20 static const char kViewClassName[]; | 20 static const char kViewClassName[]; |
21 | 21 |
22 // The padding for the focus border when rendering focused text. | 22 // The padding for the focus border when rendering focused text. |
23 static const int kFocusBorderPadding; | 23 static const int kFocusBorderPadding; |
24 | 24 |
25 Label(); | 25 Label(); |
26 explicit Label(const base::string16& text); | 26 explicit Label(const base::string16& text); |
27 Label(const base::string16& text, const gfx::FontList& font_list); | 27 Label(const base::string16& text, const gfx::FontList& font_list); |
28 ~Label() override; | 28 ~Label() override; |
29 | 29 |
| 30 static const gfx::FontList& GetDefaultFontList(); |
| 31 |
30 // Gets or sets the fonts used by this label. | 32 // Gets or sets the fonts used by this label. |
31 const gfx::FontList& font_list() const { return render_text_->font_list(); } | 33 const gfx::FontList& font_list() const { return render_text_->font_list(); } |
32 | 34 |
33 virtual void SetFontList(const gfx::FontList& font_list); | 35 virtual void SetFontList(const gfx::FontList& font_list); |
34 | 36 |
35 // Get or set the label text. | 37 // Get or set the label text. |
36 const base::string16& text() const { return render_text_->text(); } | 38 const base::string16& text() const { return render_text_->text(); } |
37 virtual void SetText(const base::string16& text); | 39 virtual void SetText(const base::string16& text); |
38 | 40 |
39 // Enables or disables auto-color-readability (enabled by default). If this | 41 // Enables or disables auto-color-readability (enabled by default). If this |
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
224 // TODO(ckocagil): Remove is_first_paint_text_ before crbug.com/441028 is | 226 // TODO(ckocagil): Remove is_first_paint_text_ before crbug.com/441028 is |
225 // closed. | 227 // closed. |
226 bool is_first_paint_text_; | 228 bool is_first_paint_text_; |
227 | 229 |
228 DISALLOW_COPY_AND_ASSIGN(Label); | 230 DISALLOW_COPY_AND_ASSIGN(Label); |
229 }; | 231 }; |
230 | 232 |
231 } // namespace views | 233 } // namespace views |
232 | 234 |
233 #endif // UI_VIEWS_CONTROLS_LABEL_H_ | 235 #endif // UI_VIEWS_CONTROLS_LABEL_H_ |
OLD | NEW |