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

Unified 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 side-by-side diff with in-line comments
Download patch
« 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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/profiles/profiles_state.cc
diff --git a/chrome/browser/profiles/profiles_state.cc b/chrome/browser/profiles/profiles_state.cc
new file mode 100644
index 0000000000000000000000000000000000000000..a9716b207cf1c4cd4727376581834ca094f71f6e
--- /dev/null
+++ b/chrome/browser/profiles/profiles_state.cc
@@ -0,0 +1,54 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/profiles/profiles_state.h"
+
+#include "base/command_line.h"
+#include "base/files/file_path.h"
+#include "base/prefs/pref_registry_simple.h"
+#include "chrome/common/chrome_constants.h"
+#include "chrome/common/chrome_switches.h"
+#include "chrome/common/pref_names.h"
+
+namespace profiles {
+
+bool IsMultipleProfilesEnabled() {
+#if defined(OS_ANDROID)
+ return false;
+#endif
+#if defined(OS_CHROMEOS)
+ if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kMultiProfiles))
+ return false;
+#endif
+
+ return true;
+}
+
+bool IsNewProfileManagementEnabled() {
+ return CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kNewProfileManagement);
+}
+
+base::FilePath GetDefaultProfileDir(
+ const base::FilePath& user_data_dir) {
+ base::FilePath default_profile_dir(user_data_dir);
+ default_profile_dir =
+ default_profile_dir.AppendASCII(chrome::kInitialProfile);
+ return default_profile_dir;
+}
+
+base::FilePath GetProfilePrefsPath(
+ const base::FilePath &profile_dir) {
+ base::FilePath default_prefs_path(profile_dir);
+ default_prefs_path = default_prefs_path.Append(chrome::kPreferencesFilename);
+ return default_prefs_path;
+}
+
+void RegisterPrefs(PrefRegistrySimple* registry) {
+ registry->RegisterStringPref(prefs::kProfileLastUsed, std::string());
+ registry->RegisterIntegerPref(prefs::kProfilesNumCreated, 1);
+ registry->RegisterListPref(prefs::kProfilesLastActive);
+}
+
+} // namespace profiles
« 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