Bug 856202 - Alert service always cancels in Metro right away. r=wchen
authorBrian R. Bondy <netzen@gmail.com>
Mon, 08 Apr 2013 20:39:55 -0400
changeset 134859 f49cb7d4b7363c20bcd69eeea05aa156c5c15a1f
parent 134858 b85fe1022f984cf306bb59f1319c246d7cd01735
child 134860 a56bbca40488d3819ee7959b5741be5db8214602
push idunknown
push userunknown
push dateunknown
reviewerswchen
bugs856202
milestone23.0a1
Bug 856202 - Alert service always cancels in Metro right away. r=wchen
toolkit/components/alerts/nsAlertsService.cpp
--- 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,