| 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/shell.h" | 8 #include "ash/shell.h" |
| 9 #include "ash/shell_delegate.h" | 9 #include "ash/shell_delegate.h" |
| 10 #include "ash/shell_window_ids.h" | 10 #include "ash/shell_window_ids.h" |
| 11 #include "ash/wm/session_state_animator.h" | 11 #include "ash/wm/session_state_animator.h" |
| 12 #include "base/bind_helpers.h" |
| 12 #include "base/command_line.h" | 13 #include "base/command_line.h" |
| 13 #include "ui/aura/root_window.h" | 14 #include "ui/aura/root_window.h" |
| 14 #include "ui/aura/shared/compound_event_filter.h" | 15 #include "ui/aura/shared/compound_event_filter.h" |
| 15 | 16 |
| 16 #if defined(OS_CHROMEOS) | 17 #if defined(OS_CHROMEOS) |
| 17 #include "base/chromeos/chromeos_version.h" | 18 #include "base/chromeos/chromeos_version.h" |
| 18 #endif | 19 #endif |
| 19 | 20 |
| 20 namespace ash { | 21 namespace ash { |
| 21 | 22 |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 return; | 169 return; |
| 169 if (lock_to_shutdown_timer_.IsRunning()) { | 170 if (lock_to_shutdown_timer_.IsRunning()) { |
| 170 lock_to_shutdown_timer_.Stop(); | 171 lock_to_shutdown_timer_.Stop(); |
| 171 return; | 172 return; |
| 172 } | 173 } |
| 173 if (shutdown_after_lock_) { | 174 if (shutdown_after_lock_) { |
| 174 shutdown_after_lock_ = false; | 175 shutdown_after_lock_ = false; |
| 175 return; | 176 return; |
| 176 } | 177 } |
| 177 animator_->CreateForeground(); | 178 animator_->CreateForeground(); |
| 178 animator_->StartAnimation( | 179 base::Callback<void(void)> callback = |
| 180 base::Bind(&internal::SessionStateAnimator::DropForeground, |
| 181 base::Unretained(animator_.get())); |
| 182 animator_->StartAnimationWithCallback( |
| 179 internal::SessionStateAnimator::LOCK_SCREEN_SYSTEM_FOREGROUND, | 183 internal::SessionStateAnimator::LOCK_SCREEN_SYSTEM_FOREGROUND, |
| 180 internal::SessionStateAnimator::ANIMATION_UNDO_PARTIAL_FADE_IN); | 184 internal::SessionStateAnimator::ANIMATION_UNDO_PARTIAL_FADE_IN, |
| 181 | 185 callback); |
| 182 pre_shutdown_timer_.Stop(); | 186 pre_shutdown_timer_.Stop(); |
| 183 } | 187 } |
| 184 | 188 |
| 185 void SessionStateControllerImpl2::RequestShutdown() { | 189 void SessionStateControllerImpl2::RequestShutdown() { |
| 186 if (!shutting_down_) | 190 if (!shutting_down_) |
| 187 RequestShutdownImpl(); | 191 RequestShutdownImpl(); |
| 188 } | 192 } |
| 189 | 193 |
| 190 void SessionStateControllerImpl2::RequestShutdownImpl() { | 194 void SessionStateControllerImpl2::RequestShutdownImpl() { |
| 191 DCHECK(!shutting_down_); | 195 DCHECK(!shutting_down_); |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 281 ShellDelegate* delegate = Shell::GetInstance()->delegate(); | 285 ShellDelegate* delegate = Shell::GetInstance()->delegate(); |
| 282 if (delegate) { | 286 if (delegate) { |
| 283 delegate->Exit(); | 287 delegate->Exit(); |
| 284 return; | 288 return; |
| 285 } | 289 } |
| 286 } | 290 } |
| 287 #endif | 291 #endif |
| 288 delegate_->RequestShutdown(); | 292 delegate_->RequestShutdown(); |
| 289 } | 293 } |
| 290 | 294 |
| 295 void SessionStateControllerImpl2::OnLockScreenHide( |
| 296 base::Callback<void(void)>& callback) { |
| 297 animator_->StartAnimationWithCallback( |
| 298 internal::SessionStateAnimator::LOCK_SCREEN_CONTAINERS, |
| 299 internal::SessionStateAnimator::ANIMATION_RAISE, |
| 300 callback); |
| 301 } |
| 302 |
| 291 } // namespace ash | 303 } // namespace ash |
| OLD | NEW |