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

Unified Diff: chrome/browser/notifications/message_center_settings_controller.cc

Issue 1694923004: Use GURLs instead of patterns in SetContentSetting in notifications (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@scoping_set_content_setting
Patch Set: minor change Created 4 years, 9 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/notifications/message_center_settings_controller.cc
diff --git a/chrome/browser/notifications/message_center_settings_controller.cc b/chrome/browser/notifications/message_center_settings_controller.cc
index e16109effebd6931280e14530242b4d4ef453c67..6eac09b551154cbd8003f8466a8e9f0278209b71 100644
--- a/chrome/browser/notifications/message_center_settings_controller.cc
+++ b/chrome/browser/notifications/message_center_settings_controller.cc
@@ -350,8 +350,16 @@ void MessageCenterSettingsController::SetNotifierEnabled(
<< notifier.notifier_id.url.spec();
}
- if (pattern.IsValid())
- DesktopNotificationProfileUtil::ClearSetting(profile, pattern);
+ if (pattern.IsValid()) {
+ // Note that we don't use DesktopNotificationProfileUtil::ClearSetting()
+ // here because pattern might be from user manual input and not match
+ // the default one used by ClearSetting().
+ HostContentSettingsMapFactory::GetForProfile(profile)
+ ->SetContentSetting(pattern, ContentSettingsPattern::Wildcard(),
+ CONTENT_SETTINGS_TYPE_NOTIFICATIONS,
+ content_settings::ResourceIdentifier(),
+ CONTENT_SETTING_DEFAULT);
+ }
}
} else {
NotifierStateTrackerFactory::GetForProfile(profile)

Powered by Google App Engine
This is Rietveld 408576698