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/supervised_user_service.h" | 5 #include "chrome/browser/supervised_user/supervised_user_service.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/feature_list.h" | 10 #include "base/feature_list.h" |
(...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
375 int avatar_index = profile_->GetPrefs()->GetInteger( | 375 int avatar_index = profile_->GetPrefs()->GetInteger( |
376 prefs::kProfileAvatarIndex); | 376 prefs::kProfileAvatarIndex); |
377 SupervisedUserRegistrationInfo info(name, avatar_index); | 377 SupervisedUserRegistrationInfo info(name, avatar_index); |
378 registration_utility->Register( | 378 registration_utility->Register( |
379 supervised_user_id, | 379 supervised_user_id, |
380 info, | 380 info, |
381 base::Bind(&SupervisedUserService::OnSupervisedUserRegistered, | 381 base::Bind(&SupervisedUserService::OnSupervisedUserRegistered, |
382 weak_ptr_factory_.GetWeakPtr(), callback, custodian_profile)); | 382 weak_ptr_factory_.GetWeakPtr(), callback, custodian_profile)); |
383 | 383 |
384 // Fetch the custodian's profile information, to store the name. | 384 // Fetch the custodian's profile information, to store the name. |
385 // TODO(pamg): If --google-profile-info (flag: switches::kGoogleProfileInfo) | 385 // TODO(pamg): Take the name from the ProfileAttributesStorage instead. |
386 // is ever enabled, take the name from the ProfileAttributesStorage instead. | |
387 CustodianProfileDownloaderService* profile_downloader_service = | 386 CustodianProfileDownloaderService* profile_downloader_service = |
388 CustodianProfileDownloaderServiceFactory::GetForProfile( | 387 CustodianProfileDownloaderServiceFactory::GetForProfile( |
389 custodian_profile); | 388 custodian_profile); |
390 profile_downloader_service->DownloadProfile( | 389 profile_downloader_service->DownloadProfile( |
391 base::Bind(&SupervisedUserService::OnCustodianProfileDownloaded, | 390 base::Bind(&SupervisedUserService::OnCustodianProfileDownloaded, |
392 weak_ptr_factory_.GetWeakPtr())); | 391 weak_ptr_factory_.GetWeakPtr())); |
393 } | 392 } |
394 #endif // !defined(OS_ANDROID) | 393 #endif // !defined(OS_ANDROID) |
395 | 394 |
396 void SupervisedUserService::AddNavigationBlockedCallback( | 395 void SupervisedUserService::AddNavigationBlockedCallback( |
(...skipping 914 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1311 content::RecordAction(UserMetricsAction("ManagedUsers_SwitchProfile")); | 1310 content::RecordAction(UserMetricsAction("ManagedUsers_SwitchProfile")); |
1312 | 1311 |
1313 is_profile_active_ = profile_became_active; | 1312 is_profile_active_ = profile_became_active; |
1314 } | 1313 } |
1315 #endif // !defined(OS_ANDROID) | 1314 #endif // !defined(OS_ANDROID) |
1316 | 1315 |
1317 void SupervisedUserService::OnSiteListUpdated() { | 1316 void SupervisedUserService::OnSiteListUpdated() { |
1318 for (SupervisedUserServiceObserver& observer : observer_list_) | 1317 for (SupervisedUserServiceObserver& observer : observer_list_) |
1319 observer.OnURLFilterChanged(); | 1318 observer.OnURLFilterChanged(); |
1320 } | 1319 } |
OLD | NEW |