OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/profiles_state.h" | 5 #include "chrome/browser/profiles/profiles_state.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
208 const base::FilePath& active_profile_path = | 208 const base::FilePath& active_profile_path = |
209 profile_manager->GetLastUsedProfileDir(profile_manager->user_data_dir()); | 209 profile_manager->GetLastUsedProfileDir(profile_manager->user_data_dir()); |
210 const base::FilePath& guest_path = ProfileManager::GetGuestProfilePath(); | 210 const base::FilePath& guest_path = ProfileManager::GetGuestProfilePath(); |
211 if (active_profile_path == guest_path) | 211 if (active_profile_path == guest_path) |
212 return true; | 212 return true; |
213 | 213 |
214 ProfileAttributesEntry* entry; | 214 ProfileAttributesEntry* entry; |
215 bool has_entry = | 215 bool has_entry = |
216 g_browser_process->profile_manager()->GetProfileAttributesStorage(). | 216 g_browser_process->profile_manager()->GetProfileAttributesStorage(). |
217 GetProfileAttributesWithPath(active_profile_path, &entry); | 217 GetProfileAttributesWithPath(active_profile_path, &entry); |
218 DCHECK(has_entry); | |
219 | 218 |
220 if (!entry->IsSigninRequired()) | 219 // |has_entry| may be false if a profile is specified on the command line. |
| 220 if (has_entry && !entry->IsSigninRequired()) |
221 return false; | 221 return false; |
222 | 222 |
223 SetLastUsedProfile(guest_path.BaseName().MaybeAsASCII()); | 223 SetLastUsedProfile(guest_path.BaseName().MaybeAsASCII()); |
224 | 224 |
225 return true; | 225 return true; |
226 } | 226 } |
227 | 227 |
228 void RemoveBrowsingDataForProfile(const base::FilePath& profile_path) { | 228 void RemoveBrowsingDataForProfile(const base::FilePath& profile_path) { |
229 // The BrowsingDataRemover relies on the ResourceDispatcherHost, which is | 229 // The BrowsingDataRemover relies on the ResourceDispatcherHost, which is |
230 // null in unit tests. | 230 // null in unit tests. |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
270 if (!entry->IsSigninRequired() && | 270 if (!entry->IsSigninRequired() && |
271 !entry->IsChild() && | 271 !entry->IsChild() && |
272 !entry->IsLegacySupervised()) { | 272 !entry->IsLegacySupervised()) { |
273 return false; | 273 return false; |
274 } | 274 } |
275 } | 275 } |
276 return all_profiles_locked; | 276 return all_profiles_locked; |
277 } | 277 } |
278 | 278 |
279 } // namespace profiles | 279 } // namespace profiles |
OLD | NEW |