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 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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::ResetToDefaults() { | 159 void NotificationProvider::ResetToDefaults() { |
160 ResetAllOrigins(); | 160 ResetAllOrigins(); |
161 } | 161 } |
162 | 162 |
| 163 void NotificationProvider::ShutdownOnUIThread() { |
| 164 } |
| 165 |
163 void NotificationProvider::Observe(NotificationType type, | 166 void NotificationProvider::Observe(NotificationType type, |
164 const NotificationSource& source, | 167 const NotificationSource& source, |
165 const NotificationDetails& details) { | 168 const NotificationDetails& details) { |
166 if (NotificationType::PREF_CHANGED == type) { | 169 if (NotificationType::PREF_CHANGED == type) { |
167 const std::string& name = *Details<std::string>(details).ptr(); | 170 const std::string& name = *Details<std::string>(details).ptr(); |
168 OnPrefsChanged(name); | 171 OnPrefsChanged(name); |
169 } else if (NotificationType::PROFILE_DESTROYED == type) { | 172 } else if (NotificationType::PROFILE_DESTROYED == type) { |
170 StopObserving(); | 173 StopObserving(); |
171 } | 174 } |
172 } | 175 } |
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
362 prefs->ScheduleSavePersistentPrefs(); | 365 prefs->ScheduleSavePersistentPrefs(); |
363 } | 366 } |
364 | 367 |
365 void NotificationProvider::ResetAllOrigins() { | 368 void NotificationProvider::ResetAllOrigins() { |
366 PrefService* prefs = profile_->GetPrefs(); | 369 PrefService* prefs = profile_->GetPrefs(); |
367 prefs->ClearPref(prefs::kDesktopNotificationAllowedOrigins); | 370 prefs->ClearPref(prefs::kDesktopNotificationAllowedOrigins); |
368 prefs->ClearPref(prefs::kDesktopNotificationDeniedOrigins); | 371 prefs->ClearPref(prefs::kDesktopNotificationDeniedOrigins); |
369 } | 372 } |
370 | 373 |
371 } // namespace content_settings | 374 } // namespace content_settings |
OLD | NEW |