Chromium Code Reviews| 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 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 249 // We should never be saving the System Profile as the last one used since it | 249 // We should never be saving the System Profile as the last one used since it |
| 250 // shouldn't have a browser. | 250 // shouldn't have a browser. |
| 251 if (profile_dir == base::FilePath(chrome::kSystemProfileDir).AsUTF8Unsafe()) | 251 if (profile_dir == base::FilePath(chrome::kSystemProfileDir).AsUTF8Unsafe()) |
| 252 return; | 252 return; |
| 253 | 253 |
| 254 PrefService* local_state = g_browser_process->local_state(); | 254 PrefService* local_state = g_browser_process->local_state(); |
| 255 DCHECK(local_state); | 255 DCHECK(local_state); |
| 256 local_state->SetString(prefs::kProfileLastUsed, profile_dir); | 256 local_state->SetString(prefs::kProfileLastUsed, profile_dir); |
| 257 } | 257 } |
| 258 | 258 |
| 259 bool AreAllProfilesLocked() { | |
| 260 bool all_profiles_locked = true; | |
| 261 | |
| 262 std::vector<ProfileAttributesEntry*> entries = | |
| 263 g_browser_process->profile_manager()->GetProfileAttributesStorage(). | |
| 264 GetAllProfilesAttributes(); | |
| 265 for (const ProfileAttributesEntry* entry : entries) { | |
| 266 if (entry->IsOmitted()) | |
| 267 continue; | |
| 268 | |
| 269 if (!entry->IsSigninRequired() && | |
|
dpapad
2016/05/27 23:59:42
Can we hide the complexity of determining whether
anthonyvd
2016/05/30 14:09:28
Semantically, that's what IsSigninRequired is doin
| |
| 270 !entry->IsChild() && | |
| 271 !entry->IsLegacySupervised()) { | |
| 272 all_profiles_locked = false; | |
| 273 break; | |
| 274 } | |
| 275 } | |
| 276 return all_profiles_locked; | |
| 277 } | |
| 278 | |
| 259 } // namespace profiles | 279 } // namespace profiles |
| OLD | NEW |