[Bug 605370] Add Pref to disable desktop notifications r=jonas a=approval2.0

--HG--
extra : rebase_source : 9393634f3df2211feb932111ecf25765be233b59
This commit is contained in:
Doug Turner 2010-11-16 20:15:15 -08:00
parent 605fc517e6
commit e88fb00d51

View File

@ -181,6 +181,9 @@ nsDOMDesktopNotification::HandleAlertServiceNotification(const char *aTopic)
NS_IMETHODIMP
nsDOMDesktopNotification::Show()
{
if (nsContentUtils::GetBoolPref("notification.disabled", PR_FALSE))
return NS_OK;
// If we are in testing mode (running mochitests, for example)
// and we are suppose to allow requests, then just post an allow event.
if (nsContentUtils::GetBoolPref("notification.prompt.testing", PR_FALSE) &&