| 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/supervised_user/child_accounts/child_account_service.h" | 5 #include "chrome/browser/supervised_user/child_accounts/child_account_service.h" |
| 6 | 6 |
| 7 #include "base/callback.h" | 7 #include "base/callback.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/feature_list.h" | 9 #include "base/feature_list.h" |
| 10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
| (...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 356 | 356 |
| 357 void ChildAccountService::ScheduleNextFamilyInfoUpdate(base::TimeDelta delay) { | 357 void ChildAccountService::ScheduleNextFamilyInfoUpdate(base::TimeDelta delay) { |
| 358 family_fetch_timer_.Start( | 358 family_fetch_timer_.Start( |
| 359 FROM_HERE, delay, this, &ChildAccountService::StartFetchingFamilyInfo); | 359 FROM_HERE, delay, this, &ChildAccountService::StartFetchingFamilyInfo); |
| 360 } | 360 } |
| 361 | 361 |
| 362 void ChildAccountService::PropagateChildStatusToUser(bool is_child) { | 362 void ChildAccountService::PropagateChildStatusToUser(bool is_child) { |
| 363 #if defined(OS_CHROMEOS) | 363 #if defined(OS_CHROMEOS) |
| 364 user_manager::User* user = | 364 user_manager::User* user = |
| 365 chromeos::ProfileHelper::Get()->GetUserByProfile(profile_); | 365 chromeos::ProfileHelper::Get()->GetUserByProfile(profile_); |
| 366 if (user) | 366 if (user) { |
| 367 user_manager::UserManager::Get()->ChangeUserChildStatus(user, is_child); | 367 user_manager::UserManager::Get()->ChangeUserChildStatus(user, is_child); |
| 368 else if (!chromeos::ProfileHelper::Get()->IsSigninProfile(profile_)) | 368 } else if (!chromeos::ProfileHelper::Get()->IsSigninProfile(profile_) && |
| 369 !chromeos::ProfileHelper::Get()->IsLockScreenAppProfile( |
| 370 profile_)) { |
| 369 LOG(DFATAL) << "User instance not found while setting child account flag."; | 371 LOG(DFATAL) << "User instance not found while setting child account flag."; |
| 372 } |
| 370 #endif | 373 #endif |
| 371 } | 374 } |
| 372 | 375 |
| 373 void ChildAccountService::SetFirstCustodianPrefs( | 376 void ChildAccountService::SetFirstCustodianPrefs( |
| 374 const FamilyInfoFetcher::FamilyMember& custodian) { | 377 const FamilyInfoFetcher::FamilyMember& custodian) { |
| 375 profile_->GetPrefs()->SetString(prefs::kSupervisedUserCustodianName, | 378 profile_->GetPrefs()->SetString(prefs::kSupervisedUserCustodianName, |
| 376 custodian.display_name); | 379 custodian.display_name); |
| 377 profile_->GetPrefs()->SetString(prefs::kSupervisedUserCustodianEmail, | 380 profile_->GetPrefs()->SetString(prefs::kSupervisedUserCustodianEmail, |
| 378 custodian.email); | 381 custodian.email); |
| 379 profile_->GetPrefs()->SetString(prefs::kSupervisedUserCustodianProfileURL, | 382 profile_->GetPrefs()->SetString(prefs::kSupervisedUserCustodianProfileURL, |
| (...skipping 26 matching lines...) Expand all Loading... |
| 406 } | 409 } |
| 407 | 410 |
| 408 void ChildAccountService::ClearSecondCustodianPrefs() { | 411 void ChildAccountService::ClearSecondCustodianPrefs() { |
| 409 profile_->GetPrefs()->ClearPref(prefs::kSupervisedUserSecondCustodianName); | 412 profile_->GetPrefs()->ClearPref(prefs::kSupervisedUserSecondCustodianName); |
| 410 profile_->GetPrefs()->ClearPref(prefs::kSupervisedUserSecondCustodianEmail); | 413 profile_->GetPrefs()->ClearPref(prefs::kSupervisedUserSecondCustodianEmail); |
| 411 profile_->GetPrefs()->ClearPref( | 414 profile_->GetPrefs()->ClearPref( |
| 412 prefs::kSupervisedUserSecondCustodianProfileURL); | 415 prefs::kSupervisedUserSecondCustodianProfileURL); |
| 413 profile_->GetPrefs()->ClearPref( | 416 profile_->GetPrefs()->ClearPref( |
| 414 prefs::kSupervisedUserSecondCustodianProfileImageURL); | 417 prefs::kSupervisedUserSecondCustodianProfileImageURL); |
| 415 } | 418 } |
| OLD | NEW |