Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(141)

Side by Side Diff: chrome/browser/profiles/profiles_state.cc

Issue 633233002: Lock only permitted where a supervised user is or was. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698