Bug 1208295 - Dispatch notifications-open-settings upon receiving alertsettingscallback so UI can open notification settings. r=nsm

alertsettingscallback only goes to the single observer whereas notifications-open-settings goes through the global observer service.
This commit is contained in:
Matthew Noorenberghe 2015-09-25 13:18:29 -07:00
parent 44633993e7
commit 21a4142e43

View File

@ -1161,6 +1161,15 @@ NotificationObserver::Observe(nsISupports* aSubject, const char* aTopic,
}
permissionManager->RemoveFromPrincipal(mPrincipal, "desktop-notification");
return NS_OK;
} else if (!strcmp("alertsettingscallback", aTopic)) {
nsCOMPtr<nsIObserverService> obs = mozilla::services::GetObserverService();
if (!obs) {
return NS_ERROR_FAILURE;
}
// Notify other observers so they can show settings UI.
obs->NotifyObservers(mPrincipal, "notifications-open-settings", nullptr);
return NS_OK;
}
return mObserver->Observe(aSubject, aTopic, aData);