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

Unified Diff: chrome/browser/prefs/command_line_pref_store.cc

Issue 7520023: Converted IncognitoForced boolean policy into IncognitoModeAvailability enum policy. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Created 9 years, 5 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
Index: chrome/browser/prefs/command_line_pref_store.cc
diff --git a/chrome/browser/prefs/command_line_pref_store.cc b/chrome/browser/prefs/command_line_pref_store.cc
index a0e94dc94baa411d525df3319bace557d013930b..23014726dc62543c878d5a6a09a2195d52d4fbca 100644
--- a/chrome/browser/prefs/command_line_pref_store.cc
+++ b/chrome/browser/prefs/command_line_pref_store.cc
@@ -7,6 +7,7 @@
#include "base/logging.h"
#include "base/string_split.h"
#include "base/values.h"
+#include "chrome/browser/prefs/incognito_mode_availability_prefs.h"
#include "chrome/browser/prefs/proxy_config_dictionary.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/pref_names.h"
@@ -42,7 +43,6 @@ const CommandLinePrefStore::BooleanSwitchToPreferenceMapEntry
prefs::kWebKitAllowDisplayingInsecureContent, false },
{ switches::kAllowCrossOriginAuthPrompt,
prefs::kAllowCrossOriginAuthPrompt, true },
- { switches::kIncognito, prefs::kIncognitoForced, true },
};
CommandLinePrefStore::CommandLinePrefStore(const CommandLine* command_line)
@@ -51,6 +51,7 @@ CommandLinePrefStore::CommandLinePrefStore(const CommandLine* command_line)
ApplyProxyMode();
ValidateProxySwitches();
ApplySSLSwitches();
+ ApplyIncognitoSwitches();
}
CommandLinePrefStore::~CommandLinePrefStore() {}
@@ -124,3 +125,10 @@ void CommandLinePrefStore::ApplySSLSwitches() {
SetValue(prefs::kCipherSuiteBlacklist, list_value);
}
}
+
+void CommandLinePrefStore::ApplyIncognitoSwitches() {
+ if (command_line_->HasSwitch(switches::kIncognito)) {
+ SetValue(prefs::kIncognitoModeAvailability,
+ Value::CreateIntegerValue(IncognitoModeAvailabilityPrefs::FORCED));
Bernhard Bauer 2011/07/28 11:34:03 The --incognito flag opens the first window in inc
rustema 2011/07/29 06:49:23 This is now gone.
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698