summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chrome/browser/notifications/desktop_notification_service.cc16
-rw-r--r--chrome/browser/notifications/notifications_prefs_cache.cc2
-rw-r--r--chrome/browser/notifications/notifications_prefs_cache.h2
3 files changed, 8 insertions, 12 deletions
diff --git a/chrome/browser/notifications/desktop_notification_service.cc b/chrome/browser/notifications/desktop_notification_service.cc
index 0df73d7..76a7bd9 100644
--- a/chrome/browser/notifications/desktop_notification_service.cc
+++ b/chrome/browser/notifications/desktop_notification_service.cc
@@ -153,20 +153,16 @@ DesktopNotificationService::~DesktopNotificationService() {
// create the preferences if they don't exist yet.
void DesktopNotificationService::InitPrefs() {
PrefService* prefs = profile_->GetPrefs();
- ListValue* allowed_sites = NULL;
- ListValue* denied_sites = NULL;
+ const ListValue* allowed_sites;
+ const ListValue* denied_sites;
- if (prefs->FindPreference(prefs::kDesktopNotificationAllowedOrigins))
- allowed_sites =
- prefs->GetMutableList(prefs::kDesktopNotificationAllowedOrigins);
- else
+ if (!prefs->FindPreference(prefs::kDesktopNotificationAllowedOrigins))
prefs->RegisterListPref(prefs::kDesktopNotificationAllowedOrigins);
+ allowed_sites = prefs->GetList(prefs::kDesktopNotificationAllowedOrigins);
- if (prefs->FindPreference(prefs::kDesktopNotificationDeniedOrigins))
- denied_sites =
- prefs->GetMutableList(prefs::kDesktopNotificationDeniedOrigins);
- else
+ if (!prefs->FindPreference(prefs::kDesktopNotificationDeniedOrigins))
prefs->RegisterListPref(prefs::kDesktopNotificationDeniedOrigins);
+ denied_sites = prefs->GetList(prefs::kDesktopNotificationDeniedOrigins);
prefs_cache_ = new NotificationsPrefsCache(allowed_sites, denied_sites);
}
diff --git a/chrome/browser/notifications/notifications_prefs_cache.cc b/chrome/browser/notifications/notifications_prefs_cache.cc
index c5663e4..3ff90d7 100644
--- a/chrome/browser/notifications/notifications_prefs_cache.cc
+++ b/chrome/browser/notifications/notifications_prefs_cache.cc
@@ -11,7 +11,7 @@
#include "webkit/api/public/WebNotificationPresenter.h"
NotificationsPrefsCache::NotificationsPrefsCache(
- ListValue* allowed, ListValue* denied) {
+ const ListValue* allowed, const ListValue* denied) {
ListValue::const_iterator i;
std::wstring origin;
if (allowed) {
diff --git a/chrome/browser/notifications/notifications_prefs_cache.h b/chrome/browser/notifications/notifications_prefs_cache.h
index e873da7..8edbc36 100644
--- a/chrome/browser/notifications/notifications_prefs_cache.h
+++ b/chrome/browser/notifications/notifications_prefs_cache.h
@@ -19,7 +19,7 @@ class ListValue;
class NotificationsPrefsCache :
public base::RefCountedThreadSafe<NotificationsPrefsCache> {
public:
- NotificationsPrefsCache(ListValue* allowed, ListValue* denied);
+ NotificationsPrefsCache(const ListValue* allowed, const ListValue* denied);
// Checks to see if a given origin has permission to create desktop
// notifications. Returns a constant from WebNotificationPresenter