diff options
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/browser/notifications/desktop_notification_service.cc | 7 | ||||
-rw-r--r-- | chrome/browser/notifications/desktop_notification_service.h | 3 | ||||
-rw-r--r-- | chrome/browser/options_util.cc | 2 |
3 files changed, 12 insertions, 0 deletions
diff --git a/chrome/browser/notifications/desktop_notification_service.cc b/chrome/browser/notifications/desktop_notification_service.cc index fd95141..a467697 100644 --- a/chrome/browser/notifications/desktop_notification_service.cc +++ b/chrome/browser/notifications/desktop_notification_service.cc @@ -418,6 +418,13 @@ void DesktopNotificationService::SetDefaultContentSetting( // The cache is updated through the notification observer. } +void DesktopNotificationService::ResetToDefaultContentSetting() { + DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI)); + + PrefService* prefs = profile_->GetPrefs(); + prefs->ClearPref(prefs::kDesktopNotificationDefaultContentSetting); +} + std::vector<GURL> DesktopNotificationService::GetAllowedOrigins() { std::vector<GURL> allowed_origins; PrefService* prefs = profile_->GetPrefs(); diff --git a/chrome/browser/notifications/desktop_notification_service.h b/chrome/browser/notifications/desktop_notification_service.h index 7a1bb0a..d1a4ccc 100644 --- a/chrome/browser/notifications/desktop_notification_service.h +++ b/chrome/browser/notifications/desktop_notification_service.h @@ -87,6 +87,9 @@ class DesktopNotificationService : public NotificationObserver { ContentSetting GetDefaultContentSetting(); void SetDefaultContentSetting(ContentSetting setting); + // NOTE: This should only be called on the UI thread. + void ResetToDefaultContentSetting(); + // Returns all origins that explicitly have been allowed. std::vector<GURL> GetAllowedOrigins(); diff --git a/chrome/browser/options_util.cc b/chrome/browser/options_util.cc index e63c66e..2b7dbf4 100644 --- a/chrome/browser/options_util.cc +++ b/chrome/browser/options_util.cc @@ -11,6 +11,7 @@ #include "chrome/browser/host_content_settings_map.h" #include "chrome/browser/host_zoom_map.h" #include "chrome/browser/metrics/metrics_service.h" +#include "chrome/browser/notifications/desktop_notification_service.h" #include "chrome/browser/prefs/pref_service.h" #include "chrome/browser/profile.h" #include "chrome/common/pref_names.h" @@ -73,6 +74,7 @@ void OptionsUtil::ResetToDefaults(Profile* profile) { profile->GetHostContentSettingsMap()->ResetToDefaults(); profile->GetGeolocationContentSettingsMap()->ResetToDefault(); profile->GetHostZoomMap()->ResetToDefaults(); + profile->GetDesktopNotificationService()->ResetToDefaultContentSetting(); for (size_t i = 0; i < arraysize(kUserPrefs); ++i) prefs->ClearPref(kUserPrefs[i]); |