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" |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 } | 164 } |
165 | 165 |
166 void SessionStateControllerImpl2::OnAppTerminating() { | 166 void SessionStateControllerImpl2::OnAppTerminating() { |
167 // If we hear that Chrome is exiting but didn't request it ourselves, all we | 167 // If we hear that Chrome is exiting but didn't request it ourselves, all we |
168 // can really hope for is that we'll have time to clear the screen. | 168 // can really hope for is that we'll have time to clear the screen. |
169 // This is also the case when the user signs off. | 169 // This is also the case when the user signs off. |
170 if (!shutting_down_) { | 170 if (!shutting_down_) { |
171 shutting_down_ = true; | 171 shutting_down_ = true; |
172 Shell* shell = ash::Shell::GetInstance(); | 172 Shell* shell = ash::Shell::GetInstance(); |
173 shell->env_filter()->set_cursor_hidden_by_filter(false); | 173 shell->env_filter()->set_cursor_hidden_by_filter(false); |
174 shell->cursor_manager()->ShowCursor(false); | 174 shell->cursor_manager()->DisableMouseEvents(); |
175 animator_->StartAnimation( | 175 animator_->StartAnimation( |
176 internal::SessionStateAnimator::kAllContainersMask, | 176 internal::SessionStateAnimator::kAllContainersMask, |
177 internal::SessionStateAnimator::ANIMATION_HIDE_IMMEDIATELY, | 177 internal::SessionStateAnimator::ANIMATION_HIDE_IMMEDIATELY, |
178 internal::SessionStateAnimator::ANIMATION_SPEED_IMMEDIATE); | 178 internal::SessionStateAnimator::ANIMATION_SPEED_IMMEDIATE); |
179 } | 179 } |
180 } | 180 } |
181 | 181 |
182 void SessionStateControllerImpl2::OnLockStateChanged(bool locked) { | 182 void SessionStateControllerImpl2::OnLockStateChanged(bool locked) { |
183 if (shutting_down_ || (system_is_locked_ == locked)) | 183 if (shutting_down_ || (system_is_locked_ == locked)) |
184 return; | 184 return; |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
272 if (!shutting_down_) | 272 if (!shutting_down_) |
273 RequestShutdownImpl(); | 273 RequestShutdownImpl(); |
274 } | 274 } |
275 | 275 |
276 void SessionStateControllerImpl2::RequestShutdownImpl() { | 276 void SessionStateControllerImpl2::RequestShutdownImpl() { |
277 DCHECK(!shutting_down_); | 277 DCHECK(!shutting_down_); |
278 shutting_down_ = true; | 278 shutting_down_ = true; |
279 | 279 |
280 Shell* shell = ash::Shell::GetInstance(); | 280 Shell* shell = ash::Shell::GetInstance(); |
281 shell->env_filter()->set_cursor_hidden_by_filter(false); | 281 shell->env_filter()->set_cursor_hidden_by_filter(false); |
282 shell->cursor_manager()->ShowCursor(false); | 282 shell->cursor_manager()->DisableMouseEvents(); |
283 | 283 |
284 StartShutdownAnimationImpl(); | 284 StartShutdownAnimationImpl(); |
285 } | 285 } |
286 | 286 |
287 void SessionStateControllerImpl2::OnRootWindowHostCloseRequested( | 287 void SessionStateControllerImpl2::OnRootWindowHostCloseRequested( |
288 const aura::RootWindow*) { | 288 const aura::RootWindow*) { |
289 Shell::GetInstance()->delegate()->Exit(); | 289 Shell::GetInstance()->delegate()->Exit(); |
290 } | 290 } |
291 | 291 |
292 void SessionStateControllerImpl2::OnLockFailTimeout() { | 292 void SessionStateControllerImpl2::OnLockFailTimeout() { |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
331 GetDuration(internal::SessionStateAnimator::ANIMATION_SPEED_SHUTDOWN), | 331 GetDuration(internal::SessionStateAnimator::ANIMATION_SPEED_SHUTDOWN), |
332 this, | 332 this, |
333 &SessionStateControllerImpl2::OnPreShutdownAnimationTimeout); | 333 &SessionStateControllerImpl2::OnPreShutdownAnimationTimeout); |
334 } | 334 } |
335 | 335 |
336 void SessionStateControllerImpl2::OnPreShutdownAnimationTimeout() { | 336 void SessionStateControllerImpl2::OnPreShutdownAnimationTimeout() { |
337 shutting_down_ = true; | 337 shutting_down_ = true; |
338 | 338 |
339 Shell* shell = ash::Shell::GetInstance(); | 339 Shell* shell = ash::Shell::GetInstance(); |
340 shell->env_filter()->set_cursor_hidden_by_filter(false); | 340 shell->env_filter()->set_cursor_hidden_by_filter(false); |
341 shell->cursor_manager()->ShowCursor(false); | 341 shell->cursor_manager()->DisableMouseEvents(); |
342 | 342 |
343 StartRealShutdownTimer(false); | 343 StartRealShutdownTimer(false); |
344 } | 344 } |
345 | 345 |
346 void SessionStateControllerImpl2::StartRealShutdownTimer( | 346 void SessionStateControllerImpl2::StartRealShutdownTimer( |
347 bool with_animation_time) { | 347 bool with_animation_time) { |
348 base::TimeDelta duration = | 348 base::TimeDelta duration = |
349 base::TimeDelta::FromMilliseconds(kShutdownRequestDelayMs); | 349 base::TimeDelta::FromMilliseconds(kShutdownRequestDelayMs); |
350 if (with_animation_time) { | 350 if (with_animation_time) { |
351 duration += animator_->GetDuration( | 351 duration += animator_->GetDuration( |
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
609 unlocked_properties_->background_is_hidden) { | 609 unlocked_properties_->background_is_hidden) { |
610 animator_->StartAnimationWithObserver( | 610 animator_->StartAnimationWithObserver( |
611 internal::SessionStateAnimator::DESKTOP_BACKGROUND, | 611 internal::SessionStateAnimator::DESKTOP_BACKGROUND, |
612 internal::SessionStateAnimator::ANIMATION_FADE_OUT, | 612 internal::SessionStateAnimator::ANIMATION_FADE_OUT, |
613 speed, | 613 speed, |
614 observer); | 614 observer); |
615 } | 615 } |
616 } | 616 } |
617 | 617 |
618 } // namespace ash | 618 } // namespace ash |
OLD | NEW |