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 791 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
802 } | 802 } |
803 | 803 |
804 if (!profile->GetPrefs()->HasPrefPath(prefs::kProfileAvatarIndex)) | 804 if (!profile->GetPrefs()->HasPrefPath(prefs::kProfileAvatarIndex)) |
805 profile->GetPrefs()->SetInteger(prefs::kProfileAvatarIndex, avatar_index); | 805 profile->GetPrefs()->SetInteger(prefs::kProfileAvatarIndex, avatar_index); |
806 | 806 |
807 if (!profile->GetPrefs()->HasPrefPath(prefs::kProfileName)) | 807 if (!profile->GetPrefs()->HasPrefPath(prefs::kProfileName)) |
808 profile->GetPrefs()->SetString(prefs::kProfileName, profile_name); | 808 profile->GetPrefs()->SetString(prefs::kProfileName, profile_name); |
809 | 809 |
810 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); | 810 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); |
811 bool force_supervised_user_id = | 811 bool force_supervised_user_id = |
| 812 #if defined(OS_CHROMEOS) |
| 813 g_browser_process->platform_part() |
| 814 ->profile_helper() |
| 815 ->GetSigninProfileDir() != profile->GetPath() && |
| 816 #endif |
812 command_line->HasSwitch(switches::kSupervisedUserId); | 817 command_line->HasSwitch(switches::kSupervisedUserId); |
813 if (force_supervised_user_id) { | 818 if (force_supervised_user_id) { |
814 supervised_user_id = | 819 supervised_user_id = |
815 command_line->GetSwitchValueASCII(switches::kSupervisedUserId); | 820 command_line->GetSwitchValueASCII(switches::kSupervisedUserId); |
816 } | 821 } |
817 if (force_supervised_user_id || | 822 if (force_supervised_user_id || |
818 !profile->GetPrefs()->HasPrefPath(prefs::kSupervisedUserId)) { | 823 !profile->GetPrefs()->HasPrefPath(prefs::kSupervisedUserId)) { |
819 profile->GetPrefs()->SetString(prefs::kSupervisedUserId, | 824 profile->GetPrefs()->SetString(prefs::kSupervisedUserId, |
820 supervised_user_id); | 825 supervised_user_id); |
821 } | 826 } |
(...skipping 546 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1368 last_non_supervised_profile_path.BaseName().MaybeAsASCII()); | 1373 last_non_supervised_profile_path.BaseName().MaybeAsASCII()); |
1369 FinishDeletingProfile(profile_to_delete_path); | 1374 FinishDeletingProfile(profile_to_delete_path); |
1370 } | 1375 } |
1371 } | 1376 } |
1372 } | 1377 } |
1373 #endif | 1378 #endif |
1374 | 1379 |
1375 ProfileManagerWithoutInit::ProfileManagerWithoutInit( | 1380 ProfileManagerWithoutInit::ProfileManagerWithoutInit( |
1376 const base::FilePath& user_data_dir) : ProfileManager(user_data_dir) { | 1381 const base::FilePath& user_data_dir) : ProfileManager(user_data_dir) { |
1377 } | 1382 } |
OLD | NEW |