Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(68)

Side by Side Diff: ui/views/controls/button/label_button_label.h

Issue 2913933002: Move views::Label DisabledColor logic into views::LabelButtonLabel (Closed)
Patch Set: missed-some Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698