OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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_NIGHT_LIGHT_NIGHT_LIGHT_TOGGLE_BUTTON_H_ | 5 #ifndef ASH_SYSTEM_NIGHT_LIGHT_NIGHT_LIGHT_TOGGLE_BUTTON_H_ |
6 #define ASH_SYSTEM_NIGHT_LIGHT_NIGHT_LIGHT_TOGGLE_BUTTON_H_ | 6 #define ASH_SYSTEM_NIGHT_LIGHT_NIGHT_LIGHT_TOGGLE_BUTTON_H_ |
7 | 7 |
8 #include "ash/system/tray/system_menu_button.h" | 8 #include "ash/system/tray/system_menu_button.h" |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 | 10 |
11 namespace ash { | 11 namespace ash { |
12 | 12 |
13 // The NightLight toggle button in the system tray. | 13 // The NightLight toggle button in the system tray. |
14 class NightLightToggleButton : public SystemMenuButton { | 14 class NightLightToggleButton : public SystemMenuButton { |
15 public: | 15 public: |
16 explicit NightLightToggleButton(views::ButtonListener* listener); | 16 explicit NightLightToggleButton(views::ButtonListener* listener); |
17 ~NightLightToggleButton() override = default; | 17 ~NightLightToggleButton() override = default; |
18 | 18 |
| 19 // Toggles the status of NightLight. |
| 20 void Toggle(); |
| 21 |
| 22 private: |
19 // Updates the icon and its style based on the status of NightLight. | 23 // Updates the icon and its style based on the status of NightLight. |
20 void Update(); | 24 void Update(); |
21 | 25 |
22 private: | |
23 // views::View: | 26 // views::View: |
24 void GetAccessibleNodeData(ui::AXNodeData* node_data) override; | 27 void GetAccessibleNodeData(ui::AXNodeData* node_data) override; |
25 | 28 |
26 DISALLOW_COPY_AND_ASSIGN(NightLightToggleButton); | 29 DISALLOW_COPY_AND_ASSIGN(NightLightToggleButton); |
27 }; | 30 }; |
28 | 31 |
29 } // namespace ash | 32 } // namespace ash |
30 | 33 |
31 #endif // ASH_SYSTEM_NIGHT_LIGHT_NIGHT_LIGHT_TOGGLE_BUTTON_H_ | 34 #endif // ASH_SYSTEM_NIGHT_LIGHT_NIGHT_LIGHT_TOGGLE_BUTTON_H_ |
OLD | NEW |