| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/supervised/supervised_user_login_flow.h" | 5 #include "chrome/browser/chromeos/login/supervised/supervised_user_login_flow.h" |
| 6 | 6 |
| 7 #include "base/base64.h" | 7 #include "base/base64.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 #include "chrome/common/chrome_switches.h" | 22 #include "chrome/common/chrome_switches.h" |
| 23 #include "chromeos/login/auth/key.h" | 23 #include "chromeos/login/auth/key.h" |
| 24 #include "components/user_manager/user_manager.h" | 24 #include "components/user_manager/user_manager.h" |
| 25 #include "content/public/browser/browser_thread.h" | 25 #include "content/public/browser/browser_thread.h" |
| 26 | 26 |
| 27 using content::BrowserThread; | 27 using content::BrowserThread; |
| 28 | 28 |
| 29 namespace chromeos { | 29 namespace chromeos { |
| 30 | 30 |
| 31 SupervisedUserLoginFlow::SupervisedUserLoginFlow( | 31 SupervisedUserLoginFlow::SupervisedUserLoginFlow( |
| 32 const std::string& user_id) | 32 const user_manager::UserID& user_id) |
| 33 : ExtendedUserFlow(user_id), | 33 : ExtendedUserFlow(user_id), |
| 34 data_loaded_(false), | 34 data_loaded_(false), |
| 35 weak_factory_(this) { | 35 weak_factory_(this) { |
| 36 } | 36 } |
| 37 | 37 |
| 38 SupervisedUserLoginFlow::~SupervisedUserLoginFlow() {} | 38 SupervisedUserLoginFlow::~SupervisedUserLoginFlow() {} |
| 39 | 39 |
| 40 void SupervisedUserLoginFlow::AppendAdditionalCommandLineSwitches() { | 40 void SupervisedUserLoginFlow::AppendAdditionalCommandLineSwitches() { |
| 41 user_manager::UserManager* user_manager = user_manager::UserManager::Get(); | 41 user_manager::UserManager* user_manager = user_manager::UserManager::Get(); |
| 42 if (user_manager->IsCurrentUserNew()) { | 42 if (user_manager->IsCurrentUserNew()) { |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 const UserContext& login_context) { | 102 const UserContext& login_context) { |
| 103 context_ = login_context; | 103 context_ = login_context; |
| 104 } | 104 } |
| 105 | 105 |
| 106 void SupervisedUserLoginFlow::OnPasswordChangeDataLoaded( | 106 void SupervisedUserLoginFlow::OnPasswordChangeDataLoaded( |
| 107 const base::DictionaryValue* password_data) { | 107 const base::DictionaryValue* password_data) { |
| 108 // Edge case, when manager has signed in and already updated the password. | 108 // Edge case, when manager has signed in and already updated the password. |
| 109 SupervisedUserAuthentication* auth = | 109 SupervisedUserAuthentication* auth = |
| 110 ChromeUserManager::Get()->GetSupervisedUserManager()->GetAuthentication(); | 110 ChromeUserManager::Get()->GetSupervisedUserManager()->GetAuthentication(); |
| 111 if (!auth->NeedPasswordChange(user_id(), password_data)) { | 111 if (!auth->NeedPasswordChange(user_id(), password_data)) { |
| 112 VLOG(1) << "Password already changed for " << user_id(); | 112 VLOG(1) << "Password already changed for " << user_id().GetUserEmail(); |
| 113 auth->ClearScheduledPasswordUpdate(user_id()); | 113 auth->ClearScheduledPasswordUpdate(user_id()); |
| 114 Finish(); | 114 Finish(); |
| 115 return; | 115 return; |
| 116 } | 116 } |
| 117 | 117 |
| 118 // Two cases now - we can currently have either old-style password, or new | 118 // Two cases now - we can currently have either old-style password, or new |
| 119 // password. | 119 // password. |
| 120 std::string base64_signature; | 120 std::string base64_signature; |
| 121 std::string signature; | 121 std::string signature; |
| 122 std::string password; | 122 std::string password; |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 260 void SupervisedUserLoginFlow::LaunchExtraSteps( | 260 void SupervisedUserLoginFlow::LaunchExtraSteps( |
| 261 Profile* profile) { | 261 Profile* profile) { |
| 262 profile_ = profile; | 262 profile_ = profile; |
| 263 ChromeUserManager::Get()->GetSupervisedUserManager()->LoadSupervisedUserToken( | 263 ChromeUserManager::Get()->GetSupervisedUserManager()->LoadSupervisedUserToken( |
| 264 profile, | 264 profile, |
| 265 base::Bind(&SupervisedUserLoginFlow::OnSyncSetupDataLoaded, | 265 base::Bind(&SupervisedUserLoginFlow::OnSyncSetupDataLoaded, |
| 266 weak_factory_.GetWeakPtr())); | 266 weak_factory_.GetWeakPtr())); |
| 267 } | 267 } |
| 268 | 268 |
| 269 } // namespace chromeos | 269 } // namespace chromeos |
| OLD | NEW |