Bug 856202 - Alert service always cancels in Metro right away. r=wchen
--- a/toolkit/components/alerts/nsAlertsService.cpp
+++ b/toolkit/components/alerts/nsAlertsService.cpp
@@ -90,20 +90,19 @@ NS_IMETHODIMP nsAlertsService::ShowAlert
mozilla::AndroidBridge::Bridge()->ShowAlertNotification(aImageUrl, aAlertTitle, aAlertText, aAlertCookie,
aAlertListener, aAlertName);
return NS_OK;
#else
// Check if there is an optional service that handles system-level notifications
nsCOMPtr<nsIAlertsService> sysAlerts(do_GetService(NS_SYSTEMALERTSERVICE_CONTRACTID));
nsresult rv;
if (sysAlerts) {
- rv = sysAlerts->ShowAlertNotification(aImageUrl, aAlertTitle, aAlertText, aAlertTextClickable,
- aAlertCookie, aAlertListener, aAlertName,
- aBidi, aLang);
- NS_ENSURE_SUCCESS(rv, rv);
+ return sysAlerts->ShowAlertNotification(aImageUrl, aAlertTitle, aAlertText, aAlertTextClickable,
+ aAlertCookie, aAlertListener, aAlertName,
+ aBidi, aLang);
}
if (!ShouldShowAlert()) {
// Do not display the alert. Instead call alertfinished and get out.
if (aAlertListener)
aAlertListener->Observe(NULL, "alertfinished", PromiseFlatString(aAlertCookie).get());
return NS_OK;
}
@@ -127,18 +126,17 @@ NS_IMETHODIMP nsAlertsService::CloseAler
#ifdef MOZ_WIDGET_ANDROID
mozilla::AndroidBridge::Bridge()->CloseNotification(aAlertName);
return NS_OK;
#else
// Try the system notification service.
nsCOMPtr<nsIAlertsService> sysAlerts(do_GetService(NS_SYSTEMALERTSERVICE_CONTRACTID));
if (sysAlerts) {
- nsresult rv = sysAlerts->CloseAlert(aAlertName);
- NS_ENSURE_SUCCESS(rv, rv);
+ return sysAlerts->CloseAlert(aAlertName);
}
return mXULAlerts.CloseAlert(aAlertName);
#endif // !MOZ_WIDGET_ANDROID
}
NS_IMETHODIMP nsAlertsService::OnProgress(const nsAString & aAlertName,