| 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" |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 Loading... |
| 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_ |
| OLD | NEW |