Print an error when trying to launch an incognito browser and incognito is disabled.

BUG=90759
TEST=Set the IncognitoEnabled policy to false. Start the browser with the --incognito switch. An error message should be displayed, and a normal browser is started.


Review URL: http://codereview.chromium.org/7562009

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@96039 0039d316-1c4b-4281-b951-d872f2087c98
parent 583fdb68
...@@ -549,6 +549,9 @@ bool BrowserInit::LaunchBrowser(const CommandLine& command_line, ...@@ -549,6 +549,9 @@ bool BrowserInit::LaunchBrowser(const CommandLine& command_line,
// is forced. // is forced.
if (IncognitoIsForced(command_line, profile->GetPrefs())) { if (IncognitoIsForced(command_line, profile->GetPrefs())) {
profile = profile->GetOffTheRecordProfile(); profile = profile->GetOffTheRecordProfile();
} else if (command_line.HasSwitch(switches::kIncognito)) {
LOG(WARNING) << "Incognito mode disabled by policy, launching a normal "
<< "browser session.";
} }
BrowserInit::LaunchWithProfile lwp(cur_dir, command_line, this); BrowserInit::LaunchWithProfile lwp(cur_dir, command_line, this);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment