OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef UI_VIEWS_CONTROLS_BUTTON_LABEL_BUTTON_LABEL_H_ | |
6 #define UI_VIEWS_CONTROLS_BUTTON_LABEL_BUTTON_LABEL_H_ | |
7 | |
8 #include "base/macros.h" | |
9 #include "base/strings/string16.h" | |
10 #include "third_party/skia/include/core/SkColor.h" | |
11 #include "ui/views/controls/label.h" | |
12 | |
13 namespace views { | |
14 | |
15 // A Label subclass that can be disabled, for use in a LabelButton. | |
16 class LabelButtonLabel : public Label { | |
sky
2017/06/06 17:12:24
Please document this is an implementation detail,
tapted
2017/06/08 04:11:31
Done. Although the second bit was tricky - see lat
| |
17 public: | |
18 LabelButtonLabel(const base::string16& text, int text_context); | |
19 ~LabelButtonLabel() override; | |
20 | |
21 void SetDisabledColor(SkColor color); | |
22 | |
23 protected: | |
24 // Label: | |
25 void OnEnabledChanged() override; | |
26 void OnNativeThemeChanged(const ui::NativeTheme* theme) override; | |
27 SkColor GetForegroundColor() const override; | |
28 void OnBackgroundColorChanged() override; | |
29 | |
30 private: | |
31 void SetDisabledColorInternal(SkColor color, bool from_theme); | |
32 | |
33 SkColor requested_disabled_color_ = SK_ColorRED; | |
34 SkColor actual_disabled_color_ = SK_ColorRED; | |
35 bool disabled_color_set_ = false; | |
36 | |
37 DISALLOW_COPY_AND_ASSIGN(LabelButtonLabel); | |
38 }; | |
39 | |
40 } // namespace views | |
41 | |
42 #endif // UI_VIEWS_CONTROLS_BUTTON_LABEL_BUTTON_LABEL_H_ | |
OLD | NEW |