| 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 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 void MaybeBuildRenderTextLines(); | 169 void MaybeBuildRenderTextLines(); |
| 170 | 170 |
| 171 gfx::Rect GetFocusBounds(); | 171 gfx::Rect GetFocusBounds(); |
| 172 | 172 |
| 173 // Get the text broken into lines as needed to fit the given |width|. | 173 // Get the text broken into lines as needed to fit the given |width|. |
| 174 std::vector<base::string16> GetLinesForWidth(int width) const; | 174 std::vector<base::string16> GetLinesForWidth(int width) const; |
| 175 | 175 |
| 176 // Get the text size for the current layout. | 176 // Get the text size for the current layout. |
| 177 gfx::Size GetTextSize() const; | 177 gfx::Size GetTextSize() const; |
| 178 | 178 |
| 179 // Updates |actual_{enabled,disabled}_color_| from requested colors. |
| 179 void RecalculateColors(); | 180 void RecalculateColors(); |
| 180 | 181 |
| 182 // Applies |actual_{enabled,disabled}_color_| to |lines_|. |
| 183 void ApplyTextColors(); |
| 184 |
| 181 // Updates any colors that have not been explicitly set from the theme. | 185 // Updates any colors that have not been explicitly set from the theme. |
| 182 void UpdateColorsFromTheme(const ui::NativeTheme* theme); | 186 void UpdateColorsFromTheme(const ui::NativeTheme* theme); |
| 183 | 187 |
| 184 bool ShouldShowDefaultTooltip() const; | 188 bool ShouldShowDefaultTooltip() const; |
| 185 | 189 |
| 186 // An un-elided and single-line RenderText object used for preferred sizing. | 190 // An un-elided and single-line RenderText object used for preferred sizing. |
| 187 std::unique_ptr<gfx::RenderText> render_text_; | 191 std::unique_ptr<gfx::RenderText> render_text_; |
| 188 | 192 |
| 189 // The RenderText instances used to display elided and multi-line text. | 193 // The RenderText instances used to display elided and multi-line text. |
| 190 std::vector<std::unique_ptr<gfx::RenderText>> lines_; | 194 std::vector<std::unique_ptr<gfx::RenderText>> lines_; |
| (...skipping 24 matching lines...) Expand all Loading... |
| 215 // TODO(ckocagil): Remove is_first_paint_text_ before crbug.com/441028 is | 219 // TODO(ckocagil): Remove is_first_paint_text_ before crbug.com/441028 is |
| 216 // closed. | 220 // closed. |
| 217 bool is_first_paint_text_; | 221 bool is_first_paint_text_; |
| 218 | 222 |
| 219 DISALLOW_COPY_AND_ASSIGN(Label); | 223 DISALLOW_COPY_AND_ASSIGN(Label); |
| 220 }; | 224 }; |
| 221 | 225 |
| 222 } // namespace views | 226 } // namespace views |
| 223 | 227 |
| 224 #endif // UI_VIEWS_CONTROLS_LABEL_H_ | 228 #endif // UI_VIEWS_CONTROLS_LABEL_H_ |
| OLD | NEW |