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 "base/files/file_path.h" | 7 #include "base/files/file_path.h" |
8 #include "base/prefs/pref_registry_simple.h" | 8 #include "base/prefs/pref_registry_simple.h" |
9 #include "base/prefs/pref_service.h" | 9 #include "base/prefs/pref_service.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
(...skipping 27 matching lines...) Expand all Loading... |
38 default_profile_dir = | 38 default_profile_dir = |
39 default_profile_dir.AppendASCII(chrome::kInitialProfile); | 39 default_profile_dir.AppendASCII(chrome::kInitialProfile); |
40 return default_profile_dir; | 40 return default_profile_dir; |
41 } | 41 } |
42 | 42 |
43 void RegisterPrefs(PrefRegistrySimple* registry) { | 43 void RegisterPrefs(PrefRegistrySimple* registry) { |
44 // Preferences about global profile information. | 44 // Preferences about global profile information. |
45 registry->RegisterStringPref(prefs::kProfileLastUsed, std::string()); | 45 registry->RegisterStringPref(prefs::kProfileLastUsed, std::string()); |
46 registry->RegisterIntegerPref(prefs::kProfilesNumCreated, 1); | 46 registry->RegisterIntegerPref(prefs::kProfilesNumCreated, 1); |
47 registry->RegisterListPref(prefs::kProfilesLastActive); | 47 registry->RegisterListPref(prefs::kProfilesLastActive); |
| 48 registry->RegisterBooleanPref(prefs::kSupervisedUserExistsOrExisted, false); |
48 | 49 |
49 // Preferences about the user manager. | 50 // Preferences about the user manager. |
50 registry->RegisterBooleanPref(prefs::kBrowserGuestModeEnabled, true); | 51 registry->RegisterBooleanPref(prefs::kBrowserGuestModeEnabled, true); |
51 registry->RegisterBooleanPref(prefs::kBrowserAddPersonEnabled, true); | 52 registry->RegisterBooleanPref(prefs::kBrowserAddPersonEnabled, true); |
52 } | 53 } |
53 | 54 |
54 base::string16 GetAvatarNameForProfile(const base::FilePath& profile_path) { | 55 base::string16 GetAvatarNameForProfile(const base::FilePath& profile_path) { |
55 base::string16 display_name; | 56 base::string16 display_name; |
56 | 57 |
57 if (profile_path == ProfileManager::GetGuestProfilePath()) { | 58 if (profile_path == ProfileManager::GetGuestProfilePath()) { |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 DCHECK(guest_profile); | 192 DCHECK(guest_profile); |
192 | 193 |
193 PrefService* local_state = g_browser_process->local_state(); | 194 PrefService* local_state = g_browser_process->local_state(); |
194 DCHECK(local_state); | 195 DCHECK(local_state); |
195 local_state->SetString(prefs::kProfileLastUsed, | 196 local_state->SetString(prefs::kProfileLastUsed, |
196 guest_profile->GetPath().BaseName().MaybeAsASCII()); | 197 guest_profile->GetPath().BaseName().MaybeAsASCII()); |
197 return guest_profile; | 198 return guest_profile; |
198 } | 199 } |
199 | 200 |
200 } // namespace profiles | 201 } // namespace profiles |
OLD | NEW |