diff options
author | finnur@chromium.org <finnur@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-26 10:19:27 +0000 |
---|---|---|
committer | finnur@chromium.org <finnur@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-26 10:19:27 +0000 |
commit | e95a993bd76e6bcd3417c97fd9c8a02c1d5ba35e (patch) | |
tree | 5d7890959d1eaf5fb1cf6469a882499aff6489a8 /chrome/browser/ui/browser_init.cc | |
parent | a0e0a75aab7812c7683a571cd31e7fb7496dbdb3 (diff) | |
download | chromium_src-e95a993bd76e6bcd3417c97fd9c8a02c1d5ba35e.zip chromium_src-e95a993bd76e6bcd3417c97fd9c8a02c1d5ba35e.tar.gz chromium_src-e95a993bd76e6bcd3417c97fd9c8a02c1d5ba35e.tar.bz2 |
Implement pref policy for disabling incognito mode.
BUG=66413
TEST=None
Review URL: http://codereview.chromium.org/6313008
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@72624 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/ui/browser_init.cc')
-rw-r--r-- | chrome/browser/ui/browser_init.cc | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/chrome/browser/ui/browser_init.cc b/chrome/browser/ui/browser_init.cc index 6d93a53..d99c3df 100644 --- a/chrome/browser/ui/browser_init.cc +++ b/chrome/browser/ui/browser_init.cc @@ -370,7 +370,8 @@ SessionStartupPref GetSessionStartupPref(const CommandLine& command_line, if (command_line.HasSwitch(switches::kRestoreLastSession)) pref.type = SessionStartupPref::LAST; if (command_line.HasSwitch(switches::kIncognito) && - pref.type == SessionStartupPref::LAST) { + pref.type == SessionStartupPref::LAST && + profile->GetPrefs()->GetBoolean(prefs::kIncognitoEnabled)) { // We don't store session information when incognito. If the user has // chosen to restore last session and launched incognito, fallback to // default launch behavior. @@ -484,8 +485,10 @@ bool BrowserInit::LaunchBrowser(const CommandLine& command_line, #endif // Continue with the off-the-record profile from here on if --incognito - if (command_line.HasSwitch(switches::kIncognito)) + if (command_line.HasSwitch(switches::kIncognito) && + profile->GetPrefs()->GetBoolean(prefs::kIncognitoEnabled)) { profile = profile->GetOffTheRecordProfile(); + } BrowserInit::LaunchWithProfile lwp(cur_dir, command_line, this); bool launched = lwp.Launch(profile, process_startup); |