Index: ash/wm/power_button_controller.cc |
diff --git a/ash/wm/power_button_controller.cc b/ash/wm/power_button_controller.cc |
index 885d3dde361799abef56dda6e048f00096ed5d62..9478de8a741d3ab435fff313eb418edfbca0b137 100644 |
--- a/ash/wm/power_button_controller.cc |
+++ b/ash/wm/power_button_controller.cc |
@@ -275,6 +275,11 @@ bool PowerButtonController::TestApi::BackgroundLayerIsVisible() const { |
controller_->background_layer_->visible(); |
} |
+gfx::Rect PowerButtonController::TestApi::GetBackgroundLayerBounds() const { |
+ ui::Layer* layer = controller_->background_layer_.get(); |
+ return layer ? layer->bounds() : gfx::Rect(); |
+} |
+ |
PowerButtonController::PowerButtonController() |
: login_status_(user::LOGGED_IN_NONE), |
unlocked_login_status_(user::LOGGED_IN_NONE), |
@@ -284,9 +289,11 @@ PowerButtonController::PowerButtonController() |
has_legacy_power_button_( |
CommandLine::ForCurrentProcess()->HasSwitch( |
switches::kAuraLegacyPowerButton)) { |
+ Shell::GetInstance()->GetRootWindow()->AddRootWindowObserver(this); |
} |
PowerButtonController::~PowerButtonController() { |
+ Shell::GetInstance()->GetRootWindow()->RemoveRootWindowObserver(this); |
} |
void PowerButtonController::OnLoginStateChanged(user::LoginStatus status) { |