Chromium Code Reviews| 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 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 291 family_fetch_timer_.Start( | 291 family_fetch_timer_.Start( |
| 292 FROM_HERE, delay, this, &ChildAccountService::StartFetchingFamilyInfo); | 292 FROM_HERE, delay, this, &ChildAccountService::StartFetchingFamilyInfo); |
| 293 } | 293 } |
| 294 | 294 |
| 295 void ChildAccountService::PropagateChildStatusToUser(bool is_child) { | 295 void ChildAccountService::PropagateChildStatusToUser(bool is_child) { |
| 296 #if defined(OS_CHROMEOS) | 296 #if defined(OS_CHROMEOS) |
| 297 user_manager::User* user = | 297 user_manager::User* user = |
| 298 chromeos::ProfileHelper::Get()->GetUserByProfile(profile_); | 298 chromeos::ProfileHelper::Get()->GetUserByProfile(profile_); |
| 299 if (user) { | 299 if (user) { |
| 300 user_manager::UserManager::Get()->ChangeUserChildStatus(user, is_child); | 300 user_manager::UserManager::Get()->ChangeUserChildStatus(user, is_child); |
| 301 } else { | 301 } else if (!chromeos::ProfileHelper::Get()->IsSigninProfile(profile_)) { |
| 302 LOG(WARNING) << | 302 LOG(WARNING) |
|
Bernhard Bauer
2016/08/10 14:23:57
Actually, would it make sense to have a DCHECK/CHE
Daniel Erat
2016/08/10 15:08:40
sorry, i have no idea -- i've never looked at this
Bernhard Bauer
2016/08/10 17:17:29
Hm, I'm thinking this is a situation that is _supp
Daniel Erat
2016/08/10 20:12:12
how about LOG(DFATAL)? then we get a crash in debu
| |
| 303 "User instance wasn't found while setting child account flag."; | 303 << "User instance wasn't found while setting child account flag."; |
| 304 } | 304 } |
| 305 #endif | 305 #endif |
| 306 } | 306 } |
| 307 | 307 |
| 308 void ChildAccountService::SetFirstCustodianPrefs( | 308 void ChildAccountService::SetFirstCustodianPrefs( |
| 309 const FamilyInfoFetcher::FamilyMember& custodian) { | 309 const FamilyInfoFetcher::FamilyMember& custodian) { |
| 310 profile_->GetPrefs()->SetString(prefs::kSupervisedUserCustodianName, | 310 profile_->GetPrefs()->SetString(prefs::kSupervisedUserCustodianName, |
| 311 custodian.display_name); | 311 custodian.display_name); |
| 312 profile_->GetPrefs()->SetString(prefs::kSupervisedUserCustodianEmail, | 312 profile_->GetPrefs()->SetString(prefs::kSupervisedUserCustodianEmail, |
| 313 custodian.email); | 313 custodian.email); |
| (...skipping 27 matching lines...) Expand all Loading... | |
| 341 } | 341 } |
| 342 | 342 |
| 343 void ChildAccountService::ClearSecondCustodianPrefs() { | 343 void ChildAccountService::ClearSecondCustodianPrefs() { |
| 344 profile_->GetPrefs()->ClearPref(prefs::kSupervisedUserSecondCustodianName); | 344 profile_->GetPrefs()->ClearPref(prefs::kSupervisedUserSecondCustodianName); |
| 345 profile_->GetPrefs()->ClearPref(prefs::kSupervisedUserSecondCustodianEmail); | 345 profile_->GetPrefs()->ClearPref(prefs::kSupervisedUserSecondCustodianEmail); |
| 346 profile_->GetPrefs()->ClearPref( | 346 profile_->GetPrefs()->ClearPref( |
| 347 prefs::kSupervisedUserSecondCustodianProfileURL); | 347 prefs::kSupervisedUserSecondCustodianProfileURL); |
| 348 profile_->GetPrefs()->ClearPref( | 348 profile_->GetPrefs()->ClearPref( |
| 349 prefs::kSupervisedUserSecondCustodianProfileImageURL); | 349 prefs::kSupervisedUserSecondCustodianProfileImageURL); |
| 350 } | 350 } |
| OLD | NEW |