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_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 Loading... | |
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::OnRootWindowHostClosed(const aura::RootWindow*) { | |
477 if(Shell::GetInstance() && Shell::GetInstance()->delegate()) { | |
478 Shell::GetInstance()->delegate()->Exit(); | |
sadrul
2012/08/07 13:29:03
Is this change to make sure chrome terminates if t
Harry McCleave
2012/08/07 18:30:14
In its current form the host window doesn't actual
sadrul
2012/08/07 22:13:24
If the user terminates chrome from within chrome (
| |
479 } | |
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 Loading... | |
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 |
OLD | NEW |