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 1089 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1100 icon_index, | 1100 icon_index, |
1101 managed_user_id); | 1101 managed_user_id); |
1102 | 1102 |
1103 if (profile->GetPrefs()->GetBoolean(prefs::kForceEphemeralProfiles)) { | 1103 if (profile->GetPrefs()->GetBoolean(prefs::kForceEphemeralProfiles)) { |
1104 cache.SetProfileIsEphemeralAtIndex( | 1104 cache.SetProfileIsEphemeralAtIndex( |
1105 cache.GetIndexOfProfileWithPath(profile->GetPath()), true); | 1105 cache.GetIndexOfProfileWithPath(profile->GetPath()), true); |
1106 } | 1106 } |
1107 } | 1107 } |
1108 | 1108 |
1109 void ProfileManager::SetGuestProfilePrefs(Profile* profile) { | 1109 void ProfileManager::SetGuestProfilePrefs(Profile* profile) { |
1110 // This can be removed in the future but needs to be present through | |
1111 // a release (or two) so that any existing installs get switched to | |
1112 // the new state and away from the previous "forced" state. | |
1110 IncognitoModePrefs::SetAvailability(profile->GetPrefs(), | 1113 IncognitoModePrefs::SetAvailability(profile->GetPrefs(), |
1111 IncognitoModePrefs::FORCED); | 1114 IncognitoModePrefs::ENABLED); |
1112 profile->GetPrefs()->SetBoolean(prefs::kShowBookmarkBar, false); | |
1113 } | 1115 } |
1114 | 1116 |
1115 bool ProfileManager::ShouldGoOffTheRecord(Profile* profile) { | 1117 bool ProfileManager::ShouldGoOffTheRecord(Profile* profile) { |
1116 bool go_off_the_record = false; | 1118 if (profile->IsGuestSession()) |
msw
2014/02/15 00:30:52
nit: if the order of checks between this and the C
bcwhite
2014/02/18 15:19:36
Done.
| |
1119 return true; | |
1117 #if defined(OS_CHROMEOS) | 1120 #if defined(OS_CHROMEOS) |
1118 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 1121 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
1119 if (command_line.HasSwitch(chromeos::switches::kGuestSession) || | 1122 if (profile->GetPath().BaseName().value() == chrome::kInitialProfile && |
1120 (profile->GetPath().BaseName().value() == chrome::kInitialProfile && | 1123 (!command_line.HasSwitch(switches::kTestType) || |
1121 (!command_line.HasSwitch(switches::kTestType) || | 1124 command_line.HasSwitch(chromeos::switches::kLoginProfile))) { |
1122 command_line.HasSwitch(chromeos::switches::kLoginProfile)))) { | 1125 return true; |
1123 go_off_the_record = true; | |
1124 } | 1126 } |
1125 #endif | 1127 #endif |
1126 return go_off_the_record; | 1128 return false; |
1127 } | 1129 } |
1128 | 1130 |
1129 void ProfileManager::RunCallbacks(const std::vector<CreateCallback>& callbacks, | 1131 void ProfileManager::RunCallbacks(const std::vector<CreateCallback>& callbacks, |
1130 Profile* profile, | 1132 Profile* profile, |
1131 Profile::CreateStatus status) { | 1133 Profile::CreateStatus status) { |
1132 for (size_t i = 0; i < callbacks.size(); ++i) | 1134 for (size_t i = 0; i < callbacks.size(); ++i) |
1133 callbacks[i].Run(profile, status); | 1135 callbacks[i].Run(profile, status); |
1134 } | 1136 } |
1135 | 1137 |
1136 ProfileManager::ProfileInfo::ProfileInfo( | 1138 ProfileManager::ProfileInfo::ProfileInfo( |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1234 last_non_managed_profile_path.BaseName().MaybeAsASCII()); | 1236 last_non_managed_profile_path.BaseName().MaybeAsASCII()); |
1235 FinishDeletingProfile(profile_to_delete_path); | 1237 FinishDeletingProfile(profile_to_delete_path); |
1236 } | 1238 } |
1237 } | 1239 } |
1238 } | 1240 } |
1239 #endif | 1241 #endif |
1240 | 1242 |
1241 ProfileManagerWithoutInit::ProfileManagerWithoutInit( | 1243 ProfileManagerWithoutInit::ProfileManagerWithoutInit( |
1242 const base::FilePath& user_data_dir) : ProfileManager(user_data_dir) { | 1244 const base::FilePath& user_data_dir) : ProfileManager(user_data_dir) { |
1243 } | 1245 } |
OLD | NEW |