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

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

Issue 18615010: Refactor utility methods out of the ProfileManager (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: renamed util file Created 7 years, 5 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
(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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698