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

Unified Diff: ash/mus/bridge/wm_shell_mus.cc

Issue 2652093002: mash: Make the power button shut the system down. (Closed)
Patch Set: fix test that fails due to locking not working Created 3 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/mus/accelerators/accelerator_controller_unittest.cc ('k') | ash/shell.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/mus/bridge/wm_shell_mus.cc
diff --git a/ash/mus/bridge/wm_shell_mus.cc b/ash/mus/bridge/wm_shell_mus.cc
index ca58c14203786330215a5d4f1997ae352226815f..9658acd3626bfa469545cc73ecd0b9108cd9bf3f 100644
--- a/ash/mus/bridge/wm_shell_mus.cc
+++ b/ash/mus/bridge/wm_shell_mus.cc
@@ -32,6 +32,7 @@
#include "ash/shared/immersive_fullscreen_controller.h"
#include "ash/shell.h"
#include "ash/shell_init_params.h"
+#include "ash/wm/lock_state_controller.h"
#include "ash/wm/window_util.h"
#include "base/memory/ptr_util.h"
#include "components/user_manager/user_info_impl.h"
@@ -63,7 +64,11 @@ class SessionStateDelegateStub : public SessionStateDelegate {
int GetMaximumNumberOfLoggedInUsers() const override { return 3; }
int NumberOfLoggedInUsers() const override { return 1; }
bool IsActiveUserSessionStarted() const override { return true; }
- bool CanLockScreen() const override { return true; }
+ bool CanLockScreen() const override {
+ // The Chrome OS session_manager process currently rejects screen-lock
+ // requests due to no user being logged in.
+ return false;
+ }
bool IsScreenLocked() const override { return screen_locked_; }
bool ShouldLockScreenAutomatically() const override { return false; }
void LockScreen() override {
@@ -390,7 +395,7 @@ void WmShellMus::RemovePointerWatcher(views::PointerWatcher* watcher) {
}
void WmShellMus::RequestShutdown() {
- NOTIMPLEMENTED();
+ Shell::GetInstance()->lock_state_controller()->RequestShutdown();
James Cook 2017/01/25 01:02:59 It looks like this is the same implementation as W
Daniel Erat 2017/01/25 01:10:51 good suggestion. i think that this method is only
James Cook 2017/01/25 01:17:38 I think we're OK using ash::Shell::GetInstance() n
Daniel Erat 2017/01/25 01:40:19 ah, i see that there's a relevant todo in ash/comm
James Cook 2017/01/25 01:45:23 I wouldn't move LSC to ash/common - I think this c
Daniel Erat 2017/01/25 02:06:10 thanks, i've made this change and am testing the D
}
bool WmShellMus::IsTouchDown() {
« no previous file with comments | « ash/mus/accelerators/accelerator_controller_unittest.cc ('k') | ash/shell.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698