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 #include "ash/wm/session_state_controller_impl2.h" | 5 #include "ash/wm/session_state_controller_impl2.h" |
6 | 6 |
7 #include "ash/ash_switches.h" | 7 #include "ash/ash_switches.h" |
8 #include "ash/cancel_mode.h" | 8 #include "ash/cancel_mode.h" |
9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
10 #include "ash/shell_delegate.h" | 10 #include "ash/shell_delegate.h" |
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
256 if (!CanCancelShutdownAnimation()) | 256 if (!CanCancelShutdownAnimation()) |
257 return; | 257 return; |
258 if (lock_to_shutdown_timer_.IsRunning()) { | 258 if (lock_to_shutdown_timer_.IsRunning()) { |
259 lock_to_shutdown_timer_.Stop(); | 259 lock_to_shutdown_timer_.Stop(); |
260 return; | 260 return; |
261 } | 261 } |
262 if (shutdown_after_lock_) { | 262 if (shutdown_after_lock_) { |
263 shutdown_after_lock_ = false; | 263 shutdown_after_lock_ = false; |
264 return; | 264 return; |
265 } | 265 } |
| 266 |
266 animator_->StartGlobalAnimation( | 267 animator_->StartGlobalAnimation( |
267 internal::SessionStateAnimator::ANIMATION_UNDO_GRAYSCALE_BRIGHTNESS, | 268 internal::SessionStateAnimator::ANIMATION_UNDO_GRAYSCALE_BRIGHTNESS, |
268 internal::SessionStateAnimator::ANIMATION_SPEED_REVERT_SHUTDOWN); | 269 internal::SessionStateAnimator::ANIMATION_SPEED_REVERT_SHUTDOWN); |
269 pre_shutdown_timer_.Stop(); | 270 pre_shutdown_timer_.Stop(); |
270 } | 271 } |
271 | 272 |
272 void SessionStateControllerImpl2::RequestShutdown() { | 273 void SessionStateControllerImpl2::RequestShutdown() { |
273 if (!shutting_down_) | 274 if (!shutting_down_) |
274 RequestShutdownImpl(); | 275 RequestShutdownImpl(); |
275 } | 276 } |
(...skipping 28 matching lines...) Expand all Loading... |
304 base::TimeDelta::FromMilliseconds(kLockToShutdownTimeoutMs), | 305 base::TimeDelta::FromMilliseconds(kLockToShutdownTimeoutMs), |
305 this, &SessionStateControllerImpl2::OnLockToShutdownTimeout); | 306 this, &SessionStateControllerImpl2::OnLockToShutdownTimeout); |
306 } | 307 } |
307 | 308 |
308 void SessionStateControllerImpl2::OnLockToShutdownTimeout() { | 309 void SessionStateControllerImpl2::OnLockToShutdownTimeout() { |
309 DCHECK(system_is_locked_); | 310 DCHECK(system_is_locked_); |
310 StartCancellableShutdownAnimation(); | 311 StartCancellableShutdownAnimation(); |
311 } | 312 } |
312 | 313 |
313 void SessionStateControllerImpl2::StartCancellableShutdownAnimation() { | 314 void SessionStateControllerImpl2::StartCancellableShutdownAnimation() { |
| 315 Shell* shell = ash::Shell::GetInstance(); |
| 316 // Hide cursor, but let it reappear if the mouse moves. |
| 317 shell->env_filter()->set_cursor_hidden_by_filter(true); |
| 318 shell->cursor_manager()->HideCursor(); |
| 319 |
314 animator_->StartGlobalAnimation( | 320 animator_->StartGlobalAnimation( |
315 internal::SessionStateAnimator::ANIMATION_GRAYSCALE_BRIGHTNESS, | 321 internal::SessionStateAnimator::ANIMATION_GRAYSCALE_BRIGHTNESS, |
316 internal::SessionStateAnimator::ANIMATION_SPEED_SHUTDOWN); | 322 internal::SessionStateAnimator::ANIMATION_SPEED_SHUTDOWN); |
317 StartPreShutdownAnimationTimer(); | 323 StartPreShutdownAnimationTimer(); |
318 } | 324 } |
319 | 325 |
320 void SessionStateControllerImpl2::StartShutdownAnimationImpl() { | 326 void SessionStateControllerImpl2::StartShutdownAnimationImpl() { |
321 animator_->StartGlobalAnimation( | 327 animator_->StartGlobalAnimation( |
322 internal::SessionStateAnimator::ANIMATION_GRAYSCALE_BRIGHTNESS, | 328 internal::SessionStateAnimator::ANIMATION_GRAYSCALE_BRIGHTNESS, |
323 internal::SessionStateAnimator::ANIMATION_SPEED_SHUTDOWN); | 329 internal::SessionStateAnimator::ANIMATION_SPEED_SHUTDOWN); |
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
629 unlocked_properties_->background_is_hidden) { | 635 unlocked_properties_->background_is_hidden) { |
630 animator_->StartAnimationWithObserver( | 636 animator_->StartAnimationWithObserver( |
631 internal::SessionStateAnimator::DESKTOP_BACKGROUND, | 637 internal::SessionStateAnimator::DESKTOP_BACKGROUND, |
632 internal::SessionStateAnimator::ANIMATION_FADE_OUT, | 638 internal::SessionStateAnimator::ANIMATION_FADE_OUT, |
633 speed, | 639 speed, |
634 observer); | 640 observer); |
635 } | 641 } |
636 } | 642 } |
637 | 643 |
638 } // namespace ash | 644 } // namespace ash |
OLD | NEW |