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

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

Issue 10263015: ash: Resize PowerButtonController background layer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: merge Created 8 years, 7 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/wm/power_button_controller.h ('k') | ash/wm/power_button_controller_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_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 257 matching lines...) Expand 10 before | Expand all | Expand 10 after
268 } 268 }
269 } 269 }
270 return true; 270 return true;
271 } 271 }
272 272
273 bool PowerButtonController::TestApi::BackgroundLayerIsVisible() const { 273 bool PowerButtonController::TestApi::BackgroundLayerIsVisible() const {
274 return controller_->background_layer_.get() && 274 return controller_->background_layer_.get() &&
275 controller_->background_layer_->visible(); 275 controller_->background_layer_->visible();
276 } 276 }
277 277
278 gfx::Rect PowerButtonController::TestApi::GetBackgroundLayerBounds() const {
279 ui::Layer* layer = controller_->background_layer_.get();
280 return layer ? layer->bounds() : gfx::Rect();
281 }
282
278 PowerButtonController::PowerButtonController() 283 PowerButtonController::PowerButtonController()
279 : login_status_(user::LOGGED_IN_NONE), 284 : login_status_(user::LOGGED_IN_NONE),
280 unlocked_login_status_(user::LOGGED_IN_NONE), 285 unlocked_login_status_(user::LOGGED_IN_NONE),
281 power_button_down_(false), 286 power_button_down_(false),
282 lock_button_down_(false), 287 lock_button_down_(false),
283 shutting_down_(false), 288 shutting_down_(false),
284 has_legacy_power_button_( 289 has_legacy_power_button_(
285 CommandLine::ForCurrentProcess()->HasSwitch( 290 CommandLine::ForCurrentProcess()->HasSwitch(
286 switches::kAuraLegacyPowerButton)) { 291 switches::kAuraLegacyPowerButton)) {
292 Shell::GetInstance()->GetRootWindow()->AddRootWindowObserver(this);
287 } 293 }
288 294
289 PowerButtonController::~PowerButtonController() { 295 PowerButtonController::~PowerButtonController() {
296 Shell::GetInstance()->GetRootWindow()->RemoveRootWindowObserver(this);
290 } 297 }
291 298
292 void PowerButtonController::OnLoginStateChanged(user::LoginStatus status) { 299 void PowerButtonController::OnLoginStateChanged(user::LoginStatus status) {
293 login_status_ = status; 300 login_status_ = status;
294 unlocked_login_status_ = user::LOGGED_IN_NONE; 301 unlocked_login_status_ = user::LOGGED_IN_NONE;
295 } 302 }
296 303
297 void PowerButtonController::OnAppTerminating() { 304 void PowerButtonController::OnAppTerminating() {
298 // If we hear that Chrome is exiting but didn't request it ourselves, all we 305 // If we hear that Chrome is exiting but didn't request it ourselves, all we
299 // can really hope for is that we'll have time to clear the screen. 306 // can really hope for is that we'll have time to clear the screen.
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after
551 root_layer->StackAtBottom(background_layer_.get()); 558 root_layer->StackAtBottom(background_layer_.get());
552 } 559 }
553 background_layer_->SetVisible(true); 560 background_layer_->SetVisible(true);
554 } 561 }
555 562
556 void PowerButtonController::HideBackgroundLayer() { 563 void PowerButtonController::HideBackgroundLayer() {
557 background_layer_.reset(); 564 background_layer_.reset();
558 } 565 }
559 566
560 } // namespace ash 567 } // namespace ash
OLDNEW
« no previous file with comments | « ash/wm/power_button_controller.h ('k') | ash/wm/power_button_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698