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

Side by Side Diff: ash/system/chromeos/power/tablet_power_button_controller_unittest.cc

Issue 2766543002: Move even more from WmShell to Shell (Closed)
Patch Set: Created 3 years, 9 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
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/system/chromeos/power/tablet_power_button_controller.h" 5 #include "ash/system/chromeos/power/tablet_power_button_controller.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "ash/common/ash_switches.h" 9 #include "ash/common/ash_switches.h"
10 #include "ash/common/session/session_controller.h" 10 #include "ash/common/session/session_controller.h"
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 GetSessionControllerClient()->UnlockScreen(); 97 GetSessionControllerClient()->UnlockScreen();
98 } 98 }
99 99
100 void Initialize(LoginStatus status) { 100 void Initialize(LoginStatus status) {
101 lock_state_controller_->OnLoginStateChanged(status); 101 lock_state_controller_->OnLoginStateChanged(status);
102 SetUserLoggedIn(status != LoginStatus::NOT_LOGGED_IN); 102 SetUserLoggedIn(status != LoginStatus::NOT_LOGGED_IN);
103 lock_state_controller_->OnLockStateChanged(false); 103 lock_state_controller_->OnLockStateChanged(false);
104 } 104 }
105 105
106 void EnableMaximizeMode(bool enabled) { 106 void EnableMaximizeMode(bool enabled) {
107 WmShell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager( 107 Shell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager(
108 enabled); 108 enabled);
109 } 109 }
110 110
111 bool GetLockedState() { 111 bool GetLockedState() {
112 // LockScreen is an async mojo call. Spin message loop to ensure it is 112 // LockScreen is an async mojo call. Spin message loop to ensure it is
113 // delivered. 113 // delivered.
114 SessionController* const session_controller = 114 SessionController* const session_controller =
115 WmShell::Get()->session_controller(); 115 WmShell::Get()->session_controller();
116 session_controller->FlushMojoForTest(); 116 session_controller->FlushMojoForTest();
117 return session_controller->IsScreenLocked(); 117 return session_controller->IsScreenLocked();
(...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after
478 // Test that after another long duration, backlights should be forced off. 478 // Test that after another long duration, backlights should be forced off.
479 tick_clock_->Advance(base::TimeDelta::FromMilliseconds(800)); 479 tick_clock_->Advance(base::TimeDelta::FromMilliseconds(800));
480 power_manager_client_->SendPowerButtonEvent(true, tick_clock_->NowTicks()); 480 power_manager_client_->SendPowerButtonEvent(true, tick_clock_->NowTicks());
481 power_manager_client_->SendPowerButtonEvent(false, tick_clock_->NowTicks()); 481 power_manager_client_->SendPowerButtonEvent(false, tick_clock_->NowTicks());
482 power_manager_client_->SendBrightnessChanged(0, false); 482 power_manager_client_->SendBrightnessChanged(0, false);
483 EXPECT_TRUE(GetBacklightsForcedOff()); 483 EXPECT_TRUE(GetBacklightsForcedOff());
484 } 484 }
485 485
486 } // namespace test 486 } // namespace test
487 } // namespace ash 487 } // namespace ash
OLDNEW
« no previous file with comments | « ash/system/chromeos/power/tablet_power_button_controller.cc ('k') | ash/system/chromeos/rotation/tray_rotation_lock.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698