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

Side by Side Diff: chrome/browser/ui/ash/session_state_delegate_chromeos.cc

Issue 14295008: Add ash SessionStateDelegate (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased. Created 7 years, 8 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
OLDNEW
(Empty)
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "chrome/browser/ui/ash/session_state_delegate.h"
6
7 #include "base/logging.h"
8 #include "chrome/browser/chromeos/login/screen_locker.h"
9 #include "chrome/browser/chromeos/login/user_manager.h"
10 #include "chromeos/dbus/dbus_thread_manager.h"
11 #include "chromeos/dbus/session_manager_client.h"
12
13 SessionStateDelegate::SessionStateDelegate() {
14 }
15
16 SessionStateDelegate::~SessionStateDelegate() {
17 }
18
19 bool SessionStateDelegate::HasActiveUser() const {
20 return chromeos::UserManager::Get()->IsUserLoggedIn();
21 }
22
23 bool SessionStateDelegate::IsActiveUserSessionStarted() const {
24 return chromeos::UserManager::Get()->IsSessionStarted();
25 }
26
27 bool SessionStateDelegate::CanLockScreen() const {
28 return chromeos::UserManager::Get()->CanCurrentUserLock();
29 }
30
31 bool SessionStateDelegate::IsScreenLocked() const {
32 return chromeos::ScreenLocker::default_screen_locker() &&
33 chromeos::ScreenLocker::default_screen_locker()->locked();
34 }
35
36 void SessionStateDelegate::LockScreen() {
37 if (!CanLockScreen())
38 return;
39
40 // TODO(antrim): Additional logging for http://crbug.com/173178.
41 LOG(WARNING) << "Requesting screen lock from SessionStateDelegate";
42 chromeos::DBusThreadManager::Get()->GetSessionManagerClient()->
43 RequestLockScreen();
44 }
45
46 void SessionStateDelegate::UnlockScreen() {
47 // This is used only for testing thus far.
48 NOTIMPLEMENTED();
49 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/ash/session_state_delegate.h ('k') | chrome/browser/ui/ash/session_state_delegate_views.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698