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

Side by Side Diff: ash/common/shutdown_controller.cc

Issue 2741273002: chromeos: Promotes more from WmShell to Shell (Closed)
Patch Set: feedback 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
« no previous file with comments | « ash/common/shelf/shelf_view.cc ('k') | ash/common/system/user/tray_user_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 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/common/shutdown_controller.h" 5 #include "ash/common/shutdown_controller.h"
6 6
7 #include "ash/common/shell_delegate.h" 7 #include "ash/common/shell_delegate.h"
8 #include "ash/common/wm_shell.h" 8 #include "ash/shell.h"
9 #include "base/sys_info.h" 9 #include "base/sys_info.h"
10 #include "chromeos/dbus/dbus_thread_manager.h" 10 #include "chromeos/dbus/dbus_thread_manager.h"
11 #include "chromeos/dbus/power_manager_client.h" 11 #include "chromeos/dbus/power_manager_client.h"
12 12
13 namespace ash { 13 namespace ash {
14 14
15 ShutdownController::ShutdownController() {} 15 ShutdownController::ShutdownController() {}
16 16
17 ShutdownController::~ShutdownController() {} 17 ShutdownController::~ShutdownController() {}
18 18
19 void ShutdownController::ShutDownOrReboot() { 19 void ShutdownController::ShutDownOrReboot() {
20 // For developers on Linux desktop just exit the app. 20 // For developers on Linux desktop just exit the app.
21 if (!base::SysInfo::IsRunningOnChromeOS()) { 21 if (!base::SysInfo::IsRunningOnChromeOS()) {
22 WmShell::Get()->delegate()->Exit(); 22 Shell::Get()->shell_delegate()->Exit();
23 return; 23 return;
24 } 24 }
25 25
26 // On real Chrome OS hardware the power manager handles shutdown. 26 // On real Chrome OS hardware the power manager handles shutdown.
27 using chromeos::DBusThreadManager; 27 using chromeos::DBusThreadManager;
28 if (reboot_on_shutdown_) 28 if (reboot_on_shutdown_)
29 DBusThreadManager::Get()->GetPowerManagerClient()->RequestRestart(); 29 DBusThreadManager::Get()->GetPowerManagerClient()->RequestRestart();
30 else 30 else
31 DBusThreadManager::Get()->GetPowerManagerClient()->RequestShutdown(); 31 DBusThreadManager::Get()->GetPowerManagerClient()->RequestShutdown();
32 } 32 }
33 33
34 void ShutdownController::SetRebootOnShutdown(bool reboot_on_shutdown) { 34 void ShutdownController::SetRebootOnShutdown(bool reboot_on_shutdown) {
35 reboot_on_shutdown_ = reboot_on_shutdown; 35 reboot_on_shutdown_ = reboot_on_shutdown;
36 } 36 }
37 37
38 void ShutdownController::BindRequest(mojom::ShutdownControllerRequest request) { 38 void ShutdownController::BindRequest(mojom::ShutdownControllerRequest request) {
39 bindings_.AddBinding(this, std::move(request)); 39 bindings_.AddBinding(this, std::move(request));
40 } 40 }
41 41
42 } // namespace ash 42 } // namespace ash
OLDNEW
« no previous file with comments | « ash/common/shelf/shelf_view.cc ('k') | ash/common/system/user/tray_user_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698