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

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

Issue 2065003002: Do not SchedulePaint() inside views::Label::OnPaint() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add a test Created 4 years, 6 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 unified diff | Download patch
« no previous file with comments | « no previous file | ui/views/controls/label.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 (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"
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 void MaybeBuildRenderTextLines(); 173 void MaybeBuildRenderTextLines();
174 174
175 gfx::Rect GetFocusBounds(); 175 gfx::Rect GetFocusBounds();
176 176
177 // Get the text broken into lines as needed to fit the given |width|. 177 // Get the text broken into lines as needed to fit the given |width|.
178 std::vector<base::string16> GetLinesForWidth(int width) const; 178 std::vector<base::string16> GetLinesForWidth(int width) const;
179 179
180 // Get the text size for the current layout. 180 // Get the text size for the current layout.
181 gfx::Size GetTextSize() const; 181 gfx::Size GetTextSize() const;
182 182
183 // Updates |actual_{enabled,disabled}_color_| from requested colors.
183 void RecalculateColors(); 184 void RecalculateColors();
184 185
186 // Applies |actual_{enabled,disabled}_color_| to |lines_|.
187 void ApplyTextColors();
188
185 // Updates any colors that have not been explicitly set from the theme. 189 // Updates any colors that have not been explicitly set from the theme.
186 void UpdateColorsFromTheme(const ui::NativeTheme* theme); 190 void UpdateColorsFromTheme(const ui::NativeTheme* theme);
187 191
188 bool ShouldShowDefaultTooltip() const; 192 bool ShouldShowDefaultTooltip() const;
189 193
190 // An un-elided and single-line RenderText object used for preferred sizing. 194 // An un-elided and single-line RenderText object used for preferred sizing.
191 std::unique_ptr<gfx::RenderText> render_text_; 195 std::unique_ptr<gfx::RenderText> render_text_;
192 196
193 // The RenderText instances used to display elided and multi-line text. 197 // The RenderText instances used to display elided and multi-line text.
194 std::vector<std::unique_ptr<gfx::RenderText>> lines_; 198 std::vector<std::unique_ptr<gfx::RenderText>> lines_;
(...skipping 25 matching lines...) Expand all
220 // TODO(ckocagil): Remove is_first_paint_text_ before crbug.com/441028 is 224 // TODO(ckocagil): Remove is_first_paint_text_ before crbug.com/441028 is
221 // closed. 225 // closed.
222 bool is_first_paint_text_; 226 bool is_first_paint_text_;
223 227
224 DISALLOW_COPY_AND_ASSIGN(Label); 228 DISALLOW_COPY_AND_ASSIGN(Label);
225 }; 229 };
226 230
227 } // namespace views 231 } // namespace views
228 232
229 #endif // UI_VIEWS_CONTROLS_LABEL_H_ 233 #endif // UI_VIEWS_CONTROLS_LABEL_H_
OLDNEW
« no previous file with comments | « no previous file | ui/views/controls/label.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698