| 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 <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 // Sets the label text. | 67 // Sets the label text. |
| 68 void SetText(const string16& text); | 68 void SetText(const string16& text); |
| 69 | 69 |
| 70 // Sets the label text to |email|. Emails have a custom eliding algorithm. | 70 // Sets the label text to |email|. Emails have a custom eliding algorithm. |
| 71 void SetEmail(const string16& email); | 71 void SetEmail(const string16& email); |
| 72 | 72 |
| 73 // Returns the font used by this label. | 73 // Returns the font used by this label. |
| 74 gfx::Font font() const { return font_; } | 74 gfx::Font font() const { return font_; } |
| 75 | 75 |
| 76 // Returns the label text. | 76 // Returns the label text. |
| 77 string16 text() const { return text_; }; | 77 const string16& text() const { return text_; }; |
| 78 | 78 |
| 79 // Enables or disables auto-color-readability (enabled by default). If this | 79 // Enables or disables auto-color-readability (enabled by default). If this |
| 80 // is enabled, then calls to set any foreground or background color will | 80 // is enabled, then calls to set any foreground or background color will |
| 81 // trigger an automatic mapper that uses color_utils::GetReadableColor() to | 81 // trigger an automatic mapper that uses color_utils::GetReadableColor() to |
| 82 // ensure that the foreground colors are readable over the background color. | 82 // ensure that the foreground colors are readable over the background color. |
| 83 void SetAutoColorReadabilityEnabled(bool enabled); | 83 void SetAutoColorReadabilityEnabled(bool enabled); |
| 84 | 84 |
| 85 // Sets the color. This will automatically force the color to be readable | 85 // Sets the color. This will automatically force the color to be readable |
| 86 // over the current background color. | 86 // over the current background color. |
| 87 virtual void SetEnabledColor(SkColor color); | 87 virtual void SetEnabledColor(SkColor color); |
| (...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 302 // Should a shadow be drawn behind the text? | 302 // Should a shadow be drawn behind the text? |
| 303 bool has_shadow_; | 303 bool has_shadow_; |
| 304 | 304 |
| 305 | 305 |
| 306 DISALLOW_COPY_AND_ASSIGN(Label); | 306 DISALLOW_COPY_AND_ASSIGN(Label); |
| 307 }; | 307 }; |
| 308 | 308 |
| 309 } // namespace views | 309 } // namespace views |
| 310 | 310 |
| 311 #endif // UI_VIEWS_CONTROLS_LABEL_H_ | 311 #endif // UI_VIEWS_CONTROLS_LABEL_H_ |
| OLD | NEW |