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

Unified Diff: chrome/browser/profiles/profile_manager.cc

Issue 7630002: Fix regression where component extensions were being loaded for login profile (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added myself as OWNER Created 9 years, 4 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/profile_manager.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/profiles/profile_manager.cc
diff --git a/chrome/browser/profiles/profile_manager.cc b/chrome/browser/profiles/profile_manager.cc
index a4a0c1f094b358900bad2db73e767aa6e94137af..a1d792243b5e89c9dd1492ceff3729165a00774c 100644
--- a/chrome/browser/profiles/profile_manager.cc
+++ b/chrome/browser/profiles/profile_manager.cc
@@ -195,22 +195,14 @@ Profile* ProfileManager::GetDefaultProfile(const FilePath& user_data_dir) {
default_profile_dir = default_profile_dir.Append(GetInitialProfileDir());
#if defined(OS_CHROMEOS)
if (!logged_in_) {
- Profile* profile;
- const CommandLine& command_line = *CommandLine::ForCurrentProcess();
-
+ Profile* profile = GetProfile(default_profile_dir);
// For cros, return the OTR profile so we never accidentally keep
// user data in an unencrypted profile. But doing this makes
// many of the browser and ui tests fail. We do return the OTR profile
// if the login-profile switch is passed so that we can test this.
// TODO(davemoore) Fix the tests so they allow OTR profiles.
- if (!command_line.HasSwitch(switches::kTestType) ||
- command_line.HasSwitch(switches::kLoginProfile)) {
- // Don't init extensions for this profile
- profile = GetProfile(default_profile_dir);
- profile = profile->GetOffTheRecordProfile();
- } else {
- profile = GetProfile(default_profile_dir);
- }
+ if (ShouldGoOffTheRecord())
+ return profile->GetOffTheRecordProfile();
return profile;
}
#endif
@@ -312,7 +304,7 @@ bool ProfileManager::AddProfile(Profile* profile) {
}
RegisterProfile(profile, true);
- DoFinalInit(profile, false);
+ DoFinalInit(profile, ShouldGoOffTheRecord());
return true;
}
@@ -381,16 +373,8 @@ void ProfileManager::OnProfileCreated(Profile* profile, bool success) {
std::vector<ProfileManagerObserver*> observers;
info->observers.swap(observers);
- bool go_off_the_record = false;
+ bool go_off_the_record = ShouldGoOffTheRecord();
if (success) {
-#if defined(OS_CHROMEOS)
- const CommandLine& command_line = *CommandLine::ForCurrentProcess();
- if (!logged_in_ &&
- (!command_line.HasSwitch(switches::kTestType) ||
- command_line.HasSwitch(switches::kLoginProfile))) {
- go_off_the_record = true;
- }
-#endif
if (!go_off_the_record) {
for (size_t i = 0; i < observers.size(); ++i) {
observers[i]->OnProfileCreated(
@@ -549,6 +533,19 @@ void ProfileManager::AddProfileToCache(Profile* profile) {
}
}
+bool ProfileManager::ShouldGoOffTheRecord() {
+ bool go_off_the_record = false;
+#if defined(OS_CHROMEOS)
+ const CommandLine& command_line = *CommandLine::ForCurrentProcess();
+ if (!logged_in_ &&
+ (!command_line.HasSwitch(switches::kTestType) ||
+ command_line.HasSwitch(switches::kLoginProfile))) {
+ go_off_the_record = true;
+ }
+#endif
+ return go_off_the_record;
+}
+
void ProfileManager::ScheduleProfileForDeletion(const FilePath& profile_dir) {
// TODO(sail): Due to bug 88586 we don't delete the profile instance. Once we
// start deleting the profile instance we need to close background apps too.
« no previous file with comments | « chrome/browser/profiles/profile_manager.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698