| 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 18 matching lines...) Expand all Loading... |
| 29 // See |is_prominent_|. | 29 // See |is_prominent_|. |
| 30 void SetProminent(bool is_prominent); | 30 void SetProminent(bool is_prominent); |
| 31 | 31 |
| 32 // See |bg_color_override_|. | 32 // See |bg_color_override_|. |
| 33 void SetBgColorOverride(const base::Optional<SkColor>& color); | 33 void SetBgColorOverride(const base::Optional<SkColor>& color); |
| 34 | 34 |
| 35 // View: | 35 // View: |
| 36 void OnPaintBackground(gfx::Canvas* canvas) override; | 36 void OnPaintBackground(gfx::Canvas* canvas) override; |
| 37 | 37 |
| 38 // LabelButton: | 38 // LabelButton: |
| 39 /* |
| 40 void OnPaint(gfx::Canvas* canvas) override; |
| 41 void PaintChildren(const ui::PaintContext& context); |
| 42 */ |
| 43 bool GetNeedsNotificationWhenVisibleBoundsChange() const override; |
| 44 void OnVisibleBoundsChanged() override; |
| 45 void OnLayerBoundsChanged(const gfx::Rect& old_bounds) override; |
| 39 void OnFocus() override; | 46 void OnFocus() override; |
| 40 void OnBlur() override; | 47 void OnBlur() override; |
| 41 void OnNativeThemeChanged(const ui::NativeTheme* theme) override; | 48 void OnNativeThemeChanged(const ui::NativeTheme* theme) override; |
| 42 std::unique_ptr<InkDrop> CreateInkDrop() override; | 49 std::unique_ptr<InkDrop> CreateInkDrop() override; |
| 43 std::unique_ptr<views::InkDropRipple> CreateInkDropRipple() const override; | 50 std::unique_ptr<views::InkDropRipple> CreateInkDropRipple() const override; |
| 44 std::unique_ptr<views::InkDropHighlight> CreateInkDropHighlight() | 51 std::unique_ptr<views::InkDropHighlight> CreateInkDropHighlight() |
| 45 const override; | 52 const override; |
| 46 SkColor GetInkDropBaseColor() const override; | 53 SkColor GetInkDropBaseColor() const override; |
| 47 void SetEnabledTextColors(SkColor color) override; | 54 void SetEnabledTextColors(SkColor color) override; |
| 48 void SetText(const base::string16& text) override; | 55 void SetText(const base::string16& text) override; |
| 49 void AdjustFontSize(int size_delta) override; | 56 void AdjustFontSize(int size_delta) override; |
| 50 void UpdateStyleToIndicateDefaultStatus() override; | 57 void UpdateStyleToIndicateDefaultStatus() override; |
| 51 void StateChanged() override; | 58 void StateChanged() override; |
| 52 | 59 |
| 53 protected: | 60 protected: |
| 54 // LabelButton: | 61 // LabelButton: |
| 55 void SetFontList(const gfx::FontList& font_list) override; | 62 void SetFontList(const gfx::FontList& font_list) override; |
| 56 | 63 |
| 57 private: | 64 private: |
| 58 explicit MdTextButton(ButtonListener* listener); | 65 explicit MdTextButton(ButtonListener* listener); |
| 59 | 66 |
| 60 void UpdatePadding(); | 67 void UpdatePadding(); |
| 61 void UpdateColors(); | 68 void UpdateColors(); |
| 62 | 69 |
| 63 // True if this button uses prominent styling (blue fill, etc.). | 70 // True if this button uses prominent styling (blue fill, etc.). |
| 64 bool is_prominent_; | 71 bool is_prominent_; |
| 65 | 72 |
| 73 gfx::Rect last_visible_bounds_; |
| 74 std::unique_ptr<ui::LayerDelegate> mask_layer_delegate_; |
| 75 ui::Layer mask_layer_; |
| 76 |
| 66 // When set, this provides the background color. | 77 // When set, this provides the background color. |
| 67 base::Optional<SkColor> bg_color_override_; | 78 base::Optional<SkColor> bg_color_override_; |
| 68 | 79 |
| 69 DISALLOW_COPY_AND_ASSIGN(MdTextButton); | 80 DISALLOW_COPY_AND_ASSIGN(MdTextButton); |
| 70 }; | 81 }; |
| 71 | 82 |
| 72 } // namespace views | 83 } // namespace views |
| 73 | 84 |
| 74 #endif // UI_VIEWS_CONTROLS_BUTTON_MD_TEXT_BUTTON_H_ | 85 #endif // UI_VIEWS_CONTROLS_BUTTON_MD_TEXT_BUTTON_H_ |
| OLD | NEW |