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 776 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
787 command_line->HasSwitch(switches::kSupervisedUserId); | 787 command_line->HasSwitch(switches::kSupervisedUserId); |
788 if (force_supervised_user_id) { | 788 if (force_supervised_user_id) { |
789 supervised_user_id = | 789 supervised_user_id = |
790 command_line->GetSwitchValueASCII(switches::kSupervisedUserId); | 790 command_line->GetSwitchValueASCII(switches::kSupervisedUserId); |
791 } | 791 } |
792 if (force_supervised_user_id || | 792 if (force_supervised_user_id || |
793 !profile->GetPrefs()->HasPrefPath(prefs::kSupervisedUserId)) { | 793 !profile->GetPrefs()->HasPrefPath(prefs::kSupervisedUserId)) { |
794 profile->GetPrefs()->SetString(prefs::kSupervisedUserId, | 794 profile->GetPrefs()->SetString(prefs::kSupervisedUserId, |
795 supervised_user_id); | 795 supervised_user_id); |
796 } | 796 } |
| 797 |
| 798 #if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX) |
| 799 // If the lock enabled algorithm changed, update this profile's lock status. |
| 800 if (switches::IsNewProfileManagement()) |
| 801 profiles::UpdateIsProfileLockEnabledIfNeeded(profile); |
| 802 #endif |
797 } | 803 } |
798 | 804 |
799 void ProfileManager::RegisterTestingProfile(Profile* profile, | 805 void ProfileManager::RegisterTestingProfile(Profile* profile, |
800 bool add_to_cache, | 806 bool add_to_cache, |
801 bool start_deferred_task_runners) { | 807 bool start_deferred_task_runners) { |
802 RegisterProfile(profile, true); | 808 RegisterProfile(profile, true); |
803 if (add_to_cache) { | 809 if (add_to_cache) { |
804 InitProfileUserPrefs(profile); | 810 InitProfileUserPrefs(profile); |
805 AddProfileToCache(profile); | 811 AddProfileToCache(profile); |
806 } | 812 } |
(...skipping 511 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1318 last_non_supervised_profile_path.BaseName().MaybeAsASCII()); | 1324 last_non_supervised_profile_path.BaseName().MaybeAsASCII()); |
1319 FinishDeletingProfile(profile_to_delete_path); | 1325 FinishDeletingProfile(profile_to_delete_path); |
1320 } | 1326 } |
1321 } | 1327 } |
1322 } | 1328 } |
1323 #endif | 1329 #endif |
1324 | 1330 |
1325 ProfileManagerWithoutInit::ProfileManagerWithoutInit( | 1331 ProfileManagerWithoutInit::ProfileManagerWithoutInit( |
1326 const base::FilePath& user_data_dir) : ProfileManager(user_data_dir) { | 1332 const base::FilePath& user_data_dir) : ProfileManager(user_data_dir) { |
1327 } | 1333 } |
OLD | NEW |