| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 ASH_SYSTEM_TRAY_SYSTEM_MENU_BUTTON_H_ | 5 #ifndef ASH_SYSTEM_TRAY_SYSTEM_MENU_BUTTON_H_ |
| 6 #define ASH_SYSTEM_TRAY_SYSTEM_MENU_BUTTON_H_ | 6 #define ASH_SYSTEM_TRAY_SYSTEM_MENU_BUTTON_H_ |
| 7 | 7 |
| 8 #include "ash/resources/vector_icons/vector_icons.h" | 8 #include "ash/resources/vector_icons/vector_icons.h" |
| 9 #include "ash/system/tray/tray_popup_ink_drop_style.h" | 9 #include "ash/system/tray/tray_popup_ink_drop_style.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 // crbug.com/614453. | 22 // crbug.com/614453. |
| 23 class SystemMenuButton : public views::ImageButton { | 23 class SystemMenuButton : public views::ImageButton { |
| 24 public: | 24 public: |
| 25 // Constructs the button with |listener| and a centered icon corresponding to | 25 // Constructs the button with |listener| and a centered icon corresponding to |
| 26 // |normal_icon| when button is enabled and |disabled_icon| when it is | 26 // |normal_icon| when button is enabled and |disabled_icon| when it is |
| 27 // disabled. |ink_drop_style| specifies which flavor of the ink drop should be | 27 // disabled. |ink_drop_style| specifies which flavor of the ink drop should be |
| 28 // used. |accessible_name_id| corresponds to the string in ui::ResourceBundle | 28 // used. |accessible_name_id| corresponds to the string in ui::ResourceBundle |
| 29 // to use for the button's accessible and tooltip text. | 29 // to use for the button's accessible and tooltip text. |
| 30 SystemMenuButton(views::ButtonListener* listener, | 30 SystemMenuButton(views::ButtonListener* listener, |
| 31 TrayPopupInkDropStyle ink_drop_style, | 31 TrayPopupInkDropStyle ink_drop_style, |
| 32 gfx::ImageSkia normal_icon, | 32 const gfx::ImageSkia& normal_icon, |
| 33 gfx::ImageSkia disabled_icon, | 33 const gfx::ImageSkia& disabled_icon, |
| 34 int accessible_name_id); | 34 int accessible_name_id); |
| 35 | 35 |
| 36 // Similar to the above constructor. Just gets a single vector icon and | 36 // Similar to the above constructor. Just gets a single vector icon and |
| 37 // creates the normal and disabled icons based on that using default menu icon | 37 // creates the normal and disabled icons based on that using default menu icon |
| 38 // colors. | 38 // colors. |
| 39 SystemMenuButton(views::ButtonListener* listener, | 39 SystemMenuButton(views::ButtonListener* listener, |
| 40 TrayPopupInkDropStyle ink_drop_style, | 40 TrayPopupInkDropStyle ink_drop_style, |
| 41 const gfx::VectorIcon& icon, | 41 const gfx::VectorIcon& icon, |
| 42 int accessible_name_id); | 42 int accessible_name_id); |
| 43 ~SystemMenuButton() override; | 43 ~SystemMenuButton() override; |
| 44 | 44 |
| 45 // Sets the normal and disabled icons based on that using default menu icon |
| 46 // colors. |
| 47 void SetVectorIcon(const gfx::VectorIcon& icon); |
| 48 |
| 45 // Explicity sets the ink drop color. Otherwise the default value will be used | 49 // Explicity sets the ink drop color. Otherwise the default value will be used |
| 46 // by TrayPopupUtils::CreateInkDropRipple() and | 50 // by TrayPopupUtils::CreateInkDropRipple() and |
| 47 // TrayPopupUtils::CreateInkDropHighlight(). | 51 // TrayPopupUtils::CreateInkDropHighlight(). |
| 48 void SetInkDropColor(SkColor color); | 52 void SetInkDropColor(SkColor color); |
| 49 | 53 |
| 50 // views::ImageButton: | 54 // views::ImageButton: |
| 51 std::unique_ptr<views::InkDrop> CreateInkDrop() override; | 55 std::unique_ptr<views::InkDrop> CreateInkDrop() override; |
| 52 std::unique_ptr<views::InkDropRipple> CreateInkDropRipple() const override; | 56 std::unique_ptr<views::InkDropRipple> CreateInkDropRipple() const override; |
| 53 std::unique_ptr<views::InkDropHighlight> CreateInkDropHighlight() | 57 std::unique_ptr<views::InkDropHighlight> CreateInkDropHighlight() |
| 54 const override; | 58 const override; |
| (...skipping 10 matching lines...) Expand all Loading... |
| 65 // used as defined by TrayPopupUtils::CreateInkDropRipple() and | 69 // used as defined by TrayPopupUtils::CreateInkDropRipple() and |
| 66 // TrayPopupUtils::CreateInkDropHighlight(). | 70 // TrayPopupUtils::CreateInkDropHighlight(). |
| 67 base::Optional<SkColor> ink_drop_color_; | 71 base::Optional<SkColor> ink_drop_color_; |
| 68 | 72 |
| 69 DISALLOW_COPY_AND_ASSIGN(SystemMenuButton); | 73 DISALLOW_COPY_AND_ASSIGN(SystemMenuButton); |
| 70 }; | 74 }; |
| 71 | 75 |
| 72 } // namespace ash | 76 } // namespace ash |
| 73 | 77 |
| 74 #endif // ASH_SYSTEM_TRAY_SYSTEM_MENU_BUTTON_H_ | 78 #endif // ASH_SYSTEM_TRAY_SYSTEM_MENU_BUTTON_H_ |
| OLD | NEW |