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

Side by Side Diff: chrome/browser/chromeos/login/existing_user_controller.cc

Issue 322533002: Restart Chrome on ChromeOS as early as possible to speed up restart. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix win build. Created 6 years, 5 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/chromeos/login/existing_user_controller.h" 5 #include "chrome/browser/chromeos/login/existing_user_controller.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 ExistingUserController::ExistingUserController(LoginDisplayHost* host) 124 ExistingUserController::ExistingUserController(LoginDisplayHost* host)
125 : login_status_consumer_(NULL), 125 : login_status_consumer_(NULL),
126 host_(host), 126 host_(host),
127 login_display_(host_->CreateLoginDisplay(this)), 127 login_display_(host_->CreateLoginDisplay(this)),
128 num_login_attempts_(0), 128 num_login_attempts_(0),
129 cros_settings_(CrosSettings::Get()), 129 cros_settings_(CrosSettings::Get()),
130 weak_factory_(this), 130 weak_factory_(this),
131 offline_failed_(false), 131 offline_failed_(false),
132 is_login_in_progress_(false), 132 is_login_in_progress_(false),
133 password_changed_(false), 133 password_changed_(false),
134 auth_mode_(LoginPerformer::AUTH_MODE_EXTENSION),
134 do_auto_enrollment_(false), 135 do_auto_enrollment_(false),
135 signin_screen_ready_(false), 136 signin_screen_ready_(false),
136 network_state_helper_(new login::NetworkStateHelper) { 137 network_state_helper_(new login::NetworkStateHelper) {
137 DCHECK(current_controller_ == NULL); 138 DCHECK(current_controller_ == NULL);
138 current_controller_ = this; 139 current_controller_ = this;
139 140
140 registrar_.Add(this, 141 registrar_.Add(this,
141 chrome::NOTIFICATION_LOGIN_USER_IMAGE_CHANGED, 142 chrome::NOTIFICATION_LOGIN_USER_IMAGE_CHANGED,
142 content::NotificationService::AllSources()); 143 content::NotificationService::AllSources());
143 registrar_.Add(this, 144 registrar_.Add(this,
(...skipping 619 matching lines...) Expand 10 before | Expand all | Expand 10 after
763 764
764 // Clear the recorded displayed email so it won't affect any future attempts. 765 // Clear the recorded displayed email so it won't affect any future attempts.
765 display_email_.clear(); 766 display_email_.clear();
766 } 767 }
767 768
768 void ExistingUserController::OnLoginSuccess(const UserContext& user_context) { 769 void ExistingUserController::OnLoginSuccess(const UserContext& user_context) {
769 is_login_in_progress_ = false; 770 is_login_in_progress_ = false;
770 offline_failed_ = false; 771 offline_failed_ = false;
771 login_display_->set_signin_completed(true); 772 login_display_->set_signin_completed(true);
772 773
774 // Login performer will be gone so cache this value to use
775 // once profile is loaded.
776 password_changed_ = login_performer_->password_changed();
777 auth_mode_ = login_performer_->auth_mode();
778
773 UserManager::Get()->GetUserFlow(user_context.GetUserID())-> 779 UserManager::Get()->GetUserFlow(user_context.GetUserID())->
774 HandleLoginSuccess(user_context); 780 HandleLoginSuccess(user_context);
775 781
776 StopPublicSessionAutoLoginTimer(); 782 StopPublicSessionAutoLoginTimer();
777 783
778 const bool has_auth_cookies = 784 const bool has_auth_cookies =
779 login_performer_->auth_mode() == LoginPerformer::AUTH_MODE_EXTENSION && 785 login_performer_->auth_mode() == LoginPerformer::AUTH_MODE_EXTENSION &&
780 user_context.GetAuthCode().empty(); 786 user_context.GetAuthCode().empty();
781 787
782 // Login performer will be gone so cache this value to use
783 // once profile is loaded.
784 password_changed_ = login_performer_->password_changed();
785
786 // LoginPerformer instance will delete itself once online auth result is OK. 788 // LoginPerformer instance will delete itself once online auth result is OK.
787 // In case of failure it'll bring up ScreenLock and ask for 789 // In case of failure it'll bring up ScreenLock and ask for
788 // correct password/display error message. 790 // correct password/display error message.
789 // Even in case when following online,offline protocol and returning 791 // Even in case when following online,offline protocol and returning
790 // requests_pending = false, let LoginPerformer delete itself. 792 // requests_pending = false, let LoginPerformer delete itself.
791 login_performer_->set_delegate(NULL); 793 login_performer_->set_delegate(NULL);
792 ignore_result(login_performer_.release()); 794 ignore_result(login_performer_.release());
793 795
794 // Update user's displayed email. 796 // Update user's displayed email.
795 if (!display_email_.empty()) { 797 if (!display_email_.empty()) {
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
948 ConfigurePublicSessionAutoLogin(); 950 ConfigurePublicSessionAutoLogin();
949 return; 951 return;
950 } 952 }
951 } 953 }
952 954
953 void ExistingUserController::ActivateWizard(const std::string& screen_name) { 955 void ExistingUserController::ActivateWizard(const std::string& screen_name) {
954 scoped_ptr<base::DictionaryValue> params; 956 scoped_ptr<base::DictionaryValue> params;
955 host_->StartWizard(screen_name, params.Pass()); 957 host_->StartWizard(screen_name, params.Pass());
956 } 958 }
957 959
960 LoginPerformer::AuthorizationMode ExistingUserController::auth_mode() const {
961 if (login_performer_)
962 return login_performer_->auth_mode();
963
964 return auth_mode_;
965 }
966
967 bool ExistingUserController::password_changed() const {
968 if (login_performer_)
969 return login_performer_->password_changed();
970
971 return password_changed_;
972 }
973
958 void ExistingUserController::ConfigurePublicSessionAutoLogin() { 974 void ExistingUserController::ConfigurePublicSessionAutoLogin() {
959 std::string auto_login_account_id; 975 std::string auto_login_account_id;
960 cros_settings_->GetString(kAccountsPrefDeviceLocalAccountAutoLoginId, 976 cros_settings_->GetString(kAccountsPrefDeviceLocalAccountAutoLoginId,
961 &auto_login_account_id); 977 &auto_login_account_id);
962 const std::vector<policy::DeviceLocalAccount> device_local_accounts = 978 const std::vector<policy::DeviceLocalAccount> device_local_accounts =
963 policy::GetDeviceLocalAccounts(cros_settings_); 979 policy::GetDeviceLocalAccounts(cros_settings_);
964 980
965 public_session_auto_login_username_.clear(); 981 public_session_auto_login_username_.clear();
966 for (std::vector<policy::DeviceLocalAccount>::const_iterator 982 for (std::vector<policy::DeviceLocalAccount>::const_iterator
967 it = device_local_accounts.begin(); 983 it = device_local_accounts.begin();
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
1133 } 1149 }
1134 1150
1135 void ExistingUserController::SendAccessibilityAlert( 1151 void ExistingUserController::SendAccessibilityAlert(
1136 const std::string& alert_text) { 1152 const std::string& alert_text) {
1137 AccessibilityAlertInfo event(ProfileHelper::GetSigninProfile(), alert_text); 1153 AccessibilityAlertInfo event(ProfileHelper::GetSigninProfile(), alert_text);
1138 SendControlAccessibilityNotification( 1154 SendControlAccessibilityNotification(
1139 ui::AX_EVENT_VALUE_CHANGED, &event); 1155 ui::AX_EVENT_VALUE_CHANGED, &event);
1140 } 1156 }
1141 1157
1142 } // namespace chromeos 1158 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698