OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_BUTTON_MD_TEXT_BUTTON_H_ | 5 #ifndef UI_VIEWS_CONTROLS_BUTTON_MD_TEXT_BUTTON_H_ |
6 #define UI_VIEWS_CONTROLS_BUTTON_MD_TEXT_BUTTON_H_ | 6 #define UI_VIEWS_CONTROLS_BUTTON_MD_TEXT_BUTTON_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "base/optional.h" | 10 #include "base/optional.h" |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 void OnNativeThemeChanged(const ui::NativeTheme* theme) override; | 49 void OnNativeThemeChanged(const ui::NativeTheme* theme) override; |
50 std::unique_ptr<views::InkDropRipple> CreateInkDropRipple() const override; | 50 std::unique_ptr<views::InkDropRipple> CreateInkDropRipple() const override; |
51 std::unique_ptr<views::InkDropHighlight> CreateInkDropHighlight() | 51 std::unique_ptr<views::InkDropHighlight> CreateInkDropHighlight() |
52 const override; | 52 const override; |
53 SkColor GetInkDropBaseColor() const override; | 53 SkColor GetInkDropBaseColor() const override; |
54 bool ShouldShowInkDropForFocus() const override; | 54 bool ShouldShowInkDropForFocus() const override; |
55 void SetEnabledTextColors(SkColor color) override; | 55 void SetEnabledTextColors(SkColor color) override; |
56 void SetText(const base::string16& text) override; | 56 void SetText(const base::string16& text) override; |
57 void AdjustFontSize(int size_delta) override; | 57 void AdjustFontSize(int size_delta) override; |
58 void UpdateStyleToIndicateDefaultStatus() override; | 58 void UpdateStyleToIndicateDefaultStatus() override; |
| 59 void StateChanged() override; |
59 | 60 |
60 protected: | 61 protected: |
61 // LabelButton: | 62 // LabelButton: |
62 void SetFontList(const gfx::FontList& font_list) override; | 63 void SetFontList(const gfx::FontList& font_list) override; |
63 | 64 |
64 private: | 65 private: |
65 MdTextButton(ButtonListener* listener); | 66 MdTextButton(ButtonListener* listener); |
66 ~MdTextButton() override; | 67 ~MdTextButton() override; |
67 | 68 |
68 void UpdatePadding(); | 69 void UpdatePadding(); |
69 void UpdateColors(); | 70 void UpdateColors(); |
70 | 71 |
71 // The MD-style focus ring. This is not done via a FocusPainter | 72 // The MD-style focus ring. This is not done via a FocusPainter |
72 // because it needs to paint to a layer so it can extend beyond the bounds of | 73 // because it needs to paint to a layer so it can extend beyond the bounds of |
73 // |this|. | 74 // |this|. |
74 internal::MdFocusRing* focus_ring_; | 75 internal::MdFocusRing* focus_ring_; |
75 | 76 |
76 // True if this button uses call-to-action styling. | 77 // True if this button uses call-to-action styling. |
77 bool is_cta_; | 78 bool is_cta_; |
78 | 79 |
79 // When set, this provides the background color. | 80 // When set, this provides the background color. |
80 base::Optional<SkColor> bg_color_override_; | 81 base::Optional<SkColor> bg_color_override_; |
81 | 82 |
82 DISALLOW_COPY_AND_ASSIGN(MdTextButton); | 83 DISALLOW_COPY_AND_ASSIGN(MdTextButton); |
83 }; | 84 }; |
84 | 85 |
85 } // namespace views | 86 } // namespace views |
86 | 87 |
87 #endif // UI_VIEWS_CONTROLS_BUTTON_MD_TEXT_BUTTON_H_ | 88 #endif // UI_VIEWS_CONTROLS_BUTTON_MD_TEXT_BUTTON_H_ |
OLD | NEW |