| 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_creation_cont
roller_new.h" | 5 #include "chrome/browser/chromeos/login/supervised/supervised_user_creation_cont
roller_new.h" |
| 6 | 6 |
| 7 #include "base/base64.h" | 7 #include "base/base64.h" |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
| 10 #include "base/files/file_util.h" | 10 #include "base/files/file_util.h" |
| (...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 222 std::vector<cryptohome::KeyDefinition> keys; | 222 std::vector<cryptohome::KeyDefinition> keys; |
| 223 | 223 |
| 224 // Main key is the master key. Just as keys for plain GAIA users, it is salted | 224 // Main key is the master key. Just as keys for plain GAIA users, it is salted |
| 225 // with system salt. It has all usual privileges. | 225 // with system salt. It has all usual privileges. |
| 226 cryptohome::KeyDefinition master_key(creation_context_->salted_master_key, | 226 cryptohome::KeyDefinition master_key(creation_context_->salted_master_key, |
| 227 kCryptohomeMasterKeyLabel, | 227 kCryptohomeMasterKeyLabel, |
| 228 cryptohome::PRIV_DEFAULT); | 228 cryptohome::PRIV_DEFAULT); |
| 229 | 229 |
| 230 keys.push_back(master_key); | 230 keys.push_back(master_key); |
| 231 authenticator_->CreateMount( | 231 authenticator_->CreateMount( |
| 232 creation_context_->local_user_id, | 232 AccountId::FromUserEmail(creation_context_->local_user_id), keys, |
| 233 keys, | |
| 234 base::Bind(&SupervisedUserCreationControllerNew::OnMountSuccess, | 233 base::Bind(&SupervisedUserCreationControllerNew::OnMountSuccess, |
| 235 weak_factory_.GetWeakPtr())); | 234 weak_factory_.GetWeakPtr())); |
| 236 } | 235 } |
| 237 | 236 |
| 238 void SupervisedUserCreationControllerNew::OnAuthenticationFailure( | 237 void SupervisedUserCreationControllerNew::OnAuthenticationFailure( |
| 239 ExtendedAuthenticator::AuthState error) { | 238 ExtendedAuthenticator::AuthState error) { |
| 240 timeout_timer_.Stop(); | 239 timeout_timer_.Stop(); |
| 241 ErrorCode code = NO_ERROR; | 240 ErrorCode code = NO_ERROR; |
| 242 switch (error) { | 241 switch (error) { |
| 243 case SupervisedUserAuthenticator::NO_MOUNT: | 242 case SupervisedUserAuthenticator::NO_MOUNT: |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 415 creation_context_->registration_utility.reset(); | 414 creation_context_->registration_utility.reset(); |
| 416 chrome::AttemptUserExit(); | 415 chrome::AttemptUserExit(); |
| 417 } | 416 } |
| 418 | 417 |
| 419 std::string SupervisedUserCreationControllerNew::GetSupervisedUserId() { | 418 std::string SupervisedUserCreationControllerNew::GetSupervisedUserId() { |
| 420 DCHECK(creation_context_); | 419 DCHECK(creation_context_); |
| 421 return creation_context_->local_user_id; | 420 return creation_context_->local_user_id; |
| 422 } | 421 } |
| 423 | 422 |
| 424 } // namespace chromeos | 423 } // namespace chromeos |
| OLD | NEW |