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

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: Back to PatchSet 11 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 #include "ui/views/views_export.h"
13
14 namespace views {
15
16 // A Label subclass that can be disabled. This is only used internally for
17 // views::LabelButton.
18 class VIEWS_EXPORT LabelButtonLabel : public Label {
19 public:
20 LabelButtonLabel(const base::string16& text, int text_context);
21 ~LabelButtonLabel() override;
22
23 // Set an explicit disabled color. This will stop the Label responding to
24 // changes in the native theme for disabled colors.
25 void SetDisabledColor(SkColor color);
26
27 // Label:
28 void SetEnabledColor(SkColor color) override;
29
30 protected:
31 // Label:
32 void OnEnabledChanged() override;
33 void OnNativeThemeChanged(const ui::NativeTheme* theme) override;
34
35 private:
36 void SetColorForEnableState();
37
38 SkColor requested_disabled_color_ = SK_ColorRED;
39 SkColor requested_enabled_color_ = SK_ColorRED;
40 bool disabled_color_set_ = false;
41 bool enabled_color_set_ = false;
42
43 DISALLOW_COPY_AND_ASSIGN(LabelButtonLabel);
44 };
45
46 } // namespace views
47
48 #endif // UI_VIEWS_CONTROLS_BUTTON_LABEL_BUTTON_LABEL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698