| 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/users/supervised_user_manager_impl.h" | 5 #include "chrome/browser/chromeos/login/users/supervised_user_manager_impl.h" |
| 6 | 6 |
| 7 #include "base/files/file_path.h" | 7 #include "base/files/file_path.h" |
| 8 #include "base/files/file_util.h" | 8 #include "base/files/file_util.h" |
| 9 #include "base/prefs/pref_registry_simple.h" | 9 #include "base/prefs/pref_registry_simple.h" |
| 10 #include "base/prefs/pref_service.h" | 10 #include "base/prefs/pref_service.h" |
| (...skipping 494 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 505 return authentication_.get(); | 505 return authentication_.get(); |
| 506 } | 506 } |
| 507 | 507 |
| 508 void SupervisedUserManagerImpl::LoadSupervisedUserToken( | 508 void SupervisedUserManagerImpl::LoadSupervisedUserToken( |
| 509 Profile* profile, | 509 Profile* profile, |
| 510 const LoadTokenCallback& callback) { | 510 const LoadTokenCallback& callback) { |
| 511 // TODO(antrim): use profile->GetPath() once we sure it is safe. | 511 // TODO(antrim): use profile->GetPath() once we sure it is safe. |
| 512 base::FilePath profile_dir = ProfileHelper::GetProfilePathByUserIdHash( | 512 base::FilePath profile_dir = ProfileHelper::GetProfilePathByUserIdHash( |
| 513 ProfileHelper::Get()->GetUserByProfile(profile)->username_hash()); | 513 ProfileHelper::Get()->GetUserByProfile(profile)->username_hash()); |
| 514 PostTaskAndReplyWithResult( | 514 PostTaskAndReplyWithResult( |
| 515 content::BrowserThread::GetBlockingPool(), | 515 content::BrowserThread::GetBlockingPool() |
| 516 FROM_HERE, | 516 ->GetTaskRunnerWithShutdownBehavior( |
| 517 base::Bind(&LoadSyncToken, profile_dir), | 517 base::SequencedWorkerPool::CONTINUE_ON_SHUTDOWN) |
| 518 callback); | 518 .get(), |
| 519 FROM_HERE, base::Bind(&LoadSyncToken, profile_dir), callback); |
| 519 } | 520 } |
| 520 | 521 |
| 521 void SupervisedUserManagerImpl::ConfigureSyncWithToken( | 522 void SupervisedUserManagerImpl::ConfigureSyncWithToken( |
| 522 Profile* profile, | 523 Profile* profile, |
| 523 const std::string& token) { | 524 const std::string& token) { |
| 524 if (!token.empty()) | 525 if (!token.empty()) |
| 525 SupervisedUserServiceFactory::GetForProfile(profile)->InitSync(token); | 526 SupervisedUserServiceFactory::GetForProfile(profile)->InitSync(token); |
| 526 } | 527 } |
| 527 | 528 |
| 528 } // namespace chromeos | 529 } // namespace chromeos |
| OLD | NEW |