Index: ui/views/controls/label.h |
diff --git a/ui/views/controls/label.h b/ui/views/controls/label.h |
index 1beccd734277170b3f3e9cee65add1250910aa56..0943af298156c7b1379385877262012b2ee98ab6 100644 |
--- a/ui/views/controls/label.h |
+++ b/ui/views/controls/label.h |
@@ -82,7 +82,6 @@ class VIEWS_EXPORT Label : public View, |
// Sets the color. This will automatically force the color to be readable |
// over the current background color, if auto color readability is enabled. |
virtual void SetEnabledColor(SkColor color); |
- void SetDisabledColorForLabelButton(SkColor color); |
SkColor enabled_color() const { return actual_enabled_color_; } |
@@ -214,7 +213,6 @@ class VIEWS_EXPORT Label : public View, |
void GetAccessibleNodeData(ui::AXNodeData* node_data) override; |
bool GetTooltipText(const gfx::Point& p, |
base::string16* tooltip) const override; |
- void OnEnabledChanged() override; |
protected: |
// Create a single RenderText instance to actually be painted. |
@@ -230,6 +228,20 @@ class VIEWS_EXPORT Label : public View, |
void PaintText(gfx::Canvas* canvas); |
+ // Returns a color that is readable against the current background color; |
+ SkColor EnsureTextColorReadable(SkColor color) const; |
+ |
+ // Returns the color to use for foreground text. |
+ virtual SkColor GetForegroundColor() const; |
sky
2017/06/06 17:12:24
I would prefer not to have this virtual. With this
tapted
2017/06/08 04:11:32
Done. Also added a test (seemed almost too simple
|
+ |
+ // Called when the background color changes. |
+ virtual void OnBackgroundColorChanged(); |
+ |
+ // Applies the foreground color to |lines_|. |
+ void ApplyTextColors() const; |
+ |
+ int text_context() const { return text_context_; } |
+ |
// View: |
void OnBoundsChanged(const gfx::Rect& previous_bounds) override; |
void VisibilityChanged(View* starting_from, bool is_visible) override; |
@@ -302,12 +314,9 @@ class VIEWS_EXPORT Label : public View, |
// Get the text size for the current layout. |
gfx::Size GetTextSize() const; |
- // Updates |actual_{enabled,disabled}_color_| from requested colors. |
+ // Updates text and selection colors from requested colors. |
void RecalculateColors(); |
- // Applies |actual_{enabled,disabled}_color_| to |lines_|. |
- void ApplyTextColors() const; |
- |
// Updates any colors that have not been explicitly set from the theme. |
void UpdateColorsFromTheme(const ui::NativeTheme* theme); |
@@ -342,8 +351,6 @@ class VIEWS_EXPORT Label : public View, |
SkColor requested_enabled_color_ = SK_ColorRED; |
SkColor actual_enabled_color_ = SK_ColorRED; |
- SkColor requested_disabled_color_ = SK_ColorRED; |
- SkColor actual_disabled_color_ = SK_ColorRED; |
SkColor background_color_ = SK_ColorRED; |
SkColor requested_selection_text_color_ = SK_ColorRED; |
SkColor actual_selection_text_color_ = SK_ColorRED; |
@@ -351,7 +358,6 @@ class VIEWS_EXPORT Label : public View, |
// Set to true once the corresponding setter is invoked. |
bool enabled_color_set_; |
- bool disabled_color_set_; |
bool background_color_set_; |
bool selection_text_color_set_; |
bool selection_background_color_set_; |