| 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_VECTOR_ICON_BUTTON_H_ | 5 #ifndef UI_VIEWS_CONTROLS_BUTTON_VECTOR_ICON_BUTTON_H_ |
| 6 #define UI_VIEWS_CONTROLS_BUTTON_VECTOR_ICON_BUTTON_H_ | 6 #define UI_VIEWS_CONTROLS_BUTTON_VECTOR_ICON_BUTTON_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "ui/views/controls/button/image_button.h" | 9 #include "ui/views/controls/button/image_button.h" |
| 10 | 10 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 // Sets the icon to display and provides a callback which should return the | 27 // Sets the icon to display and provides a callback which should return the |
| 28 // text color from which to derive this icon's color. The one that takes an ID | 28 // text color from which to derive this icon's color. The one that takes an ID |
| 29 // is deprecated and should be removed when all vector icons are identified by | 29 // is deprecated and should be removed when all vector icons are identified by |
| 30 // VectorIcon structs. | 30 // VectorIcon structs. |
| 31 void SetIcon(gfx::VectorIconId id); | 31 void SetIcon(gfx::VectorIconId id); |
| 32 void SetIcon(const gfx::VectorIcon& icon); | 32 void SetIcon(const gfx::VectorIcon& icon); |
| 33 | 33 |
| 34 // views::ImageButton: | 34 // views::ImageButton: |
| 35 void OnThemeChanged() override; | 35 void OnThemeChanged() override; |
| 36 void OnNativeThemeChanged(const ui::NativeTheme* theme) override; | 36 void OnNativeThemeChanged(const ui::NativeTheme* theme) override; |
| 37 std::unique_ptr<InkDropRipple> CreateInkDropRipple() const override; |
| 38 std::unique_ptr<InkDropHighlight> CreateInkDropHighlight() const override; |
| 37 | 39 |
| 38 private: | 40 private: |
| 39 // Performs the work common to both SetIcon() variants. | 41 // Performs the work common to both SetIcon() variants. |
| 40 void OnSetIcon(); | 42 void OnSetIcon(); |
| 41 | 43 |
| 42 // Called when something may have affected the button's images or colors. | 44 // Called when something may have affected the button's images or colors. |
| 43 void UpdateImagesAndColors(); | 45 void UpdateImagesAndColors(); |
| 44 | 46 |
| 45 VectorIconButtonDelegate* delegate_; | 47 VectorIconButtonDelegate* delegate_; |
| 46 // TODO(estade): remove |id_| in favor of |icon_| once all callers have been | 48 // TODO(estade): remove |id_| in favor of |icon_| once all callers have been |
| 47 // updated. | 49 // updated. |
| 48 gfx::VectorIconId id_; | 50 gfx::VectorIconId id_; |
| 49 const gfx::VectorIcon* icon_ = nullptr; | 51 const gfx::VectorIcon* icon_ = nullptr; |
| 50 | 52 |
| 51 DISALLOW_COPY_AND_ASSIGN(VectorIconButton); | 53 DISALLOW_COPY_AND_ASSIGN(VectorIconButton); |
| 52 }; | 54 }; |
| 53 | 55 |
| 54 } // namespace views | 56 } // namespace views |
| 55 | 57 |
| 56 #endif // UI_VIEWS_CONTROLS_BUTTON_VECTOR_ICON_BUTTON_H_ | 58 #endif // UI_VIEWS_CONTROLS_BUTTON_VECTOR_ICON_BUTTON_H_ |
| OLD | NEW |