| Index: chrome/browser/ui/webui/chromeos/login/signin_screen_handler.cc
|
| diff --git a/chrome/browser/ui/webui/chromeos/login/signin_screen_handler.cc b/chrome/browser/ui/webui/chromeos/login/signin_screen_handler.cc
|
| index 73ee81e6f3ef2d59dc592d0cacc40c1fef700a1e..1f05411ec0dd3342a96b0f9468a9157cdc7a9d87 100644
|
| --- a/chrome/browser/ui/webui/chromeos/login/signin_screen_handler.cc
|
| +++ b/chrome/browser/ui/webui/chromeos/login/signin_screen_handler.cc
|
| @@ -874,7 +874,7 @@
|
|
|
| void SigninScreenHandler::OnUserImageChanged(const user_manager::User& user) {
|
| if (page_is_ready())
|
| - CallJS("login.AccountPickerScreen.updateUserImage", user.GetAccountId());
|
| + CallJS("login.AccountPickerScreen.updateUserImage", user.email());
|
| }
|
|
|
| void SigninScreenHandler::OnPreferencesChanged() {
|
| @@ -988,14 +988,12 @@
|
| AllWhitelistedUsersPresent());
|
| }
|
|
|
| -void SigninScreenHandler::HandleAuthenticateUser(const AccountId& account_id,
|
| +void SigninScreenHandler::HandleAuthenticateUser(const std::string& username,
|
| const std::string& password) {
|
| if (!delegate_)
|
| return;
|
| - DCHECK_EQ(account_id.GetUserEmail(),
|
| - gaia::SanitizeEmail(account_id.GetUserEmail()));
|
| -
|
| - UserContext user_context(account_id);
|
| + UserContext user_context(
|
| + AccountId::FromUserEmail(gaia::SanitizeEmail(username)));
|
| user_context.SetKey(Key(password));
|
| delegate_->Login(user_context, SigninSpecifics());
|
| }
|
| @@ -1016,14 +1014,13 @@
|
| }
|
|
|
| void SigninScreenHandler::HandleLaunchPublicSession(
|
| - const AccountId& account_id,
|
| + const std::string& user_id,
|
| const std::string& locale,
|
| const std::string& input_method) {
|
| if (!delegate_)
|
| return;
|
|
|
| - UserContext context(user_manager::USER_TYPE_PUBLIC_ACCOUNT,
|
| - account_id.GetUserEmail());
|
| + UserContext context(user_manager::USER_TYPE_PUBLIC_ACCOUNT, user_id);
|
| context.SetPublicSessionLocale(locale),
|
| context.SetPublicSessionInputMethod(input_method);
|
| delegate_->Login(context, SigninSpecifics());
|
| @@ -1046,22 +1043,22 @@
|
| ash::Shell::GetInstance()->lock_state_controller()->RequestShutdown();
|
| }
|
|
|
| -void SigninScreenHandler::HandleLoadWallpaper(const AccountId& account_id) {
|
| +void SigninScreenHandler::HandleLoadWallpaper(const std::string& email) {
|
| if (delegate_)
|
| - delegate_->LoadWallpaper(account_id.GetUserEmail());
|
| + delegate_->LoadWallpaper(email);
|
| }
|
|
|
| void SigninScreenHandler::HandleRebootSystem() {
|
| chromeos::DBusThreadManager::Get()->GetPowerManagerClient()->RequestRestart();
|
| }
|
|
|
| -void SigninScreenHandler::HandleRemoveUser(const AccountId& account_id) {
|
| +void SigninScreenHandler::HandleRemoveUser(const std::string& email) {
|
| ProfileMetrics::LogProfileDeleteUser(
|
| ProfileMetrics::DELETE_PROFILE_USER_MANAGER);
|
|
|
| if (!delegate_)
|
| return;
|
| - delegate_->RemoveUser(account_id.GetUserEmail());
|
| + delegate_->RemoveUser(email);
|
| UpdateAddButtonStatus();
|
| }
|
|
|
| @@ -1177,10 +1174,10 @@
|
| }
|
|
|
| void SigninScreenHandler::HandleCancelPasswordChangedFlow(
|
| - const AccountId& account_id) {
|
| - if (account_id.is_valid()) {
|
| - RecordReauthReason(account_id, ReauthReason::PASSWORD_UPDATE_SKIPPED);
|
| - }
|
| + const std::string& user_id) {
|
| + if (!user_id.empty())
|
| + RecordReauthReason(AccountId::FromUserEmail(user_id),
|
| + ReauthReason::PASSWORD_UPDATE_SKIPPED);
|
| gaia_screen_handler_->StartClearingCookies(
|
| base::Bind(&SigninScreenHandler::CancelPasswordChangedFlowInternal,
|
| weak_factory_.GetWeakPtr()));
|
| @@ -1238,19 +1235,19 @@
|
| UpdateState(NetworkError::ERROR_REASON_LOADING_TIMEOUT);
|
| }
|
|
|
| -void SigninScreenHandler::HandleFocusPod(const AccountId& account_id) {
|
| - SetUserInputMethod(account_id.GetUserEmail(), ime_state_.get());
|
| - WallpaperManager::Get()->SetUserWallpaperDelayed(account_id.GetUserEmail());
|
| - proximity_auth::ScreenlockBridge::Get()->SetFocusedUser(
|
| - account_id.GetUserEmail());
|
| +void SigninScreenHandler::HandleFocusPod(const std::string& user_id) {
|
| + SetUserInputMethod(user_id, ime_state_.get());
|
| + WallpaperManager::Get()->SetUserWallpaperDelayed(user_id);
|
| + proximity_auth::ScreenlockBridge::Get()->SetFocusedUser(user_id);
|
| if (delegate_)
|
| - delegate_->CheckUserStatus(account_id);
|
| + delegate_->CheckUserStatus(user_id);
|
| if (!test_focus_pod_callback_.is_null())
|
| test_focus_pod_callback_.Run();
|
|
|
| bool use_24hour_clock = false;
|
| if (user_manager::UserManager::Get()->GetKnownUserBooleanPref(
|
| - account_id, prefs::kUse24HourClock, &use_24hour_clock)) {
|
| + AccountId::FromUserEmail(user_id), prefs::kUse24HourClock,
|
| + &use_24hour_clock)) {
|
| g_browser_process->platform_part()
|
| ->GetSystemClock()
|
| ->SetLastFocusedPodHourClockType(use_24hour_clock ? base::k24HourClock
|
| @@ -1259,26 +1256,29 @@
|
| }
|
|
|
| void SigninScreenHandler::HandleGetPublicSessionKeyboardLayouts(
|
| - const AccountId& account_id,
|
| + const std::string& user_id,
|
| const std::string& locale) {
|
| GetKeyboardLayoutsForLocale(
|
| base::Bind(&SigninScreenHandler::SendPublicSessionKeyboardLayouts,
|
| - weak_factory_.GetWeakPtr(), account_id, locale),
|
| + weak_factory_.GetWeakPtr(),
|
| + user_id,
|
| + locale),
|
| locale);
|
| }
|
|
|
| void SigninScreenHandler::SendPublicSessionKeyboardLayouts(
|
| - const AccountId& account_id,
|
| + const std::string& user_id,
|
| const std::string& locale,
|
| scoped_ptr<base::ListValue> keyboard_layouts) {
|
| CallJS("login.AccountPickerScreen.setPublicSessionKeyboardLayouts",
|
| - account_id, locale, *keyboard_layouts);
|
| -}
|
| -
|
| -void SigninScreenHandler::HandleLaunchKioskApp(const AccountId& app_account_id,
|
| + user_id,
|
| + locale,
|
| + *keyboard_layouts);
|
| +}
|
| +
|
| +void SigninScreenHandler::HandleLaunchKioskApp(const std::string& app_id,
|
| bool diagnostic_mode) {
|
| - UserContext context(user_manager::USER_TYPE_KIOSK_APP,
|
| - app_account_id.GetUserEmail());
|
| + UserContext context(user_manager::USER_TYPE_KIOSK_APP, app_id);
|
| SigninSpecifics specifics;
|
| specifics.kiosk_diagnostic_mode = diagnostic_mode;
|
| if (delegate_)
|
| @@ -1309,7 +1309,7 @@
|
| }
|
|
|
| void SigninScreenHandler::HandleFirstIncorrectPasswordAttempt(
|
| - const AccountId& account_id) {
|
| + const std::string& email) {
|
| // TODO(ginkage): Fix this case once crbug.com/469987 is ready.
|
| /*
|
| if (user_manager::UserManager::Get()->FindUsingSAML(email))
|
| @@ -1318,8 +1318,9 @@
|
| }
|
|
|
| void SigninScreenHandler::HandleMaxIncorrectPasswordAttempts(
|
| - const AccountId& account_id) {
|
| - RecordReauthReason(account_id, ReauthReason::INCORRECT_PASSWORD_ENTERED);
|
| + const std::string& email) {
|
| + RecordReauthReason(AccountId::FromUserEmail(email),
|
| + ReauthReason::INCORRECT_PASSWORD_ENTERED);
|
| }
|
|
|
| bool SigninScreenHandler::AllWhitelistedUsersPresent() {
|
|
|