OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_LOCK_STATE_CONTROLLER_H_ | 5 #ifndef ASH_WM_LOCK_STATE_CONTROLLER_H_ |
6 #define ASH_WM_LOCK_STATE_CONTROLLER_H_ | 6 #define ASH_WM_LOCK_STATE_CONTROLLER_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "ash/ash_export.h" | 10 #include "ash/ash_export.h" |
(...skipping 23 matching lines...) Expand all Loading... |
34 class LockStateControllerTest; | 34 class LockStateControllerTest; |
35 class PowerButtonControllerTest; | 35 class PowerButtonControllerTest; |
36 } | 36 } |
37 | 37 |
38 // Performs system-related functions on behalf of LockStateController. | 38 // Performs system-related functions on behalf of LockStateController. |
39 class ASH_EXPORT LockStateControllerDelegate { | 39 class ASH_EXPORT LockStateControllerDelegate { |
40 public: | 40 public: |
41 LockStateControllerDelegate() {} | 41 LockStateControllerDelegate() {} |
42 virtual ~LockStateControllerDelegate() {} | 42 virtual ~LockStateControllerDelegate() {} |
43 | 43 |
44 // Returns true if the lock screen webpage instance is loading. | |
45 // TODO(jdufault): Remove this method once crbug.com/452599 is resolved. We | |
46 // proxy the IsLoading method call into this delegate because ash forbids all | |
47 // icnludes from content/. | |
48 virtual bool IsLoading() const = 0; | |
49 | |
50 virtual void RequestLockScreen() = 0; | 44 virtual void RequestLockScreen() = 0; |
51 virtual void RequestShutdown() = 0; | 45 virtual void RequestShutdown() = 0; |
52 | 46 |
53 private: | 47 private: |
54 DISALLOW_COPY_AND_ASSIGN(LockStateControllerDelegate); | 48 DISALLOW_COPY_AND_ASSIGN(LockStateControllerDelegate); |
55 }; | 49 }; |
56 | 50 |
57 // Displays onscreen animations and locks or suspends the system in response to | 51 // Displays onscreen animations and locks or suspends the system in response to |
58 // the power button being pressed or released. | 52 // the power button being pressed or released. |
59 // Lock workflow: | 53 // Lock workflow: |
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
313 bool can_cancel_lock_animation_; | 307 bool can_cancel_lock_animation_; |
314 | 308 |
315 std::unique_ptr<UnlockedStateProperties> unlocked_properties_; | 309 std::unique_ptr<UnlockedStateProperties> unlocked_properties_; |
316 | 310 |
317 // How long has it been since the request to lock the screen? | 311 // How long has it been since the request to lock the screen? |
318 std::unique_ptr<base::ElapsedTimer> lock_duration_timer_; | 312 std::unique_ptr<base::ElapsedTimer> lock_duration_timer_; |
319 | 313 |
320 // Started when we request that the screen be locked. When it fires, we | 314 // Started when we request that the screen be locked. When it fires, we |
321 // assume that our request got dropped. | 315 // assume that our request got dropped. |
322 base::OneShotTimer lock_fail_timer_; | 316 base::OneShotTimer lock_fail_timer_; |
323 // TODO(jdufault): Remove after resolving crbug.com/452599. | |
324 bool lock_fail_timer_is_stopped_; | |
325 | 317 |
326 // Started when the screen is locked while the power button is held. Adds a | 318 // Started when the screen is locked while the power button is held. Adds a |
327 // delay between the appearance of the lock screen and the beginning of the | 319 // delay between the appearance of the lock screen and the beginning of the |
328 // pre-shutdown animation. | 320 // pre-shutdown animation. |
329 base::OneShotTimer lock_to_shutdown_timer_; | 321 base::OneShotTimer lock_to_shutdown_timer_; |
330 | 322 |
331 // Started when we begin displaying the pre-shutdown animation. When it | 323 // Started when we begin displaying the pre-shutdown animation. When it |
332 // fires, we start the shutdown animation and get ready to request shutdown. | 324 // fires, we start the shutdown animation and get ready to request shutdown. |
333 base::OneShotTimer pre_shutdown_timer_; | 325 base::OneShotTimer pre_shutdown_timer_; |
334 | 326 |
335 // Started when we display the shutdown animation. When it fires, we actually | 327 // Started when we display the shutdown animation. When it fires, we actually |
336 // request shutdown. Gives the animation time to complete before Chrome, X, | 328 // request shutdown. Gives the animation time to complete before Chrome, X, |
337 // etc. are shut down. | 329 // etc. are shut down. |
338 base::OneShotTimer real_shutdown_timer_; | 330 base::OneShotTimer real_shutdown_timer_; |
339 | 331 |
340 base::Closure lock_screen_displayed_callback_; | 332 base::Closure lock_screen_displayed_callback_; |
341 | 333 |
342 base::WeakPtrFactory<LockStateController> weak_ptr_factory_; | 334 base::WeakPtrFactory<LockStateController> weak_ptr_factory_; |
343 | 335 |
344 DISALLOW_COPY_AND_ASSIGN(LockStateController); | 336 DISALLOW_COPY_AND_ASSIGN(LockStateController); |
345 }; | 337 }; |
346 | 338 |
347 } // namespace ash | 339 } // namespace ash |
348 | 340 |
349 #endif // ASH_WM_LOCK_STATE_CONTROLLER_H_ | 341 #endif // ASH_WM_LOCK_STATE_CONTROLLER_H_ |
OLD | NEW |