blob: 12ae4391e7a2f1111155fc99769f1c689e149395 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/chromeos/power/power_button_controller_delegate_chromeos.h"
#include "base/logging.h"
#include "chrome/browser/chromeos/dbus/dbus_thread_manager.h"
#include "chrome/browser/chromeos/dbus/power_manager_client.h"
#include "chrome/browser/chromeos/kiosk_mode/kiosk_mode_settings.h"
#include "chrome/browser/ui/browser_list.h"
namespace chromeos {
void PowerButtonControllerDelegateChromeos::RequestLockScreen() {
// If KioskMode is enabled, if the user attempts to lock the screen via
// the power button, we instead want to log the user out. This seemed to
// be the most acceptable replacement for the lock action of the power
// button for Kiosk mode users.
if (KioskModeSettings::Get()->IsKioskModeEnabled()) {
BrowserList::AttemptUserExit();
return;
}
DBusThreadManager::Get()->GetPowerManagerClient()->
NotifyScreenLockRequested();
}
void PowerButtonControllerDelegateChromeos::RequestShutdown() {
DBusThreadManager::Get()->GetPowerManagerClient()->RequestShutdown();
}
} // namespace chromeos
|