Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(11)

Side by Side Diff: ash/wm/power_button_controller.cc

Issue 10982040: Fix mouse lock on chromeos (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: update comment Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ash/magnifier/magnification_controller.cc ('k') | ash/wm/window_manager_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_delegate.h" 9 #include "ash/shell_delegate.h"
10 #include "ash/shell_window_ids.h" 10 #include "ash/shell_window_ids.h"
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after
315 login_status_ = status; 315 login_status_ = status;
316 unlocked_login_status_ = user::LOGGED_IN_NONE; 316 unlocked_login_status_ = user::LOGGED_IN_NONE;
317 } 317 }
318 318
319 void PowerButtonController::OnAppTerminating() { 319 void PowerButtonController::OnAppTerminating() {
320 // If we hear that Chrome is exiting but didn't request it ourselves, all we 320 // If we hear that Chrome is exiting but didn't request it ourselves, all we
321 // can really hope for is that we'll have time to clear the screen. 321 // can really hope for is that we'll have time to clear the screen.
322 if (!shutting_down_) { 322 if (!shutting_down_) {
323 shutting_down_ = true; 323 shutting_down_ = true;
324 Shell* shell = ash::Shell::GetInstance(); 324 Shell* shell = ash::Shell::GetInstance();
325 shell->env_filter()->set_update_cursor_visibility(false);
326 shell->cursor_manager()->ShowCursor(false); 325 shell->cursor_manager()->ShowCursor(false);
327 ShowBlackLayer(); 326 ShowBlackLayer();
328 StartAnimation(GetAllContainersMask(), ANIMATION_HIDE); 327 StartAnimation(GetAllContainersMask(), ANIMATION_HIDE);
329 } 328 }
330 } 329 }
331 330
332 void PowerButtonController::OnLockStateChanged(bool locked) { 331 void PowerButtonController::OnLockStateChanged(bool locked) {
333 if (shutting_down_ || (login_status_ == user::LOGGED_IN_LOCKED) == locked) 332 if (shutting_down_ || (login_status_ == user::LOGGED_IN_LOCKED) == locked)
334 return; 333 return;
335 334
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
547 FROM_HERE, 546 FROM_HERE,
548 base::TimeDelta::FromMilliseconds(kShutdownTimeoutMs), 547 base::TimeDelta::FromMilliseconds(kShutdownTimeoutMs),
549 this, &PowerButtonController::OnShutdownTimeout); 548 this, &PowerButtonController::OnShutdownTimeout);
550 } 549 }
551 550
552 void PowerButtonController::StartShutdownAnimationAndRequestShutdown() { 551 void PowerButtonController::StartShutdownAnimationAndRequestShutdown() {
553 DCHECK(!shutting_down_); 552 DCHECK(!shutting_down_);
554 shutting_down_ = true; 553 shutting_down_ = true;
555 554
556 Shell* shell = ash::Shell::GetInstance(); 555 Shell* shell = ash::Shell::GetInstance();
557 shell->env_filter()->set_update_cursor_visibility(false);
558 shell->cursor_manager()->ShowCursor(false); 556 shell->cursor_manager()->ShowCursor(false);
559 557
560 ShowBlackLayer(); 558 ShowBlackLayer();
561 if (login_status_ != user::LOGGED_IN_NONE) { 559 if (login_status_ != user::LOGGED_IN_NONE) {
562 // Hide the other containers before starting the animation. 560 // Hide the other containers before starting the animation.
563 // ANIMATION_FAST_CLOSE will make the screen locker windows partially 561 // ANIMATION_FAST_CLOSE will make the screen locker windows partially
564 // transparent, and we don't want the other windows to show through. 562 // transparent, and we don't want the other windows to show through.
565 StartAnimation(NON_LOCK_SCREEN_CONTAINERS, ANIMATION_HIDE); 563 StartAnimation(NON_LOCK_SCREEN_CONTAINERS, ANIMATION_HIDE);
566 StartAnimation(GetAllLockScreenContainersMask(), ANIMATION_FAST_CLOSE); 564 StartAnimation(GetAllLockScreenContainersMask(), ANIMATION_FAST_CLOSE);
567 } else { 565 } else {
(...skipping 21 matching lines...) Expand all
589 root_layer->StackAtBottom(black_layer_.get()); 587 root_layer->StackAtBottom(black_layer_.get());
590 } 588 }
591 black_layer_->SetVisible(true); 589 black_layer_->SetVisible(true);
592 } 590 }
593 591
594 void PowerButtonController::HideBlackLayer() { 592 void PowerButtonController::HideBlackLayer() {
595 black_layer_.reset(); 593 black_layer_.reset();
596 } 594 }
597 595
598 } // namespace ash 596 } // namespace ash
OLDNEW
« no previous file with comments | « ash/magnifier/magnification_controller.cc ('k') | ash/wm/window_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698