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

Side by Side Diff: chrome/browser/chromeos/login/existing_user_controller.cc

Issue 228553002: Preference dis/allowing supervised users creation is now available as owner setting, not only as de… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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 | Annotate | Revision Log
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/login/existing_user_controller.h" 5 #include "chrome/browser/chromeos/login/existing_user_controller.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 base::Bind(&ExistingUserController::DeviceSettingsChanged, 153 base::Bind(&ExistingUserController::DeviceSettingsChanged,
154 base::Unretained(this))); 154 base::Unretained(this)));
155 allow_new_user_subscription_ = cros_settings_->AddSettingsObserver( 155 allow_new_user_subscription_ = cros_settings_->AddSettingsObserver(
156 kAccountsPrefAllowNewUser, 156 kAccountsPrefAllowNewUser,
157 base::Bind(&ExistingUserController::DeviceSettingsChanged, 157 base::Bind(&ExistingUserController::DeviceSettingsChanged,
158 base::Unretained(this))); 158 base::Unretained(this)));
159 allow_guest_subscription_ = cros_settings_->AddSettingsObserver( 159 allow_guest_subscription_ = cros_settings_->AddSettingsObserver(
160 kAccountsPrefAllowGuest, 160 kAccountsPrefAllowGuest,
161 base::Bind(&ExistingUserController::DeviceSettingsChanged, 161 base::Bind(&ExistingUserController::DeviceSettingsChanged,
162 base::Unretained(this))); 162 base::Unretained(this)));
163 allow_supervised_user_subscription_ = cros_settings_->AddSettingsObserver(
164 kAccountsPrefSupervisedUsersEnabled,
165 base::Bind(&ExistingUserController::DeviceSettingsChanged,
166 base::Unretained(this)));
163 users_subscription_ = cros_settings_->AddSettingsObserver( 167 users_subscription_ = cros_settings_->AddSettingsObserver(
164 kAccountsPrefUsers, 168 kAccountsPrefUsers,
165 base::Bind(&ExistingUserController::DeviceSettingsChanged, 169 base::Bind(&ExistingUserController::DeviceSettingsChanged,
166 base::Unretained(this))); 170 base::Unretained(this)));
167 local_account_auto_login_id_subscription_ = 171 local_account_auto_login_id_subscription_ =
168 cros_settings_->AddSettingsObserver( 172 cros_settings_->AddSettingsObserver(
169 kAccountsPrefDeviceLocalAccountAutoLoginId, 173 kAccountsPrefDeviceLocalAccountAutoLoginId,
170 base::Bind(&ExistingUserController::ConfigurePublicSessionAutoLogin, 174 base::Bind(&ExistingUserController::ConfigurePublicSessionAutoLogin,
171 base::Unretained(this))); 175 base::Unretained(this)));
172 local_account_auto_login_delay_subscription_ = 176 local_account_auto_login_delay_subscription_ =
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 } 208 }
205 209
206 // If no user pods are visible, fallback to single new user pod which will 210 // If no user pods are visible, fallback to single new user pod which will
207 // have guest session link. 211 // have guest session link.
208 bool show_guest; 212 bool show_guest;
209 cros_settings_->GetBoolean(kAccountsPrefAllowGuest, &show_guest); 213 cros_settings_->GetBoolean(kAccountsPrefAllowGuest, &show_guest);
210 bool show_users; 214 bool show_users;
211 cros_settings_->GetBoolean(kAccountsPrefShowUserNamesOnSignIn, &show_users); 215 cros_settings_->GetBoolean(kAccountsPrefShowUserNamesOnSignIn, &show_users);
212 show_guest &= !filtered_users.empty(); 216 show_guest &= !filtered_users.empty();
213 bool show_new_user = true; 217 bool show_new_user = true;
218 bool show_supervised;
219 cros_settings_->GetBoolean(kAccountsPrefSupervisedUsersEnabled,
220 &show_supervised);
214 login_display_->set_parent_window(GetNativeWindow()); 221 login_display_->set_parent_window(GetNativeWindow());
215 login_display_->Init(filtered_users, show_guest, show_users, show_new_user); 222 login_display_->Init(
223 filtered_users, show_guest, show_supervised, show_users, show_new_user);
216 host_->OnPreferencesChanged(); 224 host_->OnPreferencesChanged();
217 } 225 }
218 226
219 void ExistingUserController::DoAutoEnrollment() { 227 void ExistingUserController::DoAutoEnrollment() {
220 do_auto_enrollment_ = true; 228 do_auto_enrollment_ = true;
221 } 229 }
222 230
223 void ExistingUserController::ResumeLogin() { 231 void ExistingUserController::ResumeLogin() {
224 // This means the user signed-in, then auto-enrollment used his credentials 232 // This means the user signed-in, then auto-enrollment used his credentials
225 // to enroll and succeeded. 233 // to enroll and succeeded.
(...skipping 886 matching lines...) Expand 10 before | Expand all | Expand 10 after
1112 } 1120 }
1113 1121
1114 void ExistingUserController::SendAccessibilityAlert( 1122 void ExistingUserController::SendAccessibilityAlert(
1115 const std::string& alert_text) { 1123 const std::string& alert_text) {
1116 AccessibilityAlertInfo event(ProfileHelper::GetSigninProfile(), alert_text); 1124 AccessibilityAlertInfo event(ProfileHelper::GetSigninProfile(), alert_text);
1117 SendControlAccessibilityNotification( 1125 SendControlAccessibilityNotification(
1118 ui::AX_EVENT_VALUE_CHANGED, &event); 1126 ui::AX_EVENT_VALUE_CHANGED, &event);
1119 } 1127 }
1120 1128
1121 } // namespace chromeos 1129 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698