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 1090 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
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 IncognitoModePrefs::SetAvailability(profile->GetPrefs(), | 1110 IncognitoModePrefs::SetAvailability(profile->GetPrefs(), |
1111 IncognitoModePrefs::FORCED); | 1111 IncognitoModePrefs::ENABLED); |
noms (inactive)
2014/02/14 19:28:10
I think this is the default behaviour, so you don'
bcwhite
2014/02/14 19:46:36
It has to be present to switch existing Guest prof
| |
1112 profile->GetPrefs()->SetBoolean(prefs::kShowBookmarkBar, false); | 1112 profile->GetPrefs()->SetBoolean(prefs::kShowBookmarkBar, false); |
noms (inactive)
2014/02/14 19:28:10
Is this still needed? At the moment you can bring
bcwhite
2014/02/14 19:46:36
Done.
| |
1113 } | 1113 } |
1114 | 1114 |
1115 bool ProfileManager::ShouldGoOffTheRecord(Profile* profile) { | 1115 bool ProfileManager::ShouldGoOffTheRecord(Profile* profile) { |
1116 bool go_off_the_record = false; | 1116 if (profile->IsGuestSession()) |
1117 return true; | |
1117 #if defined(OS_CHROMEOS) | 1118 #if defined(OS_CHROMEOS) |
1118 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 1119 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
1119 if (command_line.HasSwitch(chromeos::switches::kGuestSession) || | 1120 if (profile->GetPath().BaseName().value() == chrome::kInitialProfile && |
1120 (profile->GetPath().BaseName().value() == chrome::kInitialProfile && | 1121 (!command_line.HasSwitch(switches::kTestType) || |
1121 (!command_line.HasSwitch(switches::kTestType) || | 1122 command_line.HasSwitch(chromeos::switches::kLoginProfile))) { |
1122 command_line.HasSwitch(chromeos::switches::kLoginProfile)))) { | 1123 return true; |
1123 go_off_the_record = true; | |
1124 } | 1124 } |
1125 #endif | 1125 #endif |
1126 return go_off_the_record; | 1126 return false; |
noms (inactive)
2014/02/14 19:28:10
If you move the ifdef to the top, you can just ret
bcwhite
2014/02/14 19:46:36
Could... but I think the style of testing various
| |
1127 } | 1127 } |
1128 | 1128 |
1129 void ProfileManager::RunCallbacks(const std::vector<CreateCallback>& callbacks, | 1129 void ProfileManager::RunCallbacks(const std::vector<CreateCallback>& callbacks, |
1130 Profile* profile, | 1130 Profile* profile, |
1131 Profile::CreateStatus status) { | 1131 Profile::CreateStatus status) { |
1132 for (size_t i = 0; i < callbacks.size(); ++i) | 1132 for (size_t i = 0; i < callbacks.size(); ++i) |
1133 callbacks[i].Run(profile, status); | 1133 callbacks[i].Run(profile, status); |
1134 } | 1134 } |
1135 | 1135 |
1136 ProfileManager::ProfileInfo::ProfileInfo( | 1136 ProfileManager::ProfileInfo::ProfileInfo( |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1234 last_non_managed_profile_path.BaseName().MaybeAsASCII()); | 1234 last_non_managed_profile_path.BaseName().MaybeAsASCII()); |
1235 FinishDeletingProfile(profile_to_delete_path); | 1235 FinishDeletingProfile(profile_to_delete_path); |
1236 } | 1236 } |
1237 } | 1237 } |
1238 } | 1238 } |
1239 #endif | 1239 #endif |
1240 | 1240 |
1241 ProfileManagerWithoutInit::ProfileManagerWithoutInit( | 1241 ProfileManagerWithoutInit::ProfileManagerWithoutInit( |
1242 const base::FilePath& user_data_dir) : ProfileManager(user_data_dir) { | 1242 const base::FilePath& user_data_dir) : ProfileManager(user_data_dir) { |
1243 } | 1243 } |
OLD | NEW |