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

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: unbreak rebase and added new static fn from trunk 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/common/chrome_constants.h"
11 #include "chrome/common/chrome_switches.h"
12 #include "chrome/common/pref_names.h"
13
14 namespace profiles {
15
16 bool IsMultipleProfilesEnabled() {
17 #if defined(OS_ANDROID)
18 return false;
19 #endif
20 #if defined(OS_CHROMEOS)
21 if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kMultiProfiles))
22 return false;
23 #endif
24
25 return true;
26 }
27
28 bool IsNewProfileManagementEnabled() {
29 return CommandLine::ForCurrentProcess()->HasSwitch(
30 switches::kNewProfileManagement);
31 }
32
33 base::FilePath GetDefaultProfileDir(
34 const base::FilePath& user_data_dir) {
35 base::FilePath default_profile_dir(user_data_dir);
36 default_profile_dir =
37 default_profile_dir.AppendASCII(chrome::kInitialProfile);
38 return default_profile_dir;
39 }
40
41 base::FilePath GetProfilePrefsPath(
42 const base::FilePath &profile_dir) {
43 base::FilePath default_prefs_path(profile_dir);
44 default_prefs_path = default_prefs_path.Append(chrome::kPreferencesFilename);
45 return default_prefs_path;
46 }
47
48 void RegisterPrefs(PrefRegistrySimple* registry) {
49 registry->RegisterStringPref(prefs::kProfileLastUsed, std::string());
50 registry->RegisterIntegerPref(prefs::kProfilesNumCreated, 1);
51 registry->RegisterListPref(prefs::kProfilesLastActive);
52 }
53
54 } // namespace profiles
OLDNEW
« no previous file with comments | « chrome/browser/profiles/profiles_state.h ('k') | chrome/browser/ui/browser_command_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698