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

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

Issue 10825191: Allow closing root window, or pressing the power button to shutdown ash_shell, and chrome /w chrome… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Missed removing this somehow Created 8 years, 4 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
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_window_ids.h" 10 #include "ash/shell_window_ids.h"
10 #include "ash/wm/cursor_manager.h" 11 #include "ash/wm/cursor_manager.h"
11 #include "base/command_line.h" 12 #include "base/command_line.h"
12 #include "base/logging.h" 13 #include "base/logging.h"
13 #include "base/time.h" 14 #include "base/time.h"
14 #include "third_party/skia/include/core/SkColor.h" 15 #include "third_party/skia/include/core/SkColor.h"
15 #include "ui/aura/env.h" 16 #include "ui/aura/env.h"
16 #include "ui/aura/root_window.h" 17 #include "ui/aura/root_window.h"
17 #include "ui/aura/shared/compound_event_filter.h" 18 #include "ui/aura/shared/compound_event_filter.h"
18 #include "ui/aura/window.h" 19 #include "ui/aura/window.h"
(...skipping 446 matching lines...) Expand 10 before | Expand all | Expand 10 after
465 if (!shutting_down_) 466 if (!shutting_down_)
466 StartShutdownAnimationAndRequestShutdown(); 467 StartShutdownAnimationAndRequestShutdown();
467 } 468 }
468 469
469 void PowerButtonController::OnRootWindowResized(const aura::RootWindow* root, 470 void PowerButtonController::OnRootWindowResized(const aura::RootWindow* root,
470 const gfx::Size& new_size) { 471 const gfx::Size& new_size) {
471 if (background_layer_.get()) 472 if (background_layer_.get())
472 background_layer_->SetBounds(gfx::Rect(root->bounds().size())); 473 background_layer_->SetBounds(gfx::Rect(root->bounds().size()));
473 } 474 }
474 475
476 void PowerButtonController::OnRootWindowHostCloseRequested(
477 const aura::RootWindow*) {
478 if(Shell::GetInstance() && Shell::GetInstance()->delegate())
479 Shell::GetInstance()->delegate()->Exit();
480 }
481
475 bool PowerButtonController::LoggedInAsNonGuest() const { 482 bool PowerButtonController::LoggedInAsNonGuest() const {
476 if (login_status_ == user::LOGGED_IN_NONE) 483 if (login_status_ == user::LOGGED_IN_NONE)
477 return false; 484 return false;
478 if (login_status_ == user::LOGGED_IN_GUEST) 485 if (login_status_ == user::LOGGED_IN_GUEST)
479 return false; 486 return false;
480 // TODO(mukai): think about kiosk mode. 487 // TODO(mukai): think about kiosk mode.
481 return true; 488 return true;
482 } 489 }
483 490
484 void PowerButtonController::OnLockTimeout() { 491 void PowerButtonController::OnLockTimeout() {
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
573 root_layer->StackAtBottom(background_layer_.get()); 580 root_layer->StackAtBottom(background_layer_.get());
574 } 581 }
575 background_layer_->SetVisible(true); 582 background_layer_->SetVisible(true);
576 } 583 }
577 584
578 void PowerButtonController::HideBackgroundLayer() { 585 void PowerButtonController::HideBackgroundLayer() {
579 background_layer_.reset(); 586 background_layer_.reset();
580 } 587 }
581 588
582 } // namespace ash 589 } // namespace ash
OLDNEW
« no previous file with comments | « ash/wm/power_button_controller.h ('k') | chrome/browser/chromeos/system/ash_system_tray_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698