| 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 #include "ash/wm/lock_state_controller.h" | 5 #include "ash/wm/lock_state_controller.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" |
| 11 #include "ash/shell_window_ids.h" | 11 #include "ash/shell_window_ids.h" |
| 12 #include "ash/wm/session_state_animator.h" | 12 #include "ash/wm/session_state_animator.h" |
| 13 #include "base/bind_helpers.h" | 13 #include "base/bind_helpers.h" |
| 14 #include "base/command_line.h" | 14 #include "base/command_line.h" |
| 15 #include "base/timer/timer.h" | 15 #include "base/timer/timer.h" |
| 16 #include "ui/aura/root_window.h" | 16 #include "ui/aura/root_window.h" |
| 17 #include "ui/compositor/layer_animation_sequence.h" | 17 #include "ui/compositor/layer_animation_sequence.h" |
| 18 #include "ui/compositor/scoped_layer_animation_settings.h" | 18 #include "ui/compositor/scoped_layer_animation_settings.h" |
| 19 #include "ui/views/corewm/compound_event_filter.h" | 19 #include "ui/views/corewm/compound_event_filter.h" |
| 20 | 20 |
| 21 #if defined(OS_CHROMEOS) | 21 #if defined(OS_CHROMEOS) |
| 22 #include "base/sys_info.h" | 22 #include "base/sys_info.h" |
| 23 #endif | 23 #endif |
| 24 | 24 |
| 25 namespace ash { | 25 namespace ash { |
| 26 | 26 |
| 27 namespace { | 27 namespace { |
| 28 | 28 |
| 29 aura::Window* GetBackground() { | 29 aura::Window* GetBackground() { |
| 30 aura::RootWindow* root_window = Shell::GetPrimaryRootWindow(); | 30 aura::Window* root_window = Shell::GetPrimaryRootWindow(); |
| 31 return Shell::GetContainer(root_window, | 31 return Shell::GetContainer(root_window, |
| 32 internal::kShellWindowId_DesktopBackgroundContainer); | 32 internal::kShellWindowId_DesktopBackgroundContainer); |
| 33 } | 33 } |
| 34 | 34 |
| 35 bool IsBackgroundHidden() { | 35 bool IsBackgroundHidden() { |
| 36 return !GetBackground()->IsVisible(); | 36 return !GetBackground()->IsVisible(); |
| 37 } | 37 } |
| 38 | 38 |
| 39 void ShowBackground() { | 39 void ShowBackground() { |
| 40 ui::ScopedLayerAnimationSettings settings( | 40 ui::ScopedLayerAnimationSettings settings( |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 } | 149 } |
| 150 | 150 |
| 151 LockStateController::LockStateController() | 151 LockStateController::LockStateController() |
| 152 : animator_(new internal::SessionStateAnimator()), | 152 : animator_(new internal::SessionStateAnimator()), |
| 153 login_status_(user::LOGGED_IN_NONE), | 153 login_status_(user::LOGGED_IN_NONE), |
| 154 system_is_locked_(false), | 154 system_is_locked_(false), |
| 155 shutting_down_(false), | 155 shutting_down_(false), |
| 156 shutdown_after_lock_(false), | 156 shutdown_after_lock_(false), |
| 157 animating_lock_(false), | 157 animating_lock_(false), |
| 158 can_cancel_lock_animation_(false) { | 158 can_cancel_lock_animation_(false) { |
| 159 Shell::GetPrimaryRootWindow()->AddRootWindowObserver(this); | 159 Shell::GetPrimaryRootWindow()->GetDispatcher()->AddRootWindowObserver(this); |
| 160 } | 160 } |
| 161 | 161 |
| 162 LockStateController::~LockStateController() { | 162 LockStateController::~LockStateController() { |
| 163 Shell::GetPrimaryRootWindow()->RemoveRootWindowObserver(this); | 163 Shell::GetPrimaryRootWindow()->GetDispatcher()->RemoveRootWindowObserver( |
| 164 this); |
| 164 } | 165 } |
| 165 | 166 |
| 166 void LockStateController::SetDelegate(LockStateControllerDelegate* delegate) { | 167 void LockStateController::SetDelegate(LockStateControllerDelegate* delegate) { |
| 167 delegate_.reset(delegate); | 168 delegate_.reset(delegate); |
| 168 } | 169 } |
| 169 | 170 |
| 170 void LockStateController::AddObserver(LockStateObserver* observer) { | 171 void LockStateController::AddObserver(LockStateObserver* observer) { |
| 171 observers_.AddObserver(observer); | 172 observers_.AddObserver(observer); |
| 172 } | 173 } |
| 173 | 174 |
| (...skipping 474 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 648 unlocked_properties_->background_is_hidden) { | 649 unlocked_properties_->background_is_hidden) { |
| 649 animator_->StartAnimationWithObserver( | 650 animator_->StartAnimationWithObserver( |
| 650 internal::SessionStateAnimator::DESKTOP_BACKGROUND, | 651 internal::SessionStateAnimator::DESKTOP_BACKGROUND, |
| 651 internal::SessionStateAnimator::ANIMATION_FADE_OUT, | 652 internal::SessionStateAnimator::ANIMATION_FADE_OUT, |
| 652 speed, | 653 speed, |
| 653 observer); | 654 observer); |
| 654 } | 655 } |
| 655 } | 656 } |
| 656 | 657 |
| 657 } // namespace ash | 658 } // namespace ash |
| OLD | NEW |