| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/login_utils.h" | 5 #include "chrome/browser/chromeos/login/login_utils.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/file_path.h" | 10 #include "base/file_path.h" |
| (...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 291 } | 291 } |
| 292 btl->AddLoginTimeMarker("TokensGotten", false); | 292 btl->AddLoginTimeMarker("TokensGotten", false); |
| 293 | 293 |
| 294 // Set the CrOS user by getting this constructor run with the | 294 // Set the CrOS user by getting this constructor run with the |
| 295 // user's email on first retrieval. | 295 // user's email on first retrieval. |
| 296 profile->GetProfileSyncService(username)->SetPassphrase(password, | 296 profile->GetProfileSyncService(username)->SetPassphrase(password, |
| 297 false, | 297 false, |
| 298 true); | 298 true); |
| 299 btl->AddLoginTimeMarker("SyncStarted", false); | 299 btl->AddLoginTimeMarker("SyncStarted", false); |
| 300 | 300 |
| 301 // Attempt to take ownership; this will fail if device is already owned. | |
| 302 OwnershipService::GetSharedInstance()->StartTakeOwnershipAttempt( | |
| 303 UserManager::Get()->logged_in_user().email()); | |
| 304 // Own TPM device if, for any reason, it has not been done in EULA | 301 // Own TPM device if, for any reason, it has not been done in EULA |
| 305 // wizard screen. | 302 // wizard screen. |
| 306 if (CrosLibrary::Get()->EnsureLoaded()) { | 303 if (CrosLibrary::Get()->EnsureLoaded()) { |
| 307 CryptohomeLibrary* cryptohome = CrosLibrary::Get()->GetCryptohomeLibrary(); | 304 CryptohomeLibrary* cryptohome = CrosLibrary::Get()->GetCryptohomeLibrary(); |
| 308 if (cryptohome->TpmIsEnabled() && !cryptohome->TpmIsBeingOwned()) { | 305 if (cryptohome->TpmIsEnabled() && !cryptohome->TpmIsBeingOwned()) { |
| 309 if (cryptohome->TpmIsOwned()) { | 306 if (cryptohome->TpmIsOwned()) { |
| 310 cryptohome->TpmClearStoredPassword(); | 307 cryptohome->TpmClearStoredPassword(); |
| 311 } else { | 308 } else { |
| 312 cryptohome->TpmCanAttemptOwnership(); | 309 cryptohome->TpmCanAttemptOwnership(); |
| 313 } | 310 } |
| (...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 582 BrowserInit browser_init; | 579 BrowserInit browser_init; |
| 583 int return_code; | 580 int return_code; |
| 584 browser_init.LaunchBrowser(*CommandLine::ForCurrentProcess(), | 581 browser_init.LaunchBrowser(*CommandLine::ForCurrentProcess(), |
| 585 profile, | 582 profile, |
| 586 FilePath(), | 583 FilePath(), |
| 587 true, | 584 true, |
| 588 &return_code); | 585 &return_code); |
| 589 } | 586 } |
| 590 | 587 |
| 591 } // namespace chromeos | 588 } // namespace chromeos |
| OLD | NEW |