| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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/chromeos/login/managed/supervised_user_login_flow.h" | 5 #include "chrome/browser/chromeos/login/managed/supervised_user_login_flow.h" |
| 6 | 6 |
| 7 #include "base/base64.h" | 7 #include "base/base64.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
| 10 #include "base/prefs/pref_registry_simple.h" | 10 #include "base/prefs/pref_registry_simple.h" |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 weak_factory_.GetWeakPtr()), | 81 weak_factory_.GetWeakPtr()), |
| 82 base::Bind(&SupervisedUserLoginFlow::OnPasswordChangeDataLoadFailed, | 82 base::Bind(&SupervisedUserLoginFlow::OnPasswordChangeDataLoadFailed, |
| 83 weak_factory_.GetWeakPtr())); | 83 weak_factory_.GetWeakPtr())); |
| 84 return; | 84 return; |
| 85 } | 85 } |
| 86 Finish(); | 86 Finish(); |
| 87 } | 87 } |
| 88 | 88 |
| 89 void SupervisedUserLoginFlow::HandleLoginSuccess( | 89 void SupervisedUserLoginFlow::HandleLoginSuccess( |
| 90 const UserContext& login_context) { | 90 const UserContext& login_context) { |
| 91 context_.CopyFrom(login_context); | 91 context_ = login_context; |
| 92 } | 92 } |
| 93 | 93 |
| 94 void SupervisedUserLoginFlow::OnPasswordChangeDataLoaded( | 94 void SupervisedUserLoginFlow::OnPasswordChangeDataLoaded( |
| 95 const base::DictionaryValue* password_data) { | 95 const base::DictionaryValue* password_data) { |
| 96 // Edge case, when manager has signed in and already updated the password. | 96 // Edge case, when manager has signed in and already updated the password. |
| 97 SupervisedUserAuthentication* auth = | 97 SupervisedUserAuthentication* auth = |
| 98 UserManager::Get()->GetSupervisedUserManager()->GetAuthentication(); | 98 UserManager::Get()->GetSupervisedUserManager()->GetAuthentication(); |
| 99 if (!auth->NeedPasswordChange(user_id(), password_data)) { | 99 if (!auth->NeedPasswordChange(user_id(), password_data)) { |
| 100 VLOG(1) << "Password already changed for " << user_id(); | 100 VLOG(1) << "Password already changed for " << user_id(); |
| 101 auth->ClearScheduledPasswordUpdate(user_id()); | 101 auth->ClearScheduledPasswordUpdate(user_id()); |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 249 Profile* profile) { | 249 Profile* profile) { |
| 250 profile_ = profile; | 250 profile_ = profile; |
| 251 UserManager::Get()->GetSupervisedUserManager()->LoadSupervisedUserToken( | 251 UserManager::Get()->GetSupervisedUserManager()->LoadSupervisedUserToken( |
| 252 profile, | 252 profile, |
| 253 base::Bind( | 253 base::Bind( |
| 254 &SupervisedUserLoginFlow::OnSyncSetupDataLoaded, | 254 &SupervisedUserLoginFlow::OnSyncSetupDataLoaded, |
| 255 weak_factory_.GetWeakPtr())); | 255 weak_factory_.GetWeakPtr())); |
| 256 } | 256 } |
| 257 | 257 |
| 258 } // namespace chromeos | 258 } // namespace chromeos |
| OLD | NEW |