OLD | NEW |
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/webui/chromeos/login/signin_screen_handler.h" | 5 #include "chrome/browser/ui/webui/chromeos/login/signin_screen_handler.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <vector> | 10 #include <vector> |
(...skipping 985 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
996 return; | 996 return; |
997 DCHECK_EQ(account_id.GetUserEmail(), | 997 DCHECK_EQ(account_id.GetUserEmail(), |
998 gaia::SanitizeEmail(account_id.GetUserEmail())); | 998 gaia::SanitizeEmail(account_id.GetUserEmail())); |
999 | 999 |
1000 UserContext user_context(account_id); | 1000 UserContext user_context(account_id); |
1001 user_context.SetKey(Key(password)); | 1001 user_context.SetKey(Key(password)); |
1002 delegate_->Login(user_context, SigninSpecifics()); | 1002 delegate_->Login(user_context, SigninSpecifics()); |
1003 } | 1003 } |
1004 | 1004 |
1005 void SigninScreenHandler::HandleLaunchIncognito() { | 1005 void SigninScreenHandler::HandleLaunchIncognito() { |
1006 UserContext context(user_manager::USER_TYPE_GUEST, std::string()); | 1006 UserContext context(user_manager::USER_TYPE_GUEST, EmptyAccountId()); |
1007 if (delegate_) | 1007 if (delegate_) |
1008 delegate_->Login(context, SigninSpecifics()); | 1008 delegate_->Login(context, SigninSpecifics()); |
1009 } | 1009 } |
1010 | 1010 |
1011 void SigninScreenHandler::HandleShowSupervisedUserCreationScreen() { | 1011 void SigninScreenHandler::HandleShowSupervisedUserCreationScreen() { |
1012 if (!user_manager::UserManager::Get()->AreSupervisedUsersAllowed()) { | 1012 if (!user_manager::UserManager::Get()->AreSupervisedUsersAllowed()) { |
1013 LOG(ERROR) << "Managed users not allowed."; | 1013 LOG(ERROR) << "Managed users not allowed."; |
1014 return; | 1014 return; |
1015 } | 1015 } |
1016 LoginDisplayHost::default_host()->StartWizard( | 1016 LoginDisplayHost::default_host()->StartWizard( |
1017 WizardController::kSupervisedUserCreationScreenName); | 1017 WizardController::kSupervisedUserCreationScreenName); |
1018 } | 1018 } |
1019 | 1019 |
1020 void SigninScreenHandler::HandleLaunchPublicSession( | 1020 void SigninScreenHandler::HandleLaunchPublicSession( |
1021 const AccountId& account_id, | 1021 const AccountId& account_id, |
1022 const std::string& locale, | 1022 const std::string& locale, |
1023 const std::string& input_method) { | 1023 const std::string& input_method) { |
1024 if (!delegate_) | 1024 if (!delegate_) |
1025 return; | 1025 return; |
1026 | 1026 |
1027 UserContext context(user_manager::USER_TYPE_PUBLIC_ACCOUNT, | 1027 UserContext context(user_manager::USER_TYPE_PUBLIC_ACCOUNT, account_id); |
1028 account_id.GetUserEmail()); | |
1029 context.SetPublicSessionLocale(locale), | 1028 context.SetPublicSessionLocale(locale), |
1030 context.SetPublicSessionInputMethod(input_method); | 1029 context.SetPublicSessionInputMethod(input_method); |
1031 delegate_->Login(context, SigninSpecifics()); | 1030 delegate_->Login(context, SigninSpecifics()); |
1032 } | 1031 } |
1033 | 1032 |
1034 void SigninScreenHandler::HandleOfflineLogin(const base::ListValue* args) { | 1033 void SigninScreenHandler::HandleOfflineLogin(const base::ListValue* args) { |
1035 if (!delegate_ || delegate_->IsShowUsers()) { | 1034 if (!delegate_ || delegate_->IsShowUsers()) { |
1036 NOTREACHED(); | 1035 NOTREACHED(); |
1037 return; | 1036 return; |
1038 } | 1037 } |
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1271 void SigninScreenHandler::SendPublicSessionKeyboardLayouts( | 1270 void SigninScreenHandler::SendPublicSessionKeyboardLayouts( |
1272 const AccountId& account_id, | 1271 const AccountId& account_id, |
1273 const std::string& locale, | 1272 const std::string& locale, |
1274 scoped_ptr<base::ListValue> keyboard_layouts) { | 1273 scoped_ptr<base::ListValue> keyboard_layouts) { |
1275 CallJS("login.AccountPickerScreen.setPublicSessionKeyboardLayouts", | 1274 CallJS("login.AccountPickerScreen.setPublicSessionKeyboardLayouts", |
1276 account_id, locale, *keyboard_layouts); | 1275 account_id, locale, *keyboard_layouts); |
1277 } | 1276 } |
1278 | 1277 |
1279 void SigninScreenHandler::HandleLaunchKioskApp(const AccountId& app_account_id, | 1278 void SigninScreenHandler::HandleLaunchKioskApp(const AccountId& app_account_id, |
1280 bool diagnostic_mode) { | 1279 bool diagnostic_mode) { |
1281 UserContext context(user_manager::USER_TYPE_KIOSK_APP, | 1280 UserContext context(user_manager::USER_TYPE_KIOSK_APP, app_account_id); |
1282 app_account_id.GetUserEmail()); | |
1283 SigninSpecifics specifics; | 1281 SigninSpecifics specifics; |
1284 specifics.kiosk_diagnostic_mode = diagnostic_mode; | 1282 specifics.kiosk_diagnostic_mode = diagnostic_mode; |
1285 if (delegate_) | 1283 if (delegate_) |
1286 delegate_->Login(context, specifics); | 1284 delegate_->Login(context, specifics); |
1287 } | 1285 } |
1288 | 1286 |
1289 void SigninScreenHandler::HandleGetTouchViewState() { | 1287 void SigninScreenHandler::HandleGetTouchViewState() { |
1290 if (max_mode_delegate_) { | 1288 if (max_mode_delegate_) { |
1291 CallJS("login.AccountPickerScreen.setTouchViewState", | 1289 CallJS("login.AccountPickerScreen.setTouchViewState", |
1292 max_mode_delegate_->IsMaximizeModeEnabled()); | 1290 max_mode_delegate_->IsMaximizeModeEnabled()); |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1418 CallJS("login.AccountPickerScreen.setCapsLockState", caps_lock_enabled_); | 1416 CallJS("login.AccountPickerScreen.setCapsLockState", caps_lock_enabled_); |
1419 } | 1417 } |
1420 | 1418 |
1421 void SigninScreenHandler::OnSysLogFeedbackSent(bool sent) { | 1419 void SigninScreenHandler::OnSysLogFeedbackSent(bool sent) { |
1422 LOG_IF(ERROR, !sent) << "Failed to send syslog feedback."; | 1420 LOG_IF(ERROR, !sent) << "Failed to send syslog feedback."; |
1423 // Recreate user's cryptohome after the feedkback is attempted. | 1421 // Recreate user's cryptohome after the feedkback is attempted. |
1424 HandleResyncUserData(); | 1422 HandleResyncUserData(); |
1425 } | 1423 } |
1426 | 1424 |
1427 } // namespace chromeos | 1425 } // namespace chromeos |
OLD | NEW |