Bug 669028 part.14 toolkit should use mozilla::LookAndFeel rather than nsILookAndFeel r=neil
authorMasayuki Nakano <masayuki@d-toybox.com>
Fri, 09 Sep 2011 11:27:13 +0900
changeset 76820 4a5d378339d95a1507fb498c69bd0caf265c8c50
parent 76819 8f20dc5f4c8fe4384be9f9dc9f04a01b3b8d3bd6
child 76821 fd52770098cae65b41c037ba6c5b9d136f95b22c
push id3
push userfelipc@gmail.com
push dateFri, 30 Sep 2011 20:09:13 +0000
reviewersneil
bugs669028
milestone9.0a1
Bug 669028 part.14 toolkit should use mozilla::LookAndFeel rather than nsILookAndFeel r=neil
toolkit/components/alerts/nsAlertsService.cpp
--- a/toolkit/components/alerts/nsAlertsService.cpp
+++ b/toolkit/components/alerts/nsAlertsService.cpp
@@ -49,26 +49,25 @@
 
 #include "nsISupportsArray.h"
 #include "nsXPCOM.h"
 #include "nsISupportsPrimitives.h"
 #include "nsIServiceManager.h"
 #include "nsIDOMWindow.h"
 #include "nsIWindowWatcher.h"
 #include "nsPromiseFlatString.h"
-#include "nsWidgetsCID.h"
-#include "nsILookAndFeel.h"
 #include "nsToolkitCompsCID.h"
-
-static NS_DEFINE_CID(kLookAndFeelCID, NS_LOOKANDFEEL_CID);
+#include "mozilla/LookAndFeel.h"
 
 #define ALERT_CHROME_URL "chrome://global/content/alerts/alert.xul"
 
 #endif // !ANDROID
 
+using namespace mozilla;
+
 using mozilla::dom::ContentChild;
 
 NS_IMPL_THREADSAFE_ISUPPORTS2(nsAlertsService, nsIAlertsService, nsIAlertsProgressListener)
 
 nsAlertsService::nsAlertsService()
 {
 }
 
@@ -151,24 +150,21 @@ NS_IMETHODIMP nsAlertsService::ShowAlert
   NS_ENSURE_TRUE(scriptableAlertCookie, NS_ERROR_FAILURE);
 
   scriptableAlertCookie->SetData(aAlertCookie);
   rv = argsArray->AppendElement(scriptableAlertCookie);
   NS_ENSURE_SUCCESS(rv, rv);
 
   nsCOMPtr<nsISupportsPRInt32> scriptableOrigin (do_CreateInstance(NS_SUPPORTS_PRINT32_CONTRACTID));
   NS_ENSURE_TRUE(scriptableOrigin, NS_ERROR_FAILURE);
-  nsCOMPtr<nsILookAndFeel> lookAndFeel = do_GetService("@mozilla.org/widget/lookandfeel;1");
-  if (lookAndFeel)
-  {
-    PRInt32 origin;
-    lookAndFeel->GetMetric(nsILookAndFeel::eMetric_AlertNotificationOrigin,
-                           origin);
-    scriptableOrigin->SetData(origin);
-  }
+
+  PRInt32 origin =
+    LookAndFeel::GetInt(LookAndFeel::eIntID_AlertNotificationOrigin);
+  scriptableOrigin->SetData(origin);
+
   rv = argsArray->AppendElement(scriptableOrigin);
   NS_ENSURE_SUCCESS(rv, rv);
 
   if (aAlertListener)
   {
     nsCOMPtr<nsISupportsInterfacePointer> ifptr = do_CreateInstance(NS_SUPPORTS_INTERFACE_POINTER_CONTRACTID, &rv);
     NS_ENSURE_SUCCESS(rv, rv);