diff options
author | davemoore@chromium.org <davemoore@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-24 19:49:43 +0000 |
---|---|---|
committer | davemoore@chromium.org <davemoore@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-24 19:49:43 +0000 |
commit | 596a4268bf59a220e0f9abd8150dc94d20e0770c (patch) | |
tree | 68615131ba624346aa06366b066c9542c1992df5 /chrome/browser/profile_manager.cc | |
parent | 2332c2e68c441d066d179b29edd659f51b55ed62 (diff) | |
download | chromium_src-596a4268bf59a220e0f9abd8150dc94d20e0770c.zip chromium_src-596a4268bf59a220e0f9abd8150dc94d20e0770c.tar.gz chromium_src-596a4268bf59a220e0f9abd8150dc94d20e0770c.tar.bz2 |
Don't initialize extensions for the wizard profile
The extensions services can't be run in multiple profiles.
The team is working on a fix, but this keeps it from happening.
BUG=38929
TEST=Install extension in cros without crashing.
Review URL: http://codereview.chromium.org/1213003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@42515 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/profile_manager.cc')
-rw-r--r-- | chrome/browser/profile_manager.cc | 49 |
1 files changed, 27 insertions, 22 deletions
diff --git a/chrome/browser/profile_manager.cc b/chrome/browser/profile_manager.cc index 38283891..4e91063 100644 --- a/chrome/browser/profile_manager.cc +++ b/chrome/browser/profile_manager.cc @@ -136,7 +136,26 @@ Profile* ProfileManager::GetDefaultProfile(const FilePath& user_data_dir) { #endif } +#if defined(OS_CHROMEOS) +Profile* ProfileManager::GetWizardProfile() { + FilePath user_data_dir; + PathService::Get(chrome::DIR_USER_DATA, &user_data_dir); + FilePath default_profile_dir(user_data_dir); + default_profile_dir = default_profile_dir.Append( + FilePath::FromWStringHack(chrome::kNotSignedInProfile)); + ProfileManager* profile_manager = g_browser_process->profile_manager(); + + // Don't init extensions for this profile + return profile_manager->GetProfile(default_profile_dir, false); +} +#endif + Profile* ProfileManager::GetProfile(const FilePath& profile_dir) { + return GetProfile(profile_dir, true); +} + +Profile* ProfileManager::GetProfile( + const FilePath& profile_dir, bool init_extensions) { // If the profile is already loaded (e.g., chrome.exe launched twice), just // return it. Profile* profile = GetProfileByPath(profile_dir); @@ -146,34 +165,19 @@ Profile* ProfileManager::GetProfile(const FilePath& profile_dir) { if (!ProfileManager::IsProfile(profile_dir)) { // If the profile directory doesn't exist, create it. profile = ProfileManager::CreateProfile(profile_dir); - if (!profile) - return NULL; - bool result = AddProfile(profile); - DCHECK(result); } else { // The profile already exists on disk, just load it. - profile = AddProfileByPath(profile_dir); - if (!profile) - return NULL; + profile = Profile::CreateProfile(profile_dir); } DCHECK(profile); - return profile; -} - -Profile* ProfileManager::AddProfileByPath(const FilePath& path) { - Profile* profile = GetProfileByPath(path); - if (profile) - return profile; - - profile = Profile::CreateProfile(path); - if (AddProfile(profile)) { - return profile; - } else { - return NULL; + if (profile) { + bool result = AddProfile(profile, init_extensions); + DCHECK(result); } + return profile; } -bool ProfileManager::AddProfile(Profile* profile) { +bool ProfileManager::AddProfile(Profile* profile, bool init_extensions) { DCHECK(profile); // Make sure that we're not loading a profile with the same ID as a profile @@ -186,7 +190,8 @@ bool ProfileManager::AddProfile(Profile* profile) { } profiles_.insert(profiles_.end(), profile); - profile->InitExtensions(); + if (init_extensions) + profile->InitExtensions(); const CommandLine& command_line = *CommandLine::ForCurrentProcess(); if (!command_line.HasSwitch(switches::kDisableWebResources)) profile->InitWebResources(); |