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

Unified Diff: ash/common/shutdown_controller.cc

Issue 2616023005: cros: Remove OS_CHROMEOS ifdefs in ash/common (Closed)
Patch Set: review comments 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/common/mojo_interface_factory.cc ('k') | ash/common/wallpaper/wallpaper_controller_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/common/shutdown_controller.cc
diff --git a/ash/common/shutdown_controller.cc b/ash/common/shutdown_controller.cc
index 7342eb2cc43810226512d35becb9ed05550ae8f6..b40fe8626152d55caa874aefca83199e8a9b8c8e 100644
--- a/ash/common/shutdown_controller.cc
+++ b/ash/common/shutdown_controller.cc
@@ -6,12 +6,9 @@
#include "ash/common/shell_delegate.h"
#include "ash/common/wm_shell.h"
-
-#if defined(OS_CHROMEOS)
#include "base/sys_info.h"
#include "chromeos/dbus/dbus_thread_manager.h"
#include "chromeos/dbus/power_manager_client.h"
-#endif
namespace ash {
@@ -20,20 +17,18 @@ ShutdownController::ShutdownController() {}
ShutdownController::~ShutdownController() {}
void ShutdownController::ShutDownOrReboot() {
-#if defined(OS_CHROMEOS)
- if (base::SysInfo::IsRunningOnChromeOS()) {
- // Power manager handles shutdown on Chrome OS hardware.
- using chromeos::DBusThreadManager;
- if (reboot_on_shutdown_)
- DBusThreadManager::Get()->GetPowerManagerClient()->RequestRestart();
- else
- DBusThreadManager::Get()->GetPowerManagerClient()->RequestShutdown();
+ // For developers on Linux desktop just exit the app.
+ if (!base::SysInfo::IsRunningOnChromeOS()) {
+ WmShell::Get()->delegate()->Exit();
return;
}
-#endif // defined(OS_CHROMEOS)
- // On Windows and on Linux desktop just exit.
- WmShell::Get()->delegate()->Exit();
+ // On real Chrome OS hardware the power manager handles shutdown.
+ using chromeos::DBusThreadManager;
+ if (reboot_on_shutdown_)
+ DBusThreadManager::Get()->GetPowerManagerClient()->RequestRestart();
+ else
+ DBusThreadManager::Get()->GetPowerManagerClient()->RequestShutdown();
}
void ShutdownController::SetRebootOnShutdown(bool reboot_on_shutdown) {
« no previous file with comments | « ash/common/mojo_interface_factory.cc ('k') | ash/common/wallpaper/wallpaper_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698