diff options
author | cpu@google.com <cpu@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-10-17 18:05:54 +0000 |
---|---|---|
committer | cpu@google.com <cpu@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-10-17 18:05:54 +0000 |
commit | 09da32d543461c90fcf3490966e0c4a670b9a2a8 (patch) | |
tree | 9503fe2d5a63b14bab3b5f00d6119770ec2a99d8 /chrome/browser/profile_manager.cc | |
parent | 937bcde53a86ea06ac8379e882de339ed95e3897 (diff) | |
download | chromium_src-09da32d543461c90fcf3490966e0c4a670b9a2a8.zip chromium_src-09da32d543461c90fcf3490966e0c4a670b9a2a8.tar.gz chromium_src-09da32d543461c90fcf3490966e0c4a670b9a2a8.tar.bz2 |
Add processing for a master profile json file on first run. Allows:
- set home page / show home button
- show bookmarks bar
Review URL: http://codereview.chromium.org/7369
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@3542 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/profile_manager.cc')
-rw-r--r-- | chrome/browser/profile_manager.cc | 30 |
1 files changed, 20 insertions, 10 deletions
diff --git a/chrome/browser/profile_manager.cc b/chrome/browser/profile_manager.cc index c4dae3b..34ac0a6 100644 --- a/chrome/browser/profile_manager.cc +++ b/chrome/browser/profile_manager.cc @@ -58,21 +58,32 @@ ProfileManager::~ProfileManager() { available_profiles_.clear(); } +std::wstring ProfileManager::GetDefaultProfileDir( + const std::wstring& user_data_dir) { + std::wstring default_profile_dir(user_data_dir); + file_util::AppendToPath(&default_profile_dir, chrome::kNotSignedInProfile); + return default_profile_dir; +} + +std::wstring ProfileManager::GetDefaultProfilePath( + const std::wstring &profile_dir) { + std::wstring default_prefs_path(profile_dir); + file_util::AppendToPath(&default_prefs_path, chrome::kPreferencesFilename); + return default_prefs_path; +} + Profile* ProfileManager::GetDefaultProfile(const std::wstring& user_data_dir) { // Initialize profile, creating default if necessary - std::wstring default_profile_path = user_data_dir; - file_util::AppendToPath(&default_profile_path, - chrome::kNotSignedInProfile); - + std::wstring default_profile_dir = GetDefaultProfileDir(user_data_dir); // If the profile is already loaded (e.g., chrome.exe launched twice), just // return it. - Profile* profile = GetProfileByPath(default_profile_path); + Profile* profile = GetProfileByPath(default_profile_dir); if (NULL != profile) return profile; - if (!ProfileManager::IsProfile(default_profile_path)) { + if (!ProfileManager::IsProfile(default_profile_dir)) { // If the profile directory doesn't exist, create it. - profile = ProfileManager::CreateProfile(default_profile_path, + profile = ProfileManager::CreateProfile(default_profile_dir, L"", // No name. L"", // No nickname. chrome::kNotSignedInID); @@ -82,7 +93,7 @@ Profile* ProfileManager::GetDefaultProfile(const std::wstring& user_data_dir) { DCHECK(result); } else { // The profile already exists on disk, just load it. - profile = AddProfileByPath(default_profile_path); + profile = AddProfileByPath(default_profile_dir); if (!profile) return NULL; @@ -209,8 +220,7 @@ Profile* ProfileManager::GetProfileByID(const std::wstring& id) const { // static bool ProfileManager::IsProfile(const std::wstring& path) { - std::wstring prefs_path = path; - file_util::AppendToPath(&prefs_path, chrome::kPreferencesFilename); + std::wstring prefs_path = GetDefaultProfilePath(path); std::wstring history_path = path; file_util::AppendToPath(&history_path, chrome::kHistoryFilename); |