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

Side by Side Diff: chrome/browser/ui/webui/chromeos/login/signin_screen_handler.cc

Issue 1933913002: Add a very basic PIN UI implementation that is shared between lock and settings. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lkgr
Patch Set: Fix tests by removing a previously unused import that started getting used b/c of resource loader c… Created 4 years, 7 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
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 450 matching lines...) Expand 10 before | Expand all | Expand 10 after
461 builder->Add("unrecoverableCryptohomeErrorMessage", 461 builder->Add("unrecoverableCryptohomeErrorMessage",
462 IDS_LOGIN_UNRECOVERABLE_CRYPTOHOME_ERROR_MESSAGE); 462 IDS_LOGIN_UNRECOVERABLE_CRYPTOHOME_ERROR_MESSAGE);
463 builder->Add("unrecoverableCryptohomeErrorContinue", 463 builder->Add("unrecoverableCryptohomeErrorContinue",
464 IDS_LOGIN_UNRECOVERABLE_CRYPTOHOME_ERROR_CONTINUE); 464 IDS_LOGIN_UNRECOVERABLE_CRYPTOHOME_ERROR_CONTINUE);
465 builder->Add("unrecoverableCryptohomeErrorRecreatingProfile", 465 builder->Add("unrecoverableCryptohomeErrorRecreatingProfile",
466 IDS_LOGIN_UNRECOVERABLE_CRYPTOHOME_ERROR_WAIT_MESSAGE); 466 IDS_LOGIN_UNRECOVERABLE_CRYPTOHOME_ERROR_WAIT_MESSAGE);
467 } 467 }
468 468
469 void SigninScreenHandler::RegisterMessages() { 469 void SigninScreenHandler::RegisterMessages() {
470 AddCallback("authenticateUser", &SigninScreenHandler::HandleAuthenticateUser); 470 AddCallback("authenticateUser", &SigninScreenHandler::HandleAuthenticateUser);
471 AddCallback("authenticateUserWithPin",
472 &SigninScreenHandler::HandleAuthenticateUserWithPin);
471 AddCallback("launchIncognito", &SigninScreenHandler::HandleLaunchIncognito); 473 AddCallback("launchIncognito", &SigninScreenHandler::HandleLaunchIncognito);
472 AddCallback("showSupervisedUserCreationScreen", 474 AddCallback("showSupervisedUserCreationScreen",
473 &SigninScreenHandler::HandleShowSupervisedUserCreationScreen); 475 &SigninScreenHandler::HandleShowSupervisedUserCreationScreen);
474 AddCallback("launchPublicSession", 476 AddCallback("launchPublicSession",
475 &SigninScreenHandler::HandleLaunchPublicSession); 477 &SigninScreenHandler::HandleLaunchPublicSession);
476 AddRawCallback("offlineLogin", &SigninScreenHandler::HandleOfflineLogin); 478 AddRawCallback("offlineLogin", &SigninScreenHandler::HandleOfflineLogin);
477 AddCallback("rebootSystem", &SigninScreenHandler::HandleRebootSystem); 479 AddCallback("rebootSystem", &SigninScreenHandler::HandleRebootSystem);
478 AddRawCallback("showAddUser", &SigninScreenHandler::HandleShowAddUser); 480 AddRawCallback("showAddUser", &SigninScreenHandler::HandleShowAddUser);
479 AddCallback("shutdownSystem", &SigninScreenHandler::HandleShutdownSystem); 481 AddCallback("shutdownSystem", &SigninScreenHandler::HandleShutdownSystem);
480 AddCallback("loadWallpaper", &SigninScreenHandler::HandleLoadWallpaper); 482 AddCallback("loadWallpaper", &SigninScreenHandler::HandleLoadWallpaper);
(...skipping 520 matching lines...) Expand 10 before | Expand all | Expand 10 after
1001 if (!delegate_) 1003 if (!delegate_)
1002 return; 1004 return;
1003 DCHECK_EQ(account_id.GetUserEmail(), 1005 DCHECK_EQ(account_id.GetUserEmail(),
1004 gaia::SanitizeEmail(account_id.GetUserEmail())); 1006 gaia::SanitizeEmail(account_id.GetUserEmail()));
1005 1007
1006 UserContext user_context(account_id); 1008 UserContext user_context(account_id);
1007 user_context.SetKey(Key(password)); 1009 user_context.SetKey(Key(password));
1008 delegate_->Login(user_context, SigninSpecifics()); 1010 delegate_->Login(user_context, SigninSpecifics());
1009 } 1011 }
1010 1012
1013 void SigninScreenHandler::HandleAuthenticateUserWithPin(
1014 const AccountId& account_id, const std::string& password) {
1015 if (!delegate_)
1016 return;
1017 DCHECK_EQ(account_id.GetUserEmail(),
1018 gaia::SanitizeEmail(account_id.GetUserEmail()));
1019
1020 // TODO(jdufault): Implement this.
1021 NOTIMPLEMENTED();
1022 }
1023
1011 void SigninScreenHandler::HandleLaunchIncognito() { 1024 void SigninScreenHandler::HandleLaunchIncognito() {
1012 UserContext context(user_manager::USER_TYPE_GUEST, EmptyAccountId()); 1025 UserContext context(user_manager::USER_TYPE_GUEST, EmptyAccountId());
1013 if (delegate_) 1026 if (delegate_)
1014 delegate_->Login(context, SigninSpecifics()); 1027 delegate_->Login(context, SigninSpecifics());
1015 } 1028 }
1016 1029
1017 void SigninScreenHandler::HandleShowSupervisedUserCreationScreen() { 1030 void SigninScreenHandler::HandleShowSupervisedUserCreationScreen() {
1018 if (!user_manager::UserManager::Get()->AreSupervisedUsersAllowed()) { 1031 if (!user_manager::UserManager::Get()->AreSupervisedUsersAllowed()) {
1019 LOG(ERROR) << "Managed users not allowed."; 1032 LOG(ERROR) << "Managed users not allowed.";
1020 return; 1033 return;
(...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after
1421 } 1434 }
1422 1435
1423 void SigninScreenHandler::OnFeedbackFinished() { 1436 void SigninScreenHandler::OnFeedbackFinished() {
1424 CallJS("login.UnrecoverableCryptohomeErrorScreen.resumeAfterFeedbackUI"); 1437 CallJS("login.UnrecoverableCryptohomeErrorScreen.resumeAfterFeedbackUI");
1425 1438
1426 // Recreate user's cryptohome after the feedkback is attempted. 1439 // Recreate user's cryptohome after the feedkback is attempted.
1427 HandleResyncUserData(); 1440 HandleResyncUserData();
1428 } 1441 }
1429 1442
1430 } // namespace chromeos 1443 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/chromeos/login/signin_screen_handler.h ('k') | ui/login/account_picker/user_pod_row.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698