OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_WM_POWER_BUTTON_CONTROLLER_H_ | 5 #ifndef ASH_WM_POWER_BUTTON_CONTROLLER_H_ |
6 #define ASH_WM_POWER_BUTTON_CONTROLLER_H_ | 6 #define ASH_WM_POWER_BUTTON_CONTROLLER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "ash/ash_export.h" | 9 #include "ash/ash_export.h" |
10 #include "ash/shell_observer.h" | 10 #include "ash/shell_observer.h" |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 virtual ~PowerButtonController(); | 135 virtual ~PowerButtonController(); |
136 | 136 |
137 void set_delegate(PowerButtonControllerDelegate* delegate) { | 137 void set_delegate(PowerButtonControllerDelegate* delegate) { |
138 delegate_.reset(delegate); | 138 delegate_.reset(delegate); |
139 } | 139 } |
140 | 140 |
141 void set_has_legacy_power_button_for_test(bool legacy) { | 141 void set_has_legacy_power_button_for_test(bool legacy) { |
142 has_legacy_power_button_ = legacy; | 142 has_legacy_power_button_ = legacy; |
143 } | 143 } |
144 | 144 |
| 145 // Called when the current screen brightness changes. |
| 146 void OnScreenBrightnessChanged(double percent); |
| 147 |
145 // Called when Chrome gets a request to display the lock screen. | 148 // Called when Chrome gets a request to display the lock screen. |
146 void OnStartingLock(); | 149 void OnStartingLock(); |
147 | 150 |
148 // Called when the power or lock buttons are pressed or released. | 151 // Called when the power or lock buttons are pressed or released. |
149 void OnPowerButtonEvent(bool down, const base::TimeTicks& timestamp); | 152 void OnPowerButtonEvent(bool down, const base::TimeTicks& timestamp); |
150 void OnLockButtonEvent(bool down, const base::TimeTicks& timestamp); | 153 void OnLockButtonEvent(bool down, const base::TimeTicks& timestamp); |
151 | 154 |
152 // Displays the shutdown animation and requests shutdown when it's done. | 155 // Displays the shutdown animation and requests shutdown when it's done. |
153 void RequestShutdown(); | 156 void RequestShutdown(); |
154 | 157 |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 // The current login status. | 199 // The current login status. |
197 user::LoginStatus login_status_; | 200 user::LoginStatus login_status_; |
198 | 201 |
199 // Original login status during locked. LOGGED_IN_NONE if it's not locked. | 202 // Original login status during locked. LOGGED_IN_NONE if it's not locked. |
200 user::LoginStatus unlocked_login_status_; | 203 user::LoginStatus unlocked_login_status_; |
201 | 204 |
202 // Are the power or lock buttons currently held? | 205 // Are the power or lock buttons currently held? |
203 bool power_button_down_; | 206 bool power_button_down_; |
204 bool lock_button_down_; | 207 bool lock_button_down_; |
205 | 208 |
| 209 // Is the screen currently turned off? |
| 210 bool screen_is_off_; |
| 211 |
206 // Are we in the process of shutting the machine down? | 212 // Are we in the process of shutting the machine down? |
207 bool shutting_down_; | 213 bool shutting_down_; |
208 | 214 |
209 // Should we start |shutdown_timer_| when we receive notification that the | 215 // Should we start |shutdown_timer_| when we receive notification that the |
210 // screen has been locked? | 216 // screen has been locked? |
211 bool should_start_shutdown_timer_after_lock_; | 217 bool should_start_shutdown_timer_after_lock_; |
212 | 218 |
213 // Was a command-line switch set telling us that we're running on hardware | 219 // Was a command-line switch set telling us that we're running on hardware |
214 // that misreports power button releases? | 220 // that misreports power button releases? |
215 bool has_legacy_power_button_; | 221 bool has_legacy_power_button_; |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
248 // |background_layer_|, as the desktop background is now covering the whole | 254 // |background_layer_|, as the desktop background is now covering the whole |
249 // screen. | 255 // screen. |
250 base::OneShotTimer<PowerButtonController> hide_background_layer_timer_; | 256 base::OneShotTimer<PowerButtonController> hide_background_layer_timer_; |
251 | 257 |
252 DISALLOW_COPY_AND_ASSIGN(PowerButtonController); | 258 DISALLOW_COPY_AND_ASSIGN(PowerButtonController); |
253 }; | 259 }; |
254 | 260 |
255 } // namespace ash | 261 } // namespace ash |
256 | 262 |
257 #endif // ASH_WM_POWER_BUTTON_CONTROLLER_H_ | 263 #endif // ASH_WM_POWER_BUTTON_CONTROLLER_H_ |
OLD | NEW |