| 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 8aad111c45953db0e494dc0a949f165bfecd77c2..c74b94fbdbd399e271ddc66cecaf7d67aee85baf 100644
|
| --- a/chrome/browser/subresource_filter/subresource_filter_content_settings_manager.cc
|
| +++ b/chrome/browser/subresource_filter/subresource_filter_content_settings_manager.cc
|
| @@ -56,6 +56,9 @@ SubresourceFilterContentSettingsManager::
|
| profile, ServiceAccessType::EXPLICIT_ACCESS)) {
|
| history_observer_.Add(history_service);
|
| }
|
| +
|
| + cached_global_setting_for_metrics_ = settings_map_->GetDefaultContentSetting(
|
| + CONTENT_SETTINGS_TYPE_SUBRESOURCE_FILTER, nullptr);
|
| }
|
|
|
| SubresourceFilterContentSettingsManager::
|
| @@ -140,9 +143,17 @@ void SubresourceFilterContentSettingsManager::OnContentSettingChanged(
|
|
|
| const ContentSettingsDetails details(primary_pattern, secondary_pattern,
|
| content_type, resource_identifier);
|
| + DCHECK(!details.update_all_types());
|
| +
|
| if (details.update_all()) {
|
| ContentSetting global_setting = settings_map_->GetDefaultContentSetting(
|
| CONTENT_SETTINGS_TYPE_SUBRESOURCE_FILTER, nullptr);
|
| + // Ignore changes which retain the status quo. This also avoids logging
|
| + // metrics for changes which somehow notify this observer multiple times in
|
| + // a row. This shouldn't discount real user initiated changes.
|
| + 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);
|
|
|