| 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 "ui/views/animation/button_ink_drop_delegate.h" | 10 #include "ui/views/animation/button_ink_drop_delegate.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 }; | 24 }; |
| 25 | 25 |
| 26 // Creates a normal STYLE_BUTTON LabelButton in pre-MD, or an MdTextButton | 26 // Creates a normal STYLE_BUTTON LabelButton in pre-MD, or an MdTextButton |
| 27 // in MD mode. | 27 // in MD mode. |
| 28 static LabelButton* CreateStandardButton(ButtonListener* listener, | 28 static LabelButton* CreateStandardButton(ButtonListener* listener, |
| 29 const base::string16& text); | 29 const base::string16& text); |
| 30 // As above, but only creates an MdTextButton if MD is enabled in the | 30 // As above, but only creates an MdTextButton if MD is enabled in the |
| 31 // secondary UI (as opposed to just "top chrome"/"primary" UI). | 31 // secondary UI (as opposed to just "top chrome"/"primary" UI). |
| 32 static LabelButton* CreateSecondaryUiButton(ButtonListener* listener, | 32 static LabelButton* CreateSecondaryUiButton(ButtonListener* listener, |
| 33 const base::string16& text); | 33 const base::string16& text); |
| 34 static LabelButton* CreateSecondaryUiBlueButton(ButtonListener* listener, |
| 35 const base::string16& text); |
| 34 static MdTextButton* CreateMdButton(ButtonListener* listener, | 36 static MdTextButton* CreateMdButton(ButtonListener* listener, |
| 35 const base::string16& text); | 37 const base::string16& text); |
| 36 | 38 |
| 37 void SetCallToAction(CallToAction cta); | 39 void SetCallToAction(CallToAction cta); |
| 38 | 40 |
| 39 // LabelButton: | 41 // LabelButton: |
| 40 void OnNativeThemeChanged(const ui::NativeTheme* theme) override; | 42 void OnNativeThemeChanged(const ui::NativeTheme* theme) override; |
| 41 SkColor GetInkDropBaseColor() const override; | 43 SkColor GetInkDropBaseColor() const override; |
| 42 void SetText(const base::string16& text) override; | 44 void SetText(const base::string16& text) override; |
| 43 void UpdateStyleToIndicateDefaultStatus() override; | 45 void UpdateStyleToIndicateDefaultStatus() override; |
| 44 | 46 |
| 45 private: | 47 private: |
| 46 MdTextButton(ButtonListener* listener); | 48 MdTextButton(ButtonListener* listener); |
| 47 ~MdTextButton() override; | 49 ~MdTextButton() override; |
| 48 | 50 |
| 49 void UpdateColorsFromNativeTheme(); | 51 void UpdateColorsFromNativeTheme(); |
| 50 | 52 |
| 51 ButtonInkDropDelegate ink_drop_delegate_; | 53 ButtonInkDropDelegate ink_drop_delegate_; |
| 52 | 54 |
| 53 // The call to action style for this button. | 55 // The call to action style for this button. |
| 54 CallToAction cta_; | 56 CallToAction cta_; |
| 55 | 57 |
| 56 DISALLOW_COPY_AND_ASSIGN(MdTextButton); | 58 DISALLOW_COPY_AND_ASSIGN(MdTextButton); |
| 57 }; | 59 }; |
| 58 | 60 |
| 59 } // namespace views | 61 } // namespace views |
| 60 | 62 |
| 61 #endif // UI_VIEWS_CONTROLS_BUTTON_MD_TEXT_BUTTON_H_ | 63 #endif // UI_VIEWS_CONTROLS_BUTTON_MD_TEXT_BUTTON_H_ |
| OLD | NEW |