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

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

Issue 2478863003: Fix the Web Bluetooth chooser when it is used on Chrome apps on non-Mac (Closed)
Patch Set: updated ChooserDialogViewTest Created 4 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
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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 bool is_link; 61 bool is_link;
62 }; 62 };
63 63
64 // Note that any trailing whitespace in |text| will be trimmed. 64 // Note that any trailing whitespace in |text| will be trimmed.
65 StyledLabel(const base::string16& text, StyledLabelListener* listener); 65 StyledLabel(const base::string16& text, StyledLabelListener* listener);
66 ~StyledLabel() override; 66 ~StyledLabel() override;
67 67
68 // Sets the text to be displayed, and clears any previous styling. 68 // Sets the text to be displayed, and clears any previous styling.
69 void SetText(const base::string16& text); 69 void SetText(const base::string16& text);
70 70
71 void set_listener(StyledLabelListener* listener) { listener_ = listener; }
sky 2016/11/09 17:55:48 I would prefer not to expose this. I think it's mo
juncai 2016/11/09 20:25:02 Done.
72
71 const base::string16& text() const { return text_; } 73 const base::string16& text() const { return text_; }
72 74
73 // Sets the fonts used by all labels. Can be augemented by styling set by 75 // Sets the fonts used by all labels. Can be augemented by styling set by
74 // AddStyleRange and SetDefaultStyle. 76 // AddStyleRange and SetDefaultStyle.
75 void SetBaseFontList(const gfx::FontList& font_list); 77 void SetBaseFontList(const gfx::FontList& font_list);
76 78
77 // Marks the given range within |text_| with style defined by |style_info|. 79 // Marks the given range within |text_| with style defined by |style_info|.
78 // |range| must be contained in |text_|. 80 // |range| must be contained in |text_|.
79 void AddStyleRange(const gfx::Range& range, const RangeStyleInfo& style_info); 81 void AddStyleRange(const gfx::Range& range, const RangeStyleInfo& style_info);
80 82
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 // Controls whether the text is automatically re-colored to be readable on the 179 // Controls whether the text is automatically re-colored to be readable on the
178 // background. 180 // background.
179 bool auto_color_readability_enabled_; 181 bool auto_color_readability_enabled_;
180 182
181 DISALLOW_COPY_AND_ASSIGN(StyledLabel); 183 DISALLOW_COPY_AND_ASSIGN(StyledLabel);
182 }; 184 };
183 185
184 } // namespace views 186 } // namespace views
185 187
186 #endif // UI_VIEWS_CONTROLS_STYLED_LABEL_H_ 188 #endif // UI_VIEWS_CONTROLS_STYLED_LABEL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698