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

Side by Side Diff: chromeos/login/login_state.cc

Issue 393343002: Rename "managed (mode|user)" to "supervised user" (part 7) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: more alphabetize (and rebase again) Created 6 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 | « chromeos/login/login_state.h ('k') | chromeos/login/user_names.h » ('j') | 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 "chromeos/login/login_state.h" 5 #include "chromeos/login/login_state.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/sys_info.h" 9 #include "base/sys_info.h"
10 #include "chromeos/chromeos_switches.h" 10 #include "chromeos/chromeos_switches.h"
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 return logged_in_state_ == LOGGED_IN_SAFE_MODE; 92 return logged_in_state_ == LOGGED_IN_SAFE_MODE;
93 } 93 }
94 94
95 bool LoginState::IsGuestUser() const { 95 bool LoginState::IsGuestUser() const {
96 if (!IsUserLoggedIn()) 96 if (!IsUserLoggedIn())
97 return false; 97 return false;
98 switch (logged_in_user_type_) { 98 switch (logged_in_user_type_) {
99 case LOGGED_IN_USER_NONE: 99 case LOGGED_IN_USER_NONE:
100 case LOGGED_IN_USER_REGULAR: 100 case LOGGED_IN_USER_REGULAR:
101 case LOGGED_IN_USER_OWNER: 101 case LOGGED_IN_USER_OWNER:
102 case LOGGED_IN_USER_LOCALLY_MANAGED: 102 case LOGGED_IN_USER_SUPERVISED:
103 case LOGGED_IN_USER_KIOSK_APP: 103 case LOGGED_IN_USER_KIOSK_APP:
104 return false; 104 return false;
105 case LOGGED_IN_USER_GUEST: 105 case LOGGED_IN_USER_GUEST:
106 case LOGGED_IN_USER_RETAIL_MODE: 106 case LOGGED_IN_USER_RETAIL_MODE:
107 case LOGGED_IN_USER_PUBLIC_ACCOUNT: 107 case LOGGED_IN_USER_PUBLIC_ACCOUNT:
108 return true; 108 return true;
109 } 109 }
110 NOTREACHED(); 110 NOTREACHED();
111 return false; 111 return false;
112 } 112 }
113 113
114 bool LoginState::IsKioskApp() const { 114 bool LoginState::IsKioskApp() const {
115 return logged_in_user_type_ == LoginState::LOGGED_IN_USER_KIOSK_APP; 115 return logged_in_user_type_ == LoginState::LOGGED_IN_USER_KIOSK_APP;
116 } 116 }
117 117
118 bool LoginState::UserHasNetworkProfile() const { 118 bool LoginState::UserHasNetworkProfile() const {
119 if (!IsUserLoggedIn()) 119 if (!IsUserLoggedIn())
120 return false; 120 return false;
121 return logged_in_user_type_ != LOGGED_IN_USER_RETAIL_MODE && 121 return logged_in_user_type_ != LOGGED_IN_USER_RETAIL_MODE &&
122 logged_in_user_type_ != LOGGED_IN_USER_PUBLIC_ACCOUNT; 122 logged_in_user_type_ != LOGGED_IN_USER_PUBLIC_ACCOUNT;
123 } 123 }
124 124
125 bool LoginState::IsUserAuthenticated() const { 125 bool LoginState::IsUserAuthenticated() const {
126 return logged_in_user_type_ == LOGGED_IN_USER_REGULAR || 126 return logged_in_user_type_ == LOGGED_IN_USER_REGULAR ||
127 logged_in_user_type_ == LOGGED_IN_USER_OWNER || 127 logged_in_user_type_ == LOGGED_IN_USER_OWNER ||
128 logged_in_user_type_ == LOGGED_IN_USER_LOCALLY_MANAGED; 128 logged_in_user_type_ == LOGGED_IN_USER_SUPERVISED;
129 } 129 }
130 130
131 bool LoginState::IsUserGaiaAuthenticated() const { 131 bool LoginState::IsUserGaiaAuthenticated() const {
132 return logged_in_user_type_ == LOGGED_IN_USER_REGULAR || 132 return logged_in_user_type_ == LOGGED_IN_USER_REGULAR ||
133 logged_in_user_type_ == LOGGED_IN_USER_OWNER; 133 logged_in_user_type_ == LOGGED_IN_USER_OWNER;
134 } 134 }
135 135
136 // Private methods 136 // Private methods
137 137
138 LoginState::LoginState() : logged_in_state_(LOGGED_IN_NONE), 138 LoginState::LoginState() : logged_in_state_(LOGGED_IN_NONE),
139 logged_in_user_type_(LOGGED_IN_USER_NONE), 139 logged_in_user_type_(LOGGED_IN_USER_NONE),
140 always_logged_in_(AlwaysLoggedInByDefault()) { 140 always_logged_in_(AlwaysLoggedInByDefault()) {
141 } 141 }
142 142
143 LoginState::~LoginState() { 143 LoginState::~LoginState() {
144 } 144 }
145 145
146 void LoginState::NotifyObservers() { 146 void LoginState::NotifyObservers() {
147 FOR_EACH_OBSERVER(LoginState::Observer, observer_list_, 147 FOR_EACH_OBSERVER(LoginState::Observer, observer_list_,
148 LoggedInStateChanged()); 148 LoggedInStateChanged());
149 } 149 }
150 150
151 } // namespace chromeos 151 } // namespace chromeos
OLDNEW
« no previous file with comments | « chromeos/login/login_state.h ('k') | chromeos/login/user_names.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698