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

Side by Side Diff: chrome/browser/chromeos/login/supervised/supervised_user_creation_controller_new.cc

Issue 1693383003: ChromeOS cryptohome should be able to use gaia id as user identifier. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed unit tests. Created 4 years, 9 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 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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698