| 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 901 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 912 | 912 |
| 913 void SigninScreenHandler::OnPreferencesChanged() { | 913 void SigninScreenHandler::OnPreferencesChanged() { |
| 914 // Make sure that one of the login UI is fully functional now, otherwise | 914 // Make sure that one of the login UI is fully functional now, otherwise |
| 915 // preferences update would be picked up next time it will be shown. | 915 // preferences update would be picked up next time it will be shown. |
| 916 if (!webui_visible_) { | 916 if (!webui_visible_) { |
| 917 LOG(WARNING) << "Login UI is not active - postponed prefs change."; | 917 LOG(WARNING) << "Login UI is not active - postponed prefs change."; |
| 918 preferences_changed_delayed_ = true; | 918 preferences_changed_delayed_ = true; |
| 919 return; | 919 return; |
| 920 } | 920 } |
| 921 | 921 |
| 922 preferences_changed_delayed_ = false; |
| 923 |
| 924 if (!delegate_) |
| 925 return; |
| 926 |
| 922 // Send the updated user list to the UI. | 927 // Send the updated user list to the UI. |
| 923 if (delegate_) | 928 delegate_->HandleGetUsers(); |
| 924 delegate_->HandleGetUsers(); | 929 if (GetCurrentScreen() == OobeScreen::SCREEN_ACCOUNT_PICKER && |
| 930 delegate_->ShowUsersHasChanged() && |
| 931 !delegate_->IsShowUsers()) { |
| 932 // We are at the account picker screen and the POD setting has changed |
| 933 // to be disabled. We need to show the add user page. |
| 934 HandleShowAddUser(nullptr); |
| 935 return; |
| 936 } |
| 925 | 937 |
| 926 if (delegate_ && !delegate_->IsShowUsers()) { | 938 if (delegate_->AllowNewUserChanged() || ui_state_ == UI_STATE_UNKNOWN) { |
| 927 HandleShowAddUser(nullptr); | 939 // We need to reload GAIA if UI_STATE_UNKNOWN or the allow new user setting |
| 928 } else { | 940 // has changed so that reloaded GAIA shows/hides the option to create a new |
| 941 // account. |
| 929 UpdateUIState(UI_STATE_ACCOUNT_PICKER, nullptr); | 942 UpdateUIState(UI_STATE_ACCOUNT_PICKER, nullptr); |
| 930 } | 943 } |
| 931 | |
| 932 preferences_changed_delayed_ = false; | |
| 933 } | 944 } |
| 934 | 945 |
| 935 void SigninScreenHandler::ResetSigninScreenHandlerDelegate() { | 946 void SigninScreenHandler::ResetSigninScreenHandlerDelegate() { |
| 936 SetDelegate(nullptr); | 947 SetDelegate(nullptr); |
| 937 } | 948 } |
| 938 | 949 |
| 939 void SigninScreenHandler::ShowError(int login_attempts, | 950 void SigninScreenHandler::ShowError(int login_attempts, |
| 940 const std::string& error_text, | 951 const std::string& error_text, |
| 941 const std::string& help_link_text, | 952 const std::string& help_link_text, |
| 942 HelpAppLauncher::HelpTopic help_topic_id) { | 953 HelpAppLauncher::HelpTopic help_topic_id) { |
| (...skipping 525 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1468 } | 1479 } |
| 1469 | 1480 |
| 1470 void SigninScreenHandler::OnFeedbackFinished() { | 1481 void SigninScreenHandler::OnFeedbackFinished() { |
| 1471 CallJS("login.UnrecoverableCryptohomeErrorScreen.resumeAfterFeedbackUI"); | 1482 CallJS("login.UnrecoverableCryptohomeErrorScreen.resumeAfterFeedbackUI"); |
| 1472 | 1483 |
| 1473 // Recreate user's cryptohome after the feedback is attempted. | 1484 // Recreate user's cryptohome after the feedback is attempted. |
| 1474 HandleResyncUserData(); | 1485 HandleResyncUserData(); |
| 1475 } | 1486 } |
| 1476 | 1487 |
| 1477 } // namespace chromeos | 1488 } // namespace chromeos |
| OLD | NEW |