Bug 792793 - Remove growl support from comm-central, r=irving, a=bustage-fix on CLOSED TREE.
authorFlorian Quèze <florian@queze.net>
Thu, 20 Sep 2012 17:17:49 +0200
changeset 11093 30465284129e0bf9bf8f9df9bf342911d94bcb60
parent 11092 712bbc279ec6a821ceecf8d49685f4ccd1a9e54b
child 11094 410b8317fa4eed449e65e63e871babacbbab18a1
push id8321
push userflorian@queze.net
push dateThu, 20 Sep 2012 15:18:09 +0000
treeherdercomm-central@30465284129e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersirving, bustage-fix
bugs792793
Bug 792793 - Remove growl support from comm-central, r=irving, a=bustage-fix on CLOSED TREE.
mail/locales/en-US/chrome/messenger/messenger.properties
mailnews/base/src/nsMessengerOSXIntegration.mm
suite/locales/en-US/chrome/mailnews/messenger.properties
--- a/mail/locales/en-US/chrome/messenger/messenger.properties
+++ b/mail/locales/en-US/chrome/messenger/messenger.properties
@@ -470,19 +470,16 @@ copyToFolderAgainAccessKey=t
 #LOCALIZATION NOTE %1$S is the e-mail address of the person we will allow remote content for
 alwaysLoadRemoteContentForSender2= Always load remote content from %1$S
 
 #LOCALIZATION NOTE(mdnBarMessageNormal) %1$S is the name of the sender
 mdnBarMessageNormal=%1$S has asked to be notified when you read this message.
 #LOCALIZATION NOTE(mdnBarMessageAddressDiffers) %1$S is the name of the sender, %2$S is the address(es) to send return receipt to
 mdnBarMessageAddressDiffers=%1$S has asked to be notified (on %2$S) when you read this message.
 
-# Strings for growl notifications on Mac OS X
-growlNotification=New Mail
-
 # mailCommands.js
 emptyJunkTitle=Confirm
 emptyJunkMessage=Are you sure you want to permanently delete all messages and subfolders in the Junk folder?
 emptyJunkDontAsk=Don't ask me again.
 emptyTrashTitle=Confirm
 emptyTrashMessage=Are you sure you want to permanently delete all messages and subfolders in the Trash folder?
 emptyTrashDontAsk=Don't ask me again.
 
--- a/mailnews/base/src/nsMessengerOSXIntegration.mm
+++ b/mailnews/base/src/nsMessengerOSXIntegration.mm
@@ -32,17 +32,16 @@
 #include "nsIPrefService.h"
 #include "nsIPrefBranch.h"
 #include "nsIMessengerWindowService.h"
 #include "prprf.h"
 #include "prlog.h"
 #include "nsIAlertsService.h"
 #include "nsIStringBundle.h"
 #include "nsToolkitCompsCID.h"
-#include "nsINotificationsList.h"
 #include "nsIMsgDatabase.h"
 #include "nsIMsgHdr.h"
 #include "nsIMsgHeaderParser.h"
 #include "nsISupportsPrimitives.h"
 #include "nsIWindowWatcher.h"
 #include "nsMsgLocalCID.h"
 #include "nsIMsgMailNewsUrl.h"
 #include "nsIMsgWindow.h"
@@ -185,21 +184,19 @@ NS_INTERFACE_MAP_BEGIN(nsMessengerOSXInt
    NS_INTERFACE_MAP_ENTRY(nsIObserver)
    NS_INTERFACE_MAP_ENTRY(mozINewMailListener)
 NS_INTERFACE_MAP_END
 
 
 nsresult
 nsMessengerOSXIntegration::Init()
 {
-  // need to register a named Growl notification
   nsresult rv;
   nsCOMPtr<nsIObserverService> observerService = do_GetService("@mozilla.org/observer-service;1", &rv);
   NS_ENSURE_SUCCESS(rv, rv);
-  observerService->AddObserver(this, "before-growl-registration", false);
   return observerService->AddObserver(this, "mail-startup-done", false);
 }
 
 NS_IMETHODIMP
 nsMessengerOSXIntegration::OnItemPropertyChanged(nsIMsgFolder *, nsIAtom *, char const *, char const *)
 {
   return NS_OK;
 }
@@ -255,38 +252,16 @@ nsMessengerOSXIntegration::Observe(nsISu
     // register with the mail sesson for folder events
     // we care about new count, biff status
     nsCOMPtr<nsIMsgMailSession> mailSession = do_GetService(NS_MSGMAILSESSION_CONTRACTID, &rv);
     NS_ENSURE_SUCCESS(rv, rv);
 
     return mailSession->AddFolderListener(this, nsIFolderListener::boolPropertyChanged | nsIFolderListener::intPropertyChanged);
   }
 
-  // register named Growl notification for new mail alerts.
-  if (!strcmp(aTopic, "before-growl-registration"))
-  {
-    nsresult rv;
-    nsCOMPtr<nsIObserverService> observerService = do_GetService("@mozilla.org/observer-service;1", &rv);
-    if (NS_SUCCEEDED(rv))
-      observerService->RemoveObserver(this, "before-growl-registration");
-
-    nsCOMPtr<nsINotificationsList> notifications = do_QueryInterface(aSubject, &rv);
-    if (NS_SUCCEEDED(rv))
-    {
-      nsCOMPtr<nsIStringBundle> bundle;
-      GetStringBundle(getter_AddRefs(bundle));
-      if (bundle)
-      {
-        nsString growlNotification;
-        bundle->GetStringFromName(NS_LITERAL_STRING("growlNotification").get(), getter_Copies(growlNotification));
-        notifications->AddNotification(growlNotification, true);
-      }
-    }
-  }
-
   if (!strcmp(aTopic, kNewChatMessageTopic)) {
     // We don't have to bother about checking if the window is already focused
     // before attempting to bounce the dock icon, as BounceDockIcon is
     // implemented by a getAttention call which won't do anything if the window
     // requesting attention is already focused.
     return BounceDockIcon();
   }
 
@@ -409,35 +384,24 @@ nsMessengerOSXIntegration::ShowAlertMess
   nsCOMPtr<nsIPrefBranch> prefBranch(do_GetService(NS_PREFSERVICE_CONTRACTID, &rv));
   NS_ENSURE_SUCCESS(rv, rv);
 
   bool showAlert = true;
   prefBranch->GetBoolPref(kBiffShowAlertPref, &showAlert);
 
   if (showAlert)
   {
-    // Use growl if installed
     nsCOMPtr<nsIAlertsService> alertsService (do_GetService(NS_ALERTSERVICE_CONTRACTID, &rv));
+    // If we have an nsIAlertsService implementation, use it:
     if (NS_SUCCEEDED(rv))
     {
-      nsCOMPtr<nsIStringBundle> bundle;
-      GetStringBundle(getter_AddRefs(bundle));
-      if (bundle)
-      {
-        nsString growlNotification;
-        bundle->GetStringFromName(NS_LITERAL_STRING("growlNotification").get(),
-                                  getter_Copies(growlNotification));
-        rv = alertsService->ShowAlertNotification(NS_LITERAL_STRING(kNewMailAlertIcon),
-                                                  aAlertTitle,
-                                                  aAlertText,
-                                                  true,
-                                                  NS_ConvertASCIItoUTF16(aFolderURI),
-                                                  this,
-                                                  growlNotification);
-      }
+      alertsService->ShowAlertNotification(NS_LITERAL_STRING(kNewMailAlertIcon),
+                                           aAlertTitle, aAlertText, true,
+                                           NS_ConvertASCIItoUTF16(aFolderURI),
+                                           this, EmptyString());
     }
 
     BounceDockIcon();
   }
 
   if (!showAlert || NS_FAILED(rv))
     OnAlertFinished();
 
--- a/suite/locales/en-US/chrome/mailnews/messenger.properties
+++ b/suite/locales/en-US/chrome/mailnews/messenger.properties
@@ -385,19 +385,16 @@ confirmPhishingUrl2=%1$S thinks this web
 #LOCALIZATION NOTE %1$S is the e-mail address of the person we will allow remote content for
 alwaysLoadRemoteContentForSender=Click here to always load remote content from %1$S.
 
 #LOCALIZATION NOTE(mdnBarMessageNormal) %1$S is the name of the sender
 mdnBarMessageNormal=%1$S has asked to be notified when you read this message.
 #LOCALIZATION NOTE(mdnBarMessageAddressDiffers) %1$S is the name of the sender, %2$S is the address(es) to send return receipt to
 mdnBarMessageAddressDiffers=%1$S has asked to be notified at %2$S when you read this message.
 
-# Strings for growl notifications on Mac OS X
-growlNotification=New Mail
-
 # mailCommands.js
 emptyJunkTitle=Confirm
 emptyJunkMessage=Are you sure you want to permanently delete all messages and subfolders in the Junk folder?
 emptyJunkDontAsk=Don't ask me again.
 emptyTrashTitle=Confirm
 emptyTrashMessage=Are you sure you want to permanently delete all messages and subfolders in the Trash folder?
 emptyTrashDontAsk=Don't ask me again.