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

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

Issue 18850003: Focus kept on login screen. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/ui/ash/session_state_delegate_chromeos.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) 2013 The Chromium Authors. All rights reserved. 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 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/ui/ash/session_state_delegate_chromeos.h" 5 #include "chrome/browser/ui/ash/session_state_delegate_chromeos.h"
6 6
7 #include "ash/session_state_observer.h" 7 #include "ash/session_state_observer.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "chrome/browser/chromeos/login/screen_locker.h" 9 #include "chrome/browser/chromeos/login/screen_locker.h"
10 #include "chrome/browser/chromeos/login/user.h" 10 #include "chrome/browser/chromeos/login/user.h"
11 #include "chrome/browser/chromeos/login/user_adding_screen.h"
11 #include "chrome/browser/chromeos/login/user_manager.h" 12 #include "chrome/browser/chromeos/login/user_manager.h"
12 #include "chromeos/dbus/dbus_thread_manager.h" 13 #include "chromeos/dbus/dbus_thread_manager.h"
13 #include "chromeos/dbus/session_manager_client.h" 14 #include "chromeos/dbus/session_manager_client.h"
14 15
15 SessionStateDelegateChromeos::SessionStateDelegateChromeos() { 16 SessionStateDelegateChromeos::SessionStateDelegateChromeos() {
16 chromeos::UserManager::Get()->AddSessionStateObserver(this); 17 chromeos::UserManager::Get()->AddSessionStateObserver(this);
17 } 18 }
18 19
19 SessionStateDelegateChromeos::~SessionStateDelegateChromeos() { 20 SessionStateDelegateChromeos::~SessionStateDelegateChromeos() {
20 } 21 }
(...skipping 26 matching lines...) Expand all
47 VLOG(1) << "Requesting screen lock from SessionStateDelegate"; 48 VLOG(1) << "Requesting screen lock from SessionStateDelegate";
48 chromeos::DBusThreadManager::Get()->GetSessionManagerClient()-> 49 chromeos::DBusThreadManager::Get()->GetSessionManagerClient()->
49 RequestLockScreen(); 50 RequestLockScreen();
50 } 51 }
51 52
52 void SessionStateDelegateChromeos::UnlockScreen() { 53 void SessionStateDelegateChromeos::UnlockScreen() {
53 // This is used only for testing thus far. 54 // This is used only for testing thus far.
54 NOTIMPLEMENTED(); 55 NOTIMPLEMENTED();
55 } 56 }
56 57
58 bool SessionStateDelegateChromeos::IsUserSessionBlocked() const {
59 return !IsActiveUserSessionStarted() || IsScreenLocked() ||
60 chromeos::UserAddingScreen::Get()->IsRunning();
sky 2013/07/15 22:23:36 Is that last statement really needed?
dzhioev (left Google) 2013/07/16 09:54:36 Yes, it is new UI similar to login/oobe/lock neede
61 }
62
57 const base::string16 SessionStateDelegateChromeos::GetUserDisplayName( 63 const base::string16 SessionStateDelegateChromeos::GetUserDisplayName(
58 ash::MultiProfileIndex index) const { 64 ash::MultiProfileIndex index) const {
59 DCHECK_LT(index, NumberOfLoggedInUsers()); 65 DCHECK_LT(index, NumberOfLoggedInUsers());
60 return chromeos::UserManager::Get()-> 66 return chromeos::UserManager::Get()->
61 GetLRULoggedInUsers()[index]->display_name(); 67 GetLRULoggedInUsers()[index]->display_name();
62 } 68 }
63 69
64 const std::string SessionStateDelegateChromeos::GetUserEmail( 70 const std::string SessionStateDelegateChromeos::GetUserEmail(
65 ash::MultiProfileIndex index) const { 71 ash::MultiProfileIndex index) const {
66 DCHECK_LT(index, NumberOfLoggedInUsers()); 72 DCHECK_LT(index, NumberOfLoggedInUsers());
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 ash::SessionStateObserver* observer) { 104 ash::SessionStateObserver* observer) {
99 session_state_observer_list_.RemoveObserver(observer); 105 session_state_observer_list_.RemoveObserver(observer);
100 } 106 }
101 107
102 void SessionStateDelegateChromeos::ActiveUserChanged( 108 void SessionStateDelegateChromeos::ActiveUserChanged(
103 const chromeos::User* active_user) { 109 const chromeos::User* active_user) {
104 FOR_EACH_OBSERVER(ash::SessionStateObserver, 110 FOR_EACH_OBSERVER(ash::SessionStateObserver,
105 session_state_observer_list_, 111 session_state_observer_list_,
106 ActiveUserChanged(active_user->email())); 112 ActiveUserChanged(active_user->email()));
107 } 113 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/ash/session_state_delegate_chromeos.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698