summaryrefslogtreecommitdiffstats
path: root/chrome/browser/ui
diff options
context:
space:
mode:
authorfinnur@chromium.org <finnur@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-26 11:16:00 +0000
committerfinnur@chromium.org <finnur@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-26 11:16:00 +0000
commit40d6b8e139502c09d82be26ae122b630216fec16 (patch)
tree9d302c977e5f69def628a0b98acd9ac53b611a6d /chrome/browser/ui
parent3742f8567ec76ae30eb2731744920a0c5f97b94d (diff)
downloadchromium_src-40d6b8e139502c09d82be26ae122b630216fec16.zip
chromium_src-40d6b8e139502c09d82be26ae122b630216fec16.tar.gz
chromium_src-40d6b8e139502c09d82be26ae122b630216fec16.tar.bz2
Revert 72624 (due to crashes) - Implement pref policy for disabling incognito mode.
BUG=66413 TEST=None Review URL: http://codereview.chromium.org/6313008 TBR=finnur@chromium.org Review URL: http://codereview.chromium.org/6399001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@72630 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/ui')
-rw-r--r--chrome/browser/ui/browser.cc16
-rw-r--r--chrome/browser/ui/browser.h3
-rw-r--r--chrome/browser/ui/browser_init.cc7
3 files changed, 5 insertions, 21 deletions
diff --git a/chrome/browser/ui/browser.cc b/chrome/browser/ui/browser.cc
index 03ee5e1..c95aa7d 100644
--- a/chrome/browser/ui/browser.cc
+++ b/chrome/browser/ui/browser.cc
@@ -223,8 +223,6 @@ Browser::Browser(Type type, Profile* profile)
printing_enabled_.Init(prefs::kPrintingEnabled, local_state, this);
dev_tools_disabled_.Init(prefs::kDevToolsDisabled,
profile_->GetPrefs(), this);
- incognito_mode_allowed_.Init(prefs::kIncognitoEnabled,
- profile_->GetPrefs(), this);
InitCommandState();
BrowserList::AddBrowser(this);
@@ -1307,8 +1305,7 @@ void Browser::Stop() {
void Browser::NewWindow() {
if (browser_defaults::kAlwaysOpenIncognitoWindow &&
- CommandLine::ForCurrentProcess()->HasSwitch(switches::kIncognito) &&
- incognito_mode_allowed_.GetValue()) {
+ CommandLine::ForCurrentProcess()->HasSwitch(switches::kIncognito)) {
NewIncognitoWindow();
return;
}
@@ -1322,11 +1319,6 @@ void Browser::NewWindow() {
}
void Browser::NewIncognitoWindow() {
- if (!incognito_mode_allowed_.GetValue()) {
- NewWindow();
- return;
- }
-
UserMetrics::RecordAction(UserMetricsAction("NewIncognitoWindow"), profile_);
Browser::OpenEmptyWindow(profile_->GetOffTheRecordProfile());
}
@@ -1950,7 +1942,7 @@ void Browser::OpenLanguageOptionsDialog() {
switches::kDisableTabbedOptions)) {
ShowOptionsTab(chrome::kLanguageOptionsSubPage);
} else {
- // Language options dialog has been replaced by DOMUI.
+ // Language options dialog has been replaced by DOMUI.
}
}
@@ -2046,7 +2038,6 @@ void Browser::RegisterUserPrefs(PrefService* prefs) {
prefs->RegisterBooleanPref(prefs::kRemotingHasSetupCompleted, false);
prefs->RegisterStringPref(prefs::kCloudPrintEmail, std::string());
prefs->RegisterBooleanPref(prefs::kDevToolsDisabled, false);
- prefs->RegisterBooleanPref(prefs::kIncognitoEnabled, true);
prefs->RegisterRealPref(prefs::kDefaultZoomLevel, 0.0);
prefs->RegisterIntegerPref(prefs::kMultipleProfilePrefMigration, 0);
// We need to register the type of this preference in order to query
@@ -3450,8 +3441,7 @@ void Browser::InitCommandState() {
// Window management commands
command_updater_.UpdateCommandEnabled(IDC_NEW_WINDOW, true);
- command_updater_.UpdateCommandEnabled(IDC_NEW_INCOGNITO_WINDOW,
- incognito_mode_allowed_.GetValue());
+ command_updater_.UpdateCommandEnabled(IDC_NEW_INCOGNITO_WINDOW, true);
command_updater_.UpdateCommandEnabled(IDC_CLOSE_WINDOW, true);
command_updater_.UpdateCommandEnabled(IDC_NEW_TAB, true);
command_updater_.UpdateCommandEnabled(IDC_CLOSE_TAB, true);
diff --git a/chrome/browser/ui/browser.h b/chrome/browser/ui/browser.h
index 0ab7df6..d59030e 100644
--- a/chrome/browser/ui/browser.h
+++ b/chrome/browser/ui/browser.h
@@ -1112,9 +1112,6 @@ class Browser : public TabHandlerDelegate,
// Keep track of when instant enabled changes.
BooleanPrefMember instant_enabled_;
- // Tracks the preference that controls whether incognito mode is allowed.
- BooleanPrefMember incognito_mode_allowed_;
-
// Indicates if command execution is blocked.
bool block_command_execution_;
diff --git a/chrome/browser/ui/browser_init.cc b/chrome/browser/ui/browser_init.cc
index d99c3df..6d93a53 100644
--- a/chrome/browser/ui/browser_init.cc
+++ b/chrome/browser/ui/browser_init.cc
@@ -370,8 +370,7 @@ 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 &&
- profile->GetPrefs()->GetBoolean(prefs::kIncognitoEnabled)) {
+ pref.type == SessionStartupPref::LAST) {
// 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.
@@ -485,10 +484,8 @@ 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) &&
- profile->GetPrefs()->GetBoolean(prefs::kIncognitoEnabled)) {
+ if (command_line.HasSwitch(switches::kIncognito))
profile = profile->GetOffTheRecordProfile();
- }
BrowserInit::LaunchWithProfile lwp(cur_dir, command_line, this);
bool launched = lwp.Launch(profile, process_startup);