Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "chrome/browser/profiles/profiles_state.h" | |
| 6 | |
| 7 #include "base/command_line.h" | |
| 8 #include "base/files/file_path.h" | |
| 9 #include "base/prefs/pref_registry_simple.h" | |
| 10 #include "chrome/browser/profiles/profile.h" | |
|
tfarina
2013/07/16 18:15:04
can you remove this?
noms
2013/07/16 18:24:02
Done.
| |
| 11 #include "chrome/common/chrome_constants.h" | |
| 12 #include "chrome/common/chrome_switches.h" | |
| 13 #include "chrome/common/pref_names.h" | |
| 14 | |
| 15 namespace profiles { | |
| 16 | |
| 17 bool IsMultipleProfilesEnabled() { | |
| 18 #if defined(OS_ANDROID) | |
| 19 return false; | |
| 20 #endif | |
| 21 #if defined(OS_CHROMEOS) | |
| 22 if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kMultiProfiles)) | |
| 23 return false; | |
| 24 #endif | |
| 25 | |
| 26 return true; | |
| 27 } | |
| 28 | |
| 29 base::FilePath GetDefaultProfileDir( | |
| 30 const base::FilePath& user_data_dir) { | |
| 31 base::FilePath default_profile_dir(user_data_dir); | |
| 32 default_profile_dir = | |
| 33 default_profile_dir.AppendASCII(chrome::kInitialProfile); | |
| 34 return default_profile_dir; | |
| 35 } | |
| 36 | |
| 37 base::FilePath GetProfilePrefsPath( | |
| 38 const base::FilePath &profile_dir) { | |
| 39 base::FilePath default_prefs_path(profile_dir); | |
| 40 default_prefs_path = default_prefs_path.Append(chrome::kPreferencesFilename); | |
| 41 return default_prefs_path; | |
| 42 } | |
| 43 | |
| 44 void RegisterPrefs(PrefRegistrySimple* registry) { | |
| 45 registry->RegisterStringPref(prefs::kProfileLastUsed, std::string()); | |
| 46 registry->RegisterIntegerPref(prefs::kProfilesNumCreated, 1); | |
| 47 registry->RegisterListPref(prefs::kProfilesLastActive); | |
| 48 } | |
| 49 | |
| 50 } // namespace profiles | |
| OLD | NEW |