| 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 "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "ui/views/animation/button_ink_drop_delegate.h" | 9 #include "ui/views/animation/button_ink_drop_delegate.h" |
| 10 #include "ui/views/controls/button/label_button.h" | 10 #include "ui/views/controls/button/label_button.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 // Creates a normal STYLE_BUTTON LabelButton in pre-MD, or an MdTextButton | 25 // Creates a normal STYLE_BUTTON LabelButton in pre-MD, or an MdTextButton |
| 26 // in MD mode. | 26 // in MD mode. |
| 27 static LabelButton* CreateStandardButton(ButtonListener* listener, | 27 static LabelButton* CreateStandardButton(ButtonListener* listener, |
| 28 const base::string16& text); | 28 const base::string16& text); |
| 29 static MdTextButton* CreateMdButton(ButtonListener* listener, | 29 static MdTextButton* CreateMdButton(ButtonListener* listener, |
| 30 const base::string16& text); | 30 const base::string16& text); |
| 31 | 31 |
| 32 void SetCallToAction(CallToAction cta); | 32 void SetCallToAction(CallToAction cta); |
| 33 | 33 |
| 34 // LabelButton: | 34 // LabelButton: |
| 35 void Layout() override; | |
| 36 void OnNativeThemeChanged(const ui::NativeTheme* theme) override; | 35 void OnNativeThemeChanged(const ui::NativeTheme* theme) override; |
| 37 SkColor GetInkDropBaseColor() const override; | 36 SkColor GetInkDropBaseColor() const override; |
| 38 void SetText(const base::string16& text) override; | 37 void SetText(const base::string16& text) override; |
| 39 | 38 |
| 40 protected: | |
| 41 // LabelButton: | |
| 42 void OnFocus() override; | |
| 43 void OnBlur() override; | |
| 44 | |
| 45 private: | 39 private: |
| 46 MdTextButton(ButtonListener* listener); | 40 MdTextButton(ButtonListener* listener); |
| 47 ~MdTextButton() override; | 41 ~MdTextButton() override; |
| 48 | 42 |
| 49 void UpdateColorsFromNativeTheme(); | 43 void UpdateColorsFromNativeTheme(); |
| 50 | 44 |
| 51 ButtonInkDropDelegate ink_drop_delegate_; | 45 ButtonInkDropDelegate ink_drop_delegate_; |
| 52 | 46 |
| 53 // A child view to draw the focus ring. This is not done via a FocusPainter | |
| 54 // because it needs to paint to a layer so it can extend beyond the bounds of | |
| 55 // |this|. | |
| 56 views::View* focus_ring_; | |
| 57 | |
| 58 // The call to action style for this button. | 47 // The call to action style for this button. |
| 59 CallToAction cta_; | 48 CallToAction cta_; |
| 60 | 49 |
| 61 DISALLOW_COPY_AND_ASSIGN(MdTextButton); | 50 DISALLOW_COPY_AND_ASSIGN(MdTextButton); |
| 62 }; | 51 }; |
| 63 | 52 |
| 64 } // namespace views | 53 } // namespace views |
| 65 | 54 |
| 66 #endif // UI_VIEWS_CONTROLS_BUTTON_MD_TEXT_BUTTON_H_ | 55 #endif // UI_VIEWS_CONTROLS_BUTTON_MD_TEXT_BUTTON_H_ |
| OLD | NEW |