Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1615)

Unified Diff: chrome/browser/notifications/desktop_notification_service.cc

Issue 339077: Need to load the permissions lists every time at startup for notifications.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/notifications/notifications_prefs_cache.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/notifications/desktop_notification_service.cc
===================================================================
--- chrome/browser/notifications/desktop_notification_service.cc (revision 30470)
+++ chrome/browser/notifications/desktop_notification_service.cc (working copy)
@@ -153,20 +153,16 @@
// 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);
}
« no previous file with comments | « no previous file | chrome/browser/notifications/notifications_prefs_cache.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698