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 <algorithm> | 7 #include <algorithm> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "ash/shell.h" | 10 #include "ash/shell.h" |
(...skipping 989 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1000 } | 1000 } |
1001 | 1001 |
1002 bool SigninScreenHandler::ShouldLoadGaia() const { | 1002 bool SigninScreenHandler::ShouldLoadGaia() const { |
1003 // Fetching of the extension is not started before account picker page is | 1003 // Fetching of the extension is not started before account picker page is |
1004 // loaded because it can affect the loading speed. | 1004 // loaded because it can affect the loading speed. |
1005 // Do not load the extension for the screen locker, see crosbug.com/25018. | 1005 // Do not load the extension for the screen locker, see crosbug.com/25018. |
1006 return !ScreenLocker::default_screen_locker() && | 1006 return !ScreenLocker::default_screen_locker() && |
1007 is_account_picker_showing_first_time_; | 1007 is_account_picker_showing_first_time_; |
1008 } | 1008 } |
1009 | 1009 |
1010 void SigninScreenHandler::UserSettingsChanged() { | |
1011 DCHECK(gaia_screen_handler_); | |
1012 GaiaContext context; | |
1013 if (delegate_) | |
1014 context.has_users = !delegate_->GetUsers().empty(); | |
1015 gaia_screen_handler_->UpdateGaia(context); | |
1016 UpdateAddButtonStatus(); | |
1017 } | |
1018 | |
1019 void SigninScreenHandler::UpdateAddButtonStatus() { | 1010 void SigninScreenHandler::UpdateAddButtonStatus() { |
1020 CallJS("cr.ui.login.DisplayManager.updateAddUserButtonStatus", | 1011 CallJS("cr.ui.login.DisplayManager.updateAddUserButtonStatus", |
1021 AllWhitelistedUsersPresent()); | 1012 AllWhitelistedUsersPresent()); |
1022 } | 1013 } |
1023 | 1014 |
1024 void SigninScreenHandler::HandleAuthenticateUser(const std::string& username, | 1015 void SigninScreenHandler::HandleAuthenticateUser(const std::string& username, |
1025 const std::string& password) { | 1016 const std::string& password) { |
1026 if (!delegate_) | 1017 if (!delegate_) |
1027 return; | 1018 return; |
1028 UserContext user_context(gaia::SanitizeEmail(username)); | 1019 UserContext user_context(gaia::SanitizeEmail(username)); |
(...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1452 return gaia_screen_handler_->frame_error(); | 1443 return gaia_screen_handler_->frame_error(); |
1453 } | 1444 } |
1454 | 1445 |
1455 void SigninScreenHandler::OnCapsLockChanged(bool enabled) { | 1446 void SigninScreenHandler::OnCapsLockChanged(bool enabled) { |
1456 caps_lock_enabled_ = enabled; | 1447 caps_lock_enabled_ = enabled; |
1457 if (page_is_ready()) | 1448 if (page_is_ready()) |
1458 CallJS("login.AccountPickerScreen.setCapsLockState", caps_lock_enabled_); | 1449 CallJS("login.AccountPickerScreen.setCapsLockState", caps_lock_enabled_); |
1459 } | 1450 } |
1460 | 1451 |
1461 } // namespace chromeos | 1452 } // namespace chromeos |
OLD | NEW |