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 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 StopObserving(); | 169 StopObserving(); |
170 } | 170 } |
171 } | 171 } |
172 | 172 |
173 ///////////////////////////////////////////////////////////////////// | 173 ///////////////////////////////////////////////////////////////////// |
174 // Private | 174 // Private |
175 // | 175 // |
176 | 176 |
177 void NotificationProvider::StartObserving() { | 177 void NotificationProvider::StartObserving() { |
178 if (!profile_->IsOffTheRecord()) { | 178 if (!profile_->IsOffTheRecord()) { |
179 prefs_registrar_.Add(prefs::kDesktopNotificationDefaultContentSetting, | |
180 this); | |
181 prefs_registrar_.Add(prefs::kDesktopNotificationAllowedOrigins, this); | 179 prefs_registrar_.Add(prefs::kDesktopNotificationAllowedOrigins, this); |
182 prefs_registrar_.Add(prefs::kDesktopNotificationDeniedOrigins, this); | 180 prefs_registrar_.Add(prefs::kDesktopNotificationDeniedOrigins, this); |
183 | 181 |
184 notification_registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UNLOADED, | 182 notification_registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UNLOADED, |
185 NotificationService::AllSources()); | 183 NotificationService::AllSources()); |
186 } | 184 } |
187 | 185 |
188 notification_registrar_.Add(this, chrome::NOTIFICATION_PROFILE_DESTROYED, | 186 notification_registrar_.Add(this, chrome::NOTIFICATION_PROFILE_DESTROYED, |
189 Source<Profile>(profile_)); | 187 Source<Profile>(profile_)); |
190 } | 188 } |
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
361 prefs->ScheduleSavePersistentPrefs(); | 359 prefs->ScheduleSavePersistentPrefs(); |
362 } | 360 } |
363 | 361 |
364 void NotificationProvider::ResetAllOrigins() { | 362 void NotificationProvider::ResetAllOrigins() { |
365 PrefService* prefs = profile_->GetPrefs(); | 363 PrefService* prefs = profile_->GetPrefs(); |
366 prefs->ClearPref(prefs::kDesktopNotificationAllowedOrigins); | 364 prefs->ClearPref(prefs::kDesktopNotificationAllowedOrigins); |
367 prefs->ClearPref(prefs::kDesktopNotificationDeniedOrigins); | 365 prefs->ClearPref(prefs::kDesktopNotificationDeniedOrigins); |
368 } | 366 } |
369 | 367 |
370 } // namespace content_settings | 368 } // namespace content_settings |
OLD | NEW |