| 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 1247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1258 DCHECK(user_manager::UserManager::Get()->IsUserLoggedIn()); | 1258 DCHECK(user_manager::UserManager::Get()->IsUserLoggedIn()); |
| 1259 if (ScreenLocker::default_screen_locker()) | 1259 if (ScreenLocker::default_screen_locker()) |
| 1260 ScreenLocker::default_screen_locker()->UnlockOnLoginSuccess(); | 1260 ScreenLocker::default_screen_locker()->UnlockOnLoginSuccess(); |
| 1261 } | 1261 } |
| 1262 | 1262 |
| 1263 void SigninScreenHandler::HandleShowLoadingTimeoutError() { | 1263 void SigninScreenHandler::HandleShowLoadingTimeoutError() { |
| 1264 UpdateState(NetworkError::ERROR_REASON_LOADING_TIMEOUT); | 1264 UpdateState(NetworkError::ERROR_REASON_LOADING_TIMEOUT); |
| 1265 } | 1265 } |
| 1266 | 1266 |
| 1267 void SigninScreenHandler::HandleFocusPod(const AccountId& account_id) { | 1267 void SigninScreenHandler::HandleFocusPod(const AccountId& account_id) { |
| 1268 SetUserInputMethod(account_id.GetUserEmail(), ime_state_.get()); | |
| 1269 WallpaperManager::Get()->SetUserWallpaperDelayed(account_id); | |
| 1270 proximity_auth::ScreenlockBridge::Get()->SetFocusedUser(account_id); | 1268 proximity_auth::ScreenlockBridge::Get()->SetFocusedUser(account_id); |
| 1271 if (delegate_) | 1269 if (delegate_) |
| 1272 delegate_->CheckUserStatus(account_id); | 1270 delegate_->CheckUserStatus(account_id); |
| 1273 if (!test_focus_pod_callback_.is_null()) | 1271 if (!test_focus_pod_callback_.is_null()) |
| 1274 test_focus_pod_callback_.Run(); | 1272 test_focus_pod_callback_.Run(); |
| 1275 | 1273 |
| 1276 bool use_24hour_clock = false; | 1274 const user_manager::User* user = |
| 1277 if (user_manager::known_user::GetBooleanPref( | 1275 user_manager::UserManager::Get()->FindUser(account_id); |
| 1278 account_id, prefs::kUse24HourClock, &use_24hour_clock)) { | 1276 // |user| may be nullptr in kiosk mode or unit tests. |
| 1279 g_browser_process->platform_part() | 1277 if (user && user->is_logged_in() && !user->is_active()) { |
| 1280 ->GetSystemClock() | 1278 ash::Shell::GetInstance()->session_state_delegate()->SwitchActiveUser( |
| 1281 ->SetLastFocusedPodHourClockType(use_24hour_clock ? base::k24HourClock | 1279 account_id); |
| 1282 : base::k12HourClock); | 1280 } else { |
| 1281 SetUserInputMethod(account_id.GetUserEmail(), ime_state_.get()); |
| 1282 WallpaperManager::Get()->SetUserWallpaperDelayed(account_id); |
| 1283 |
| 1284 bool use_24hour_clock = false; |
| 1285 if (user_manager::known_user::GetBooleanPref( |
| 1286 account_id, prefs::kUse24HourClock, &use_24hour_clock)) { |
| 1287 g_browser_process->platform_part() |
| 1288 ->GetSystemClock() |
| 1289 ->SetLastFocusedPodHourClockType( |
| 1290 use_24hour_clock ? base::k24HourClock : base::k12HourClock); |
| 1291 } |
| 1283 } | 1292 } |
| 1284 } | 1293 } |
| 1285 | 1294 |
| 1286 void SigninScreenHandler::HandleGetPublicSessionKeyboardLayouts( | 1295 void SigninScreenHandler::HandleGetPublicSessionKeyboardLayouts( |
| 1287 const AccountId& account_id, | 1296 const AccountId& account_id, |
| 1288 const std::string& locale) { | 1297 const std::string& locale) { |
| 1289 GetKeyboardLayoutsForLocale( | 1298 GetKeyboardLayoutsForLocale( |
| 1290 base::Bind(&SigninScreenHandler::SendPublicSessionKeyboardLayouts, | 1299 base::Bind(&SigninScreenHandler::SendPublicSessionKeyboardLayouts, |
| 1291 weak_factory_.GetWeakPtr(), account_id, locale), | 1300 weak_factory_.GetWeakPtr(), account_id, locale), |
| 1292 locale); | 1301 locale); |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1435 } | 1444 } |
| 1436 | 1445 |
| 1437 void SigninScreenHandler::OnFeedbackFinished() { | 1446 void SigninScreenHandler::OnFeedbackFinished() { |
| 1438 CallJS("login.UnrecoverableCryptohomeErrorScreen.resumeAfterFeedbackUI"); | 1447 CallJS("login.UnrecoverableCryptohomeErrorScreen.resumeAfterFeedbackUI"); |
| 1439 | 1448 |
| 1440 // Recreate user's cryptohome after the feedkback is attempted. | 1449 // Recreate user's cryptohome after the feedkback is attempted. |
| 1441 HandleResyncUserData(); | 1450 HandleResyncUserData(); |
| 1442 } | 1451 } |
| 1443 | 1452 |
| 1444 } // namespace chromeos | 1453 } // namespace chromeos |
| OLD | NEW |