summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorivankr@chromium.org <ivankr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-01-23 20:37:42 +0000
committerivankr@chromium.org <ivankr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-01-23 20:37:42 +0000
commitccfbc867f99730047cc51a75a63395e1fa2c9deb (patch)
tree23e52a4aedd0298e6685c2226fa4bf5c1547126c
parent08bdf169df239148d30ff4c22dd6095b93b73834 (diff)
downloadchromium_src-ccfbc867f99730047cc51a75a63395e1fa2c9deb.zip
chromium_src-ccfbc867f99730047cc51a75a63395e1fa2c9deb.tar.gz
chromium_src-ccfbc867f99730047cc51a75a63395e1fa2c9deb.tar.bz2
Cleanup Protector switches and prefs.
*) Removed temporary 'protector.enabled' pref. *) Renamed --disable-protector back to --no-protector ("bad flag" on platforms other than ChromeOS). BUG=None TEST=Manual with and without --no-protector Review URL: http://codereview.chromium.org/9270041 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@118728 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/prefs/browser_prefs.cc2
-rw-r--r--chrome/browser/protector/protector_service.cc14
-rw-r--r--chrome/browser/protector/protector_service.h3
-rw-r--r--chrome/browser/ui/browser_init.cc6
-rw-r--r--chrome/common/chrome_switches.cc6
-rw-r--r--chrome/common/chrome_switches.h2
-rw-r--r--chrome/common/pref_names.cc5
-rw-r--r--chrome/common/pref_names.h2
8 files changed, 9 insertions, 31 deletions
diff --git a/chrome/browser/prefs/browser_prefs.cc b/chrome/browser/prefs/browser_prefs.cc
index 2f67d40..7a1c9ea 100644
--- a/chrome/browser/prefs/browser_prefs.cc
+++ b/chrome/browser/prefs/browser_prefs.cc
@@ -43,7 +43,6 @@
#include "chrome/browser/profiles/profile_impl.h"
#include "chrome/browser/profiles/profile_info_cache.h"
#include "chrome/browser/profiles/profile_manager.h"
-#include "chrome/browser/protector/protector_service.h"
#include "chrome/browser/renderer_host/web_cache_manager.h"
#include "chrome/browser/safe_browsing/safe_browsing_service.h"
#include "chrome/browser/search_engines/template_url_prepopulate_data.h"
@@ -147,7 +146,6 @@ void RegisterLocalState(PrefService* local_state) {
chromeos::ProxyConfigServiceImpl::RegisterPrefs(local_state);
policy::DeviceStatusCollector::RegisterPrefs(local_state);
#endif
- protector::RegisterPrefs(local_state);
}
void RegisterUserPrefs(PrefService* user_prefs) {
diff --git a/chrome/browser/protector/protector_service.cc b/chrome/browser/protector/protector_service.cc
index 6df0f38..2464c0e 100644
--- a/chrome/browser/protector/protector_service.cc
+++ b/chrome/browser/protector/protector_service.cc
@@ -125,20 +125,8 @@ bool IsSettingValid(const std::string& value, const std::string& signature) {
return hmac.Verify(value, signature);
}
-void RegisterPrefs(PrefService* prefs) {
- prefs->RegisterBooleanPref(prefs::kProtectorEnabled, false);
-}
-
bool IsEnabled() {
- if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kDisableProtector))
- return false;
-#if !defined(OS_CHROMEOS)
- // Protector is always enabled on platforms other than ChromeOS.
- return true;
-#else
- PrefService* local_state = g_browser_process->local_state();
- return local_state->GetBoolean(prefs::kProtectorEnabled);
-#endif
+ return !CommandLine::ForCurrentProcess()->HasSwitch(switches::kNoProtector);
}
} // namespace protector
diff --git a/chrome/browser/protector/protector_service.h b/chrome/browser/protector/protector_service.h
index 7d56166..28e1b6f 100644
--- a/chrome/browser/protector/protector_service.h
+++ b/chrome/browser/protector/protector_service.h
@@ -86,9 +86,6 @@ std::string SignSetting(const std::string& value);
// Returns true if the signature is valid for the specified key.
bool IsSettingValid(const std::string& value, const std::string& signature);
-// Register related preferences in Local State.
-void RegisterPrefs(PrefService* prefs);
-
// Whether the Protector feature is enabled.
bool IsEnabled();
diff --git a/chrome/browser/ui/browser_init.cc b/chrome/browser/ui/browser_init.cc
index 417793c..1996205 100644
--- a/chrome/browser/ui/browser_init.cc
+++ b/chrome/browser/ui/browser_init.cc
@@ -1246,8 +1246,10 @@ void BrowserInit::LaunchWithProfile::AddBadFlagsInfoBarIfNecessary(
switches::kSingleProcess,
switches::kNoSandbox,
switches::kInProcessWebGL,
- // This should only be used for tests.
- switches::kDisableProtector,
+ // This should only be used for tests and to disable Protector on ChromeOS.
+#if !defined(OS_CHROMEOS)
+ switches::kNoProtector,
+#endif
NULL
};
diff --git a/chrome/common/chrome_switches.cc b/chrome/common/chrome_switches.cc
index c9f3764..63988f8 100644
--- a/chrome/common/chrome_switches.cc
+++ b/chrome/common/chrome_switches.cc
@@ -336,9 +336,6 @@ const char kDisablePreconnect[] = "disable-preconnect";
// disable that check. This switch is used during automated testing.
const char kDisablePromptOnRepost[] = "disable-prompt-on-repost";
-// Disables the Protector feature.
-const char kDisableProtector[] = "disable-protector";
-
// Disables remote web font support. SVG font should always work whether this
// option is specified or not.
const char kDisableRemoteFonts[] = "disable-remote-fonts";
@@ -866,6 +863,9 @@ const char kNoFirstRun[] = "no-first-run";
// Don't send hyperlink auditing pings
const char kNoPings[] = "no-pings";
+// Disables the Protector feature.
+const char kNoProtector[] = "no-protector";
+
// Don't use a proxy server, always make direct connections. Overrides any
// other proxy server flags that are passed.
const char kNoProxyServer[] = "no-proxy-server";
diff --git a/chrome/common/chrome_switches.h b/chrome/common/chrome_switches.h
index 4415f09..efd81cb 100644
--- a/chrome/common/chrome_switches.h
+++ b/chrome/common/chrome_switches.h
@@ -98,7 +98,6 @@ extern const char kDisableIPv6[];
extern const char kDisableIPPooling[];
extern const char kDisablePreconnect[];
extern const char kDisablePromptOnRepost[];
-extern const char kDisableProtector[];
extern const char kDisableRemoteFonts[];
extern const char kDisableRestoreBackgroundContents[];
extern const char kDisableShortcutsProvider[];
@@ -238,6 +237,7 @@ extern const char kNoExperiments[];
extern const char kNoFirstRun[];
extern const char kNoProxyServer[];
extern const char kNoPings[];
+extern const char kNoProtector[];
extern const char kNoRunningInsecureContent[];
extern const char kNoServiceAutorun[];
extern const char kNoStartupWindow[];
diff --git a/chrome/common/pref_names.cc b/chrome/common/pref_names.cc
index 5327c70..98a8a0e 100644
--- a/chrome/common/pref_names.cc
+++ b/chrome/common/pref_names.cc
@@ -1730,9 +1730,4 @@ const char kRecoveryComponentVersion[] = "recovery_component.version";
// troubleshooting.
const char kComponentUpdaterState[] = "component_updater.state";
-// Set to true if Protector should be enabled.
-// TODO(ivankr): This is a temporary solution for testing and will be removed
-// soon.
-const char kProtectorEnabled[] = "protector.enabled";
-
} // namespace prefs
diff --git a/chrome/common/pref_names.h b/chrome/common/pref_names.h
index 8076ba6..5e2a545 100644
--- a/chrome/common/pref_names.h
+++ b/chrome/common/pref_names.h
@@ -648,8 +648,6 @@ extern const char kUserPolicyRefreshRate[];
extern const char kRecoveryComponentVersion[];
extern const char kComponentUpdaterState[];
-extern const char kProtectorEnabled[];
-
} // namespace prefs
#endif // CHROME_COMMON_PREF_NAMES_H_