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

Side by Side Diff: chrome/browser/chromeos/power/shutdown_client_impl.cc

Issue 2471643002: mash: remove the LockStateControllerDelegate. (Closed)
Patch Set: sky comments Created 4 years, 1 month 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 | « chrome/browser/chromeos/power/shutdown_client_impl.h ('k') | no next file » | 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 "chrome/browser/chromeos/power/session_state_controller_delegate_chrome os.h" 5 #include "chrome/browser/chromeos/power/shutdown_client_impl.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "chrome/browser/chromeos/settings/cros_settings.h" 8 #include "chrome/browser/chromeos/settings/cros_settings.h"
9 #include "chromeos/dbus/dbus_thread_manager.h" 9 #include "chromeos/dbus/dbus_thread_manager.h"
10 #include "chromeos/dbus/power_manager_client.h" 10 #include "chromeos/dbus/power_manager_client.h"
11 #include "chromeos/dbus/session_manager_client.h" 11 #include "chromeos/dbus/session_manager_client.h"
12 #include "chromeos/settings/cros_settings_names.h" 12 #include "chromeos/settings/cros_settings_names.h"
13 13
14 namespace chromeos { 14 namespace chromeos {
15 15
16 SessionStateControllerDelegateChromeos::SessionStateControllerDelegateChromeos() 16 ShutdownClientImpl::ShutdownClientImpl() : weak_factory_(this) {}
17 : weak_factory_(this) {
18 }
19 17
20 SessionStateControllerDelegateChromeos:: 18 ShutdownClientImpl::~ShutdownClientImpl() {}
21 ~SessionStateControllerDelegateChromeos() {
22 }
23 19
24 void SessionStateControllerDelegateChromeos::RequestShutdown() { 20 void ShutdownClientImpl::RequestShutdown() {
25 CrosSettings* cros_settings = CrosSettings::Get(); 21 CrosSettings* cros_settings = CrosSettings::Get();
26 CrosSettingsProvider::TrustedStatus status = 22 CrosSettingsProvider::TrustedStatus status =
27 cros_settings->PrepareTrustedValues(base::Bind( 23 cros_settings->PrepareTrustedValues(base::Bind(
28 &SessionStateControllerDelegateChromeos::RequestShutdown, 24 &ShutdownClientImpl::RequestShutdown, weak_factory_.GetWeakPtr()));
29 weak_factory_.GetWeakPtr()));
30 if (status != CrosSettingsProvider::TRUSTED) 25 if (status != CrosSettingsProvider::TRUSTED)
31 return; 26 return;
32 27
33 // Get the updated policy. 28 // Get the updated policy.
34 bool reboot_on_shutdown = false; 29 bool reboot_on_shutdown = false;
35 cros_settings->GetBoolean(kRebootOnShutdown, &reboot_on_shutdown); 30 cros_settings->GetBoolean(kRebootOnShutdown, &reboot_on_shutdown);
36 31
37 if (reboot_on_shutdown) 32 if (reboot_on_shutdown)
38 DBusThreadManager::Get()->GetPowerManagerClient()->RequestRestart(); 33 DBusThreadManager::Get()->GetPowerManagerClient()->RequestRestart();
39 else 34 else
40 DBusThreadManager::Get()->GetPowerManagerClient()->RequestShutdown(); 35 DBusThreadManager::Get()->GetPowerManagerClient()->RequestShutdown();
41 } 36 }
42 37
43 } // namespace chromeos 38 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/power/shutdown_client_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698