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

Unified Diff: chrome/browser/subresource_filter/subresource_filter_content_settings_manager.cc

Issue 2877553002: [subresource_filter] Swap ALLOW and BLOCK meanings in the content setting (Closed)
Patch Set: fix newer tests Created 3 years, 7 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/subresource_filter/subresource_filter_content_settings_manager.cc
diff --git a/chrome/browser/subresource_filter/subresource_filter_content_settings_manager.cc b/chrome/browser/subresource_filter/subresource_filter_content_settings_manager.cc
index c74b94fbdbd399e271ddc66cecaf7d67aee85baf..1b574ce8f2b8bb9d8e58e8347bd2fd06e25a0cf8 100644
--- a/chrome/browser/subresource_filter/subresource_filter_content_settings_manager.cc
+++ b/chrome/browser/subresource_filter/subresource_filter_content_settings_manager.cc
@@ -81,8 +81,8 @@ void SubresourceFilterContentSettingsManager::WhitelistSite(const GURL& url) {
settings_map_->SetContentSettingDefaultScope(
url, GURL(),
ContentSettingsType::CONTENT_SETTINGS_TYPE_SUBRESOURCE_FILTER,
- std::string(), CONTENT_SETTING_BLOCK);
- ChromeSubresourceFilterClient::LogAction(kActionContentSettingsBlockedFromUI);
+ std::string(), CONTENT_SETTING_ALLOW);
+ ChromeSubresourceFilterClient::LogAction(kActionContentSettingsAllowedFromUI);
}
void SubresourceFilterContentSettingsManager::OnDidShowUI(const GURL& url) {
@@ -154,12 +154,12 @@ void SubresourceFilterContentSettingsManager::OnContentSettingChanged(
if (global_setting == cached_global_setting_for_metrics_)
return;
cached_global_setting_for_metrics_ = global_setting;
- if (global_setting == CONTENT_SETTING_BLOCK) {
- ChromeSubresourceFilterClient::LogAction(
- kActionContentSettingsBlockedGlobal);
- } else if (global_setting == CONTENT_SETTING_ALLOW) {
+ if (global_setting == CONTENT_SETTING_ALLOW) {
ChromeSubresourceFilterClient::LogAction(
kActionContentSettingsAllowedGlobal);
+ } else if (global_setting == CONTENT_SETTING_BLOCK) {
+ ChromeSubresourceFilterClient::LogAction(
+ kActionContentSettingsBlockedGlobal);
} else {
NOTREACHED();
}
@@ -183,17 +183,17 @@ void SubresourceFilterContentSettingsManager::OnContentSettingChanged(
ContentSetting setting = settings_map_->GetContentSetting(
url, url, ContentSettingsType::CONTENT_SETTINGS_TYPE_SUBRESOURCE_FILTER,
std::string());
- if (setting == CONTENT_SETTING_BLOCK) {
- ChromeSubresourceFilterClient::LogAction(kActionContentSettingsBlocked);
- } else if (setting == CONTENT_SETTING_ALLOW) {
+ if (setting == CONTENT_SETTING_ALLOW) {
ChromeSubresourceFilterClient::LogAction(kActionContentSettingsAllowed);
+ } else if (setting == CONTENT_SETTING_BLOCK) {
+ ChromeSubresourceFilterClient::LogAction(kActionContentSettingsBlocked);
} else {
NOTREACHED();
}
if (!ShouldShowUIForSite(url)) {
ChromeSubresourceFilterClient::LogAction(
- kActionContentSettingsBlockedWhileUISuppressed);
+ kActionContentSettingsAllowedWhileUISuppressed);
}
// Note: could potentially reset the smart UI here to enable the user to
// easily change their decision. If that code is added we should make sure not

Powered by Google App Engine
This is Rietveld 408576698