Commit cdeadf44 authored by Xinghui Lu's avatar Xinghui Lu Committed by Commit Bot

Remove kSafeBrowsingRealTimeLookupEnabled policy.

This policy was added for Protego Enterprise but ended up not launched.

Bug: 1062064
Change-Id: Id37b20cb3517a070b0730e2828a794088f0b9f24
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2113693Reviewed-by: default avatarVarun Khaneja <vakh@chromium.org>
Commit-Queue: Xinghui Lu <xinghuilu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#752258}
parent 1034c088
......@@ -353,9 +353,6 @@ void SafeBrowsingService::OnProfileAdded(Profile* profile) {
registrar->Add(
prefs::kSafeBrowsingScoutReportingEnabled,
base::Bind(&SafeBrowsingService::RefreshState, base::Unretained(this)));
registrar->Add(
prefs::kSafeBrowsingRealTimeLookupEnabled,
base::Bind(&SafeBrowsingService::RefreshState, base::Unretained(this)));
prefs_map_[pref_service] = std::move(registrar);
RefreshState();
......
......@@ -107,8 +107,6 @@ const char kPasswordProtectionWarningTrigger[] =
"safebrowsing.password_protection_warning_trigger";
const char kAdvancedProtectionLastRefreshInUs[] =
"safebrowsing.advanced_protection_last_refresh";
const char kSafeBrowsingRealTimeLookupEnabled[] =
"safebrowsing.real_time_lookup_enabled";
const char kSafeBrowsingSendFilesForMalwareCheck[] =
"safebrowsing.send_files_for_malware_check";
const char kUnsafeEventsReportingEnabled[] =
......@@ -217,8 +215,6 @@ void RegisterProfilePrefs(PrefRegistrySimple* registry) {
registry->RegisterIntegerPref(prefs::kPasswordProtectionWarningTrigger,
PASSWORD_PROTECTION_OFF);
registry->RegisterInt64Pref(prefs::kAdvancedProtectionLastRefreshInUs, 0);
registry->RegisterBooleanPref(prefs::kSafeBrowsingRealTimeLookupEnabled,
false);
registry->RegisterIntegerPref(prefs::kSafeBrowsingSendFilesForMalwareCheck,
DO_NOT_SCAN);
registry->RegisterBooleanPref(prefs::kAdvancedProtectionAllowed, true);
......
......@@ -87,10 +87,6 @@ extern const char kPasswordProtectionWarningTrigger[];
// microseconds);
extern const char kAdvancedProtectionLastRefreshInUs[];
// Whether or not to check URLs in real time. This is configured by enterprise
// policy. For consumers, this pref is irrelevant.
extern const char kSafeBrowsingRealTimeLookupEnabled[];
// Whether or not to send downloads to Safe Browsing for deep scanning. This
// is configured by enterprise policy.
extern const char kSafeBrowsingSendFilesForMalwareCheck[];
......
......@@ -67,21 +67,12 @@ bool RealTimePolicyEngine::IsUserEpOptedIn(PrefService* pref_service) {
return IsEnhancedProtectionEnabled(*pref_service);
}
// static
// TODO(crbug.com/1050859): Remove this method.
bool RealTimePolicyEngine::IsEnabledByPolicy() {
return false;
}
// static
bool RealTimePolicyEngine::CanPerformFullURLLookup(PrefService* pref_service,
bool is_off_the_record) {
if (is_off_the_record)
return false;
if (IsEnabledByPolicy())
return true;
if (IsUrlLookupEnabledForEp() && IsUserEpOptedIn(pref_service))
return true;
......
......@@ -69,9 +69,6 @@ class RealTimePolicyEngine {
// Whether the user has opted-in to Enhanced Protection.
static bool IsUserEpOptedIn(PrefService* pref_service);
// Is the feature enabled due to enterprise policy?
static bool IsEnabledByPolicy();
friend class RealTimePolicyEngineTest;
}; // class RealTimePolicyEngine
......
......@@ -131,15 +131,6 @@ TEST_F(RealTimePolicyEngineTest,
}
#endif // defined(OS_ANDROID)
TEST_F(RealTimePolicyEngineTest, TestCanPerformFullURLLookup_EnabledByPolicy) {
base::test::ScopedFeatureList feature_list;
pref_service_.SetManagedPref(prefs::kSafeBrowsingRealTimeLookupEnabled,
std::make_unique<base::Value>(true));
// Verifies that setting the pref still doesn't enable the feature.
// See crbug.com/1030815 for details.
EXPECT_FALSE(CanPerformFullURLLookup(/* is_off_the_record */ false));
}
TEST_F(RealTimePolicyEngineTest,
TestCanPerformFullURLLookup_DisabledUrlLookup) {
base::test::ScopedFeatureList feature_list;
......@@ -150,8 +141,8 @@ TEST_F(RealTimePolicyEngineTest,
TEST_F(RealTimePolicyEngineTest,
TestCanPerformFullURLLookup_DisabledOffTheRecord) {
base::test::ScopedFeatureList feature_list;
pref_service_.SetManagedPref(prefs::kSafeBrowsingRealTimeLookupEnabled,
std::make_unique<base::Value>(true));
pref_service_.SetBoolean(prefs::kSafeBrowsingEnhanced, true);
feature_list.InitAndEnableFeature(kEnhancedProtection);
EXPECT_FALSE(CanPerformFullURLLookup(/* is_off_the_record */ true));
}
......
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