| 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 23 matching lines...) Expand all Loading... |
| 34 } | 34 } |
| 35 | 35 |
| 36 base::FilePath GetDefaultProfileDir(const base::FilePath& user_data_dir) { | 36 base::FilePath GetDefaultProfileDir(const base::FilePath& user_data_dir) { |
| 37 base::FilePath default_profile_dir(user_data_dir); | 37 base::FilePath default_profile_dir(user_data_dir); |
| 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 registry->RegisterStringPref(prefs::kProfileLastUsed, std::string()); | 45 registry->RegisterStringPref(prefs::kProfileLastUsed, std::string()); |
| 45 registry->RegisterIntegerPref(prefs::kProfilesNumCreated, 1); | 46 registry->RegisterIntegerPref(prefs::kProfilesNumCreated, 1); |
| 46 registry->RegisterListPref(prefs::kProfilesLastActive); | 47 registry->RegisterListPref(prefs::kProfilesLastActive); |
| 48 |
| 49 // Preferences about the user manager. |
| 50 registry->RegisterBooleanPref(prefs::kBrowserGuestModeEnabled, true); |
| 51 registry->RegisterBooleanPref(prefs::kBrowserAddPersonEnabled, true); |
| 47 } | 52 } |
| 48 | 53 |
| 49 base::string16 GetAvatarNameForProfile(const base::FilePath& profile_path) { | 54 base::string16 GetAvatarNameForProfile(const base::FilePath& profile_path) { |
| 50 base::string16 display_name; | 55 base::string16 display_name; |
| 51 | 56 |
| 52 if (profile_path == ProfileManager::GetGuestProfilePath()) { | 57 if (profile_path == ProfileManager::GetGuestProfilePath()) { |
| 53 display_name = l10n_util::GetStringUTF16(IDS_GUEST_PROFILE_NAME); | 58 display_name = l10n_util::GetStringUTF16(IDS_GUEST_PROFILE_NAME); |
| 54 } else { | 59 } else { |
| 55 ProfileInfoCache& cache = | 60 ProfileInfoCache& cache = |
| 56 g_browser_process->profile_manager()->GetProfileInfoCache(); | 61 g_browser_process->profile_manager()->GetProfileInfoCache(); |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 GAIAInfoUpdateServiceFactory::GetInstance()->GetForProfile(profile)->Update(); | 148 GAIAInfoUpdateServiceFactory::GetInstance()->GetForProfile(profile)->Update(); |
| 144 } | 149 } |
| 145 | 150 |
| 146 SigninErrorController* GetSigninErrorController(Profile* profile) { | 151 SigninErrorController* GetSigninErrorController(Profile* profile) { |
| 147 ProfileOAuth2TokenService* token_service = | 152 ProfileOAuth2TokenService* token_service = |
| 148 ProfileOAuth2TokenServiceFactory::GetForProfile(profile); | 153 ProfileOAuth2TokenServiceFactory::GetForProfile(profile); |
| 149 return token_service ? token_service->signin_error_controller() : NULL; | 154 return token_service ? token_service->signin_error_controller() : NULL; |
| 150 } | 155 } |
| 151 | 156 |
| 152 } // namespace profiles | 157 } // namespace profiles |
| OLD | NEW |