| 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/power_button_controller.h" | 5 #include "ash/wm/power_button_controller.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_window_ids.h" | 9 #include "ash/shell_window_ids.h" |
| 10 #include "ash/wm/root_window_event_filter.h" | 10 #include "ash/wm/root_window_event_filter.h" |
| (...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 283 lock_button_down_(false), | 283 lock_button_down_(false), |
| 284 shutting_down_(false), | 284 shutting_down_(false), |
| 285 has_legacy_power_button_( | 285 has_legacy_power_button_( |
| 286 CommandLine::ForCurrentProcess()->HasSwitch( | 286 CommandLine::ForCurrentProcess()->HasSwitch( |
| 287 switches::kAuraLegacyPowerButton)) { | 287 switches::kAuraLegacyPowerButton)) { |
| 288 } | 288 } |
| 289 | 289 |
| 290 PowerButtonController::~PowerButtonController() { | 290 PowerButtonController::~PowerButtonController() { |
| 291 } | 291 } |
| 292 | 292 |
| 293 void PowerButtonController::OnLoginStateChange(bool logged_in, bool is_guest) { | 293 void PowerButtonController::OnLoginStateChanged(bool logged_in, bool is_guest) { |
| 294 logged_in_ = logged_in; | 294 logged_in_ = logged_in; |
| 295 is_guest_ = is_guest; | 295 is_guest_ = is_guest; |
| 296 } | 296 } |
| 297 | 297 |
| 298 void PowerButtonController::OnExit() { | 298 void PowerButtonController::OnAppTerminating() { |
| 299 // If we hear that Chrome is exiting but didn't request it ourselves, all we | 299 // If we hear that Chrome is exiting but didn't request it ourselves, all we |
| 300 // can really hope for is that we'll have time to clear the screen. | 300 // can really hope for is that we'll have time to clear the screen. |
| 301 if (!shutting_down_) { | 301 if (!shutting_down_) { |
| 302 shutting_down_ = true; | 302 shutting_down_ = true; |
| 303 ash::Shell::GetInstance()->root_filter()-> | 303 ash::Shell::GetInstance()->root_filter()-> |
| 304 set_update_cursor_visibility(false); | 304 set_update_cursor_visibility(false); |
| 305 Shell::GetRootWindow()->ShowCursor(false); | 305 Shell::GetRootWindow()->ShowCursor(false); |
| 306 ShowBackgroundLayer(); | 306 ShowBackgroundLayer(); |
| 307 StartAnimation(ALL_CONTAINERS, ANIMATION_HIDE); | 307 StartAnimation(ALL_CONTAINERS, ANIMATION_HIDE); |
| 308 } | 308 } |
| 309 } | 309 } |
| 310 | 310 |
| 311 void PowerButtonController::OnLockStateChange(bool locked) { | 311 void PowerButtonController::OnLockStateChanged(bool locked) { |
| 312 if (shutting_down_ || locked_ == locked) | 312 if (shutting_down_ || locked_ == locked) |
| 313 return; | 313 return; |
| 314 | 314 |
| 315 locked_ = locked; | 315 locked_ = locked; |
| 316 if (locked) { | 316 if (locked) { |
| 317 StartAnimation(SCREEN_LOCKER_CONTAINERS, ANIMATION_FADE_IN); | 317 StartAnimation(SCREEN_LOCKER_CONTAINERS, ANIMATION_FADE_IN); |
| 318 lock_timer_.Stop(); | 318 lock_timer_.Stop(); |
| 319 lock_fail_timer_.Stop(); | 319 lock_fail_timer_.Stop(); |
| 320 | 320 |
| 321 if (!has_legacy_power_button_ && power_button_down_) { | 321 if (!has_legacy_power_button_ && power_button_down_) { |
| (...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 534 root_layer->StackAtBottom(background_layer_.get()); | 534 root_layer->StackAtBottom(background_layer_.get()); |
| 535 } | 535 } |
| 536 background_layer_->SetVisible(true); | 536 background_layer_->SetVisible(true); |
| 537 } | 537 } |
| 538 | 538 |
| 539 void PowerButtonController::HideBackgroundLayer() { | 539 void PowerButtonController::HideBackgroundLayer() { |
| 540 background_layer_.reset(); | 540 background_layer_.reset(); |
| 541 } | 541 } |
| 542 | 542 |
| 543 } // namespace ash | 543 } // namespace ash |
| OLD | NEW |