OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/profiles/profile_manager.h" | 5 #include "chrome/browser/profiles/profile_manager.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 779 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
790 command_line->HasSwitch(switches::kSupervisedUserId); | 790 command_line->HasSwitch(switches::kSupervisedUserId); |
791 if (force_supervised_user_id) { | 791 if (force_supervised_user_id) { |
792 supervised_user_id = | 792 supervised_user_id = |
793 command_line->GetSwitchValueASCII(switches::kSupervisedUserId); | 793 command_line->GetSwitchValueASCII(switches::kSupervisedUserId); |
794 } | 794 } |
795 if (force_supervised_user_id || | 795 if (force_supervised_user_id || |
796 !profile->GetPrefs()->HasPrefPath(prefs::kSupervisedUserId)) { | 796 !profile->GetPrefs()->HasPrefPath(prefs::kSupervisedUserId)) { |
797 profile->GetPrefs()->SetString(prefs::kSupervisedUserId, | 797 profile->GetPrefs()->SetString(prefs::kSupervisedUserId, |
798 supervised_user_id); | 798 supervised_user_id); |
799 } | 799 } |
| 800 |
| 801 #if !defined(OS_ANDROID) && !defined(OS_IOS) && !defined(OS_CHROMEOS) |
| 802 // If the lock enabled algorithm changed, update this profile's lock status. |
| 803 if (switches::IsNewProfileManagement()) |
| 804 profiles::UpdateIsProfileLockEnabledIfNeeded(profile); |
| 805 #endif |
800 } | 806 } |
801 | 807 |
802 void ProfileManager::RegisterTestingProfile(Profile* profile, | 808 void ProfileManager::RegisterTestingProfile(Profile* profile, |
803 bool add_to_cache, | 809 bool add_to_cache, |
804 bool start_deferred_task_runners) { | 810 bool start_deferred_task_runners) { |
805 RegisterProfile(profile, true); | 811 RegisterProfile(profile, true); |
806 if (add_to_cache) { | 812 if (add_to_cache) { |
807 InitProfileUserPrefs(profile); | 813 InitProfileUserPrefs(profile); |
808 AddProfileToCache(profile); | 814 AddProfileToCache(profile); |
809 } | 815 } |
(...skipping 511 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1321 last_non_supervised_profile_path.BaseName().MaybeAsASCII()); | 1327 last_non_supervised_profile_path.BaseName().MaybeAsASCII()); |
1322 FinishDeletingProfile(profile_to_delete_path); | 1328 FinishDeletingProfile(profile_to_delete_path); |
1323 } | 1329 } |
1324 } | 1330 } |
1325 } | 1331 } |
1326 #endif | 1332 #endif |
1327 | 1333 |
1328 ProfileManagerWithoutInit::ProfileManagerWithoutInit( | 1334 ProfileManagerWithoutInit::ProfileManagerWithoutInit( |
1329 const base::FilePath& user_data_dir) : ProfileManager(user_data_dir) { | 1335 const base::FilePath& user_data_dir) : ProfileManager(user_data_dir) { |
1330 } | 1336 } |
OLD | NEW |