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

Side by Side Diff: ui/views/controls/styled_label.h

Issue 681883002: Standardize usage of virtual/override/final specifiers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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 unified diff | Download patch
« no previous file with comments | « ui/views/controls/slider_unittest.cc ('k') | ui/views/controls/styled_label_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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_STYLED_LABEL_H_ 5 #ifndef UI_VIEWS_CONTROLS_STYLED_LABEL_H_
6 #define UI_VIEWS_CONTROLS_STYLED_LABEL_H_ 6 #define UI_VIEWS_CONTROLS_STYLED_LABEL_H_
7 7
8 #include <list> 8 #include <list>
9 #include <map> 9 #include <map>
10 10
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 49
50 // If set, the whole range will be put on a single line. 50 // If set, the whole range will be put on a single line.
51 bool disable_line_wrapping; 51 bool disable_line_wrapping;
52 52
53 // If set, the range will be created as a link. 53 // If set, the range will be created as a link.
54 bool is_link; 54 bool is_link;
55 }; 55 };
56 56
57 // Note that any trailing whitespace in |text| will be trimmed. 57 // Note that any trailing whitespace in |text| will be trimmed.
58 StyledLabel(const base::string16& text, StyledLabelListener* listener); 58 StyledLabel(const base::string16& text, StyledLabelListener* listener);
59 virtual ~StyledLabel(); 59 ~StyledLabel() override;
60 60
61 // Sets the text to be displayed, and clears any previous styling. 61 // Sets the text to be displayed, and clears any previous styling.
62 void SetText(const base::string16& text); 62 void SetText(const base::string16& text);
63 63
64 // Sets the fonts used by all labels. Can be augemented by styling set by 64 // Sets the fonts used by all labels. Can be augemented by styling set by
65 // AddStyleRange and SetDefaultStyle. 65 // AddStyleRange and SetDefaultStyle.
66 void SetBaseFontList(const gfx::FontList& font_list); 66 void SetBaseFontList(const gfx::FontList& font_list);
67 67
68 // Marks the given range within |text_| with style defined by |style_info|. 68 // Marks the given range within |text_| with style defined by |style_info|.
69 // |range| must be contained in |text_|. 69 // |range| must be contained in |text_|.
(...skipping 14 matching lines...) Expand all
84 void SetDisplayedOnBackgroundColor(SkColor color); 84 void SetDisplayedOnBackgroundColor(SkColor color);
85 SkColor displayed_on_background_color() const { 85 SkColor displayed_on_background_color() const {
86 return displayed_on_background_color_; 86 return displayed_on_background_color_;
87 } 87 }
88 88
89 void set_auto_color_readability_enabled(bool auto_color_readability) { 89 void set_auto_color_readability_enabled(bool auto_color_readability) {
90 auto_color_readability_enabled_ = auto_color_readability; 90 auto_color_readability_enabled_ = auto_color_readability;
91 } 91 }
92 92
93 // View implementation: 93 // View implementation:
94 virtual gfx::Insets GetInsets() const override; 94 gfx::Insets GetInsets() const override;
95 virtual int GetHeightForWidth(int w) const override; 95 int GetHeightForWidth(int w) const override;
96 virtual void Layout() override; 96 void Layout() override;
97 virtual void PreferredSizeChanged() override; 97 void PreferredSizeChanged() override;
98 98
99 // LinkListener implementation: 99 // LinkListener implementation:
100 virtual void LinkClicked(Link* source, int event_flags) override; 100 void LinkClicked(Link* source, int event_flags) override;
101 101
102 private: 102 private:
103 struct StyleRange { 103 struct StyleRange {
104 StyleRange(const gfx::Range& range, 104 StyleRange(const gfx::Range& range,
105 const RangeStyleInfo& style_info) 105 const RangeStyleInfo& style_info)
106 : range(range), 106 : range(range),
107 style_info(style_info) { 107 style_info(style_info) {
108 } 108 }
109 ~StyleRange() {} 109 ~StyleRange() {}
110 110
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 // Controls whether the text is automatically re-colored to be readable on the 155 // Controls whether the text is automatically re-colored to be readable on the
156 // background. 156 // background.
157 bool auto_color_readability_enabled_; 157 bool auto_color_readability_enabled_;
158 158
159 DISALLOW_COPY_AND_ASSIGN(StyledLabel); 159 DISALLOW_COPY_AND_ASSIGN(StyledLabel);
160 }; 160 };
161 161
162 } // namespace views 162 } // namespace views
163 163
164 #endif // UI_VIEWS_CONTROLS_STYLED_LABEL_H_ 164 #endif // UI_VIEWS_CONTROLS_STYLED_LABEL_H_
OLDNEW
« no previous file with comments | « ui/views/controls/slider_unittest.cc ('k') | ui/views/controls/styled_label_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698