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

Unified Diff: chrome/browser/ui/browser_init.cc

Issue 6279012: Implement pref policy for disabling incognito mode.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 11 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/ui/browser.cc ('k') | chrome/common/policy_constants.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/browser_init.cc
===================================================================
--- chrome/browser/ui/browser_init.cc (revision 72634)
+++ chrome/browser/ui/browser_init.cc (working copy)
@@ -370,7 +370,8 @@
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 @@
#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);
« no previous file with comments | « chrome/browser/ui/browser.cc ('k') | chrome/common/policy_constants.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698