| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 | 5 |
| 6 #include "chrome/browser/content_settings/content_settings_notification_provider
.h" | 6 #include "chrome/browser/content_settings/content_settings_notification_provider
.h" |
| 7 | 7 |
| 8 #include "base/string_util.h" | 8 #include "base/string_util.h" |
| 9 #include "chrome/browser/notifications/desktop_notification_service_factory.h" | 9 #include "chrome/browser/notifications/desktop_notification_service_factory.h" |
| 10 #include "chrome/browser/notifications/notification.h" | 10 #include "chrome/browser/notifications/notification.h" |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 CONTENT_SETTING_BLOCK)); | 149 CONTENT_SETTING_BLOCK)); |
| 150 } | 150 } |
| 151 } | 151 } |
| 152 | 152 |
| 153 void NotificationProvider::ClearAllContentSettingsRules( | 153 void NotificationProvider::ClearAllContentSettingsRules( |
| 154 ContentSettingsType content_type) { | 154 ContentSettingsType content_type) { |
| 155 if (content_type == CONTENT_SETTINGS_TYPE_NOTIFICATIONS) | 155 if (content_type == CONTENT_SETTINGS_TYPE_NOTIFICATIONS) |
| 156 ResetAllOrigins(); | 156 ResetAllOrigins(); |
| 157 } | 157 } |
| 158 | 158 |
| 159 void NotificationProvider::ShutdownOnUIThread() { |
| 160 } |
| 161 |
| 159 void NotificationProvider::Observe(NotificationType type, | 162 void NotificationProvider::Observe(NotificationType type, |
| 160 const NotificationSource& source, | 163 const NotificationSource& source, |
| 161 const NotificationDetails& details) { | 164 const NotificationDetails& details) { |
| 162 if (NotificationType::PREF_CHANGED == type) { | 165 if (NotificationType::PREF_CHANGED == type) { |
| 163 const std::string& name = *Details<std::string>(details).ptr(); | 166 const std::string& name = *Details<std::string>(details).ptr(); |
| 164 OnPrefsChanged(name); | 167 OnPrefsChanged(name); |
| 165 } else if (NotificationType::PROFILE_DESTROYED == type) { | 168 } else if (NotificationType::PROFILE_DESTROYED == type) { |
| 166 StopObserving(); | 169 StopObserving(); |
| 167 } | 170 } |
| 168 } | 171 } |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 358 prefs->ScheduleSavePersistentPrefs(); | 361 prefs->ScheduleSavePersistentPrefs(); |
| 359 } | 362 } |
| 360 | 363 |
| 361 void NotificationProvider::ResetAllOrigins() { | 364 void NotificationProvider::ResetAllOrigins() { |
| 362 PrefService* prefs = profile_->GetPrefs(); | 365 PrefService* prefs = profile_->GetPrefs(); |
| 363 prefs->ClearPref(prefs::kDesktopNotificationAllowedOrigins); | 366 prefs->ClearPref(prefs::kDesktopNotificationAllowedOrigins); |
| 364 prefs->ClearPref(prefs::kDesktopNotificationDeniedOrigins); | 367 prefs->ClearPref(prefs::kDesktopNotificationDeniedOrigins); |
| 365 } | 368 } |
| 366 | 369 |
| 367 } // namespace content_settings | 370 } // namespace content_settings |
| OLD | NEW |