epiphany r8643 - in branches/gnome-2-24: . embed/mozilla



Author: chpe
Date: Fri Dec 26 13:48:03 2008
New Revision: 8643
URL: http://svn.gnome.org/viewvc/epiphany?rev=8643&view=rev

Log:
Check for nsIDOMNSLocation.h, which was removed in gecko 1.9.1, and
adapt API use accordingly. Bug #565669.

Modified:
   branches/gnome-2-24/configure.ac
   branches/gnome-2-24/embed/mozilla/EphyBrowser.cpp

Modified: branches/gnome-2-24/configure.ac
==============================================================================
--- branches/gnome-2-24/configure.ac	(original)
+++ branches/gnome-2-24/configure.ac	Fri Dec 26 13:48:03 2008
@@ -393,6 +393,10 @@
 
 GECKO_CHECK_HEADERS([],[nsIBadCertListener.h],[have_nsibadcertlistener=yes],[have_nsibadcertlistener=no])
 
+# Check for nsIDOMNSLocation (removed in 1.9.1)
+
+GECKO_CHECK_HEADERS([],[nsIDOMNSLocation.h])
+
 # Check for nsIClientAuthUserDecision in nsIClientAuthDialogs.h
 
 GECKO_COMPILE_IFELSE([],

Modified: branches/gnome-2-24/embed/mozilla/EphyBrowser.cpp
==============================================================================
--- branches/gnome-2-24/embed/mozilla/EphyBrowser.cpp	(original)
+++ branches/gnome-2-24/embed/mozilla/EphyBrowser.cpp	Fri Dec 26 13:48:03 2008
@@ -66,7 +66,6 @@
 #include <nsIDOMWindow2.h>
 #include <nsIDOMXMLDocument.h>
 #include <nsIDOMLocation.h>
-#include <nsIDOMNSLocation.h>
 #include <nsIHistoryEntry.h>
 #include <nsIInterfaceRequestor.h>
 #include <nsIInterfaceRequestorUtils.h>
@@ -86,6 +85,10 @@
 #include <nsServiceManagerUtils.h>
 #include <nsCDefaultURIFixup.h>
 
+#ifdef HAVE_NSIDOMNSLOCATION_H
+#include <nsIDOMNSLocation.h>
+#endif
+
 #ifdef HAVE_MOZILLA_PSM
 #include <nsICertificateDialogs.h>
 #include <nsISSLStatus.h>
@@ -700,8 +703,10 @@
         if (NS_FAILED (rv))
             return NS_OK;
 
+#ifdef HAVE_NSIDOMNSLOCATION_H
         nsCOMPtr<nsIDOMNSLocation> domNSLocation (do_QueryInterface (domLocation));
         NS_ENSURE_TRUE (domNSLocation, NS_OK);
+#endif
 
         nsString locationHref;
         domLocation->GetHref (locationHref);
@@ -735,9 +740,14 @@
         PRBool exceptionAdded;
         params->GetExceptionAdded (&exceptionAdded);
         g_print ("exceptionAdded %d\n", exceptionAdded);
+
         if (exceptionAdded)
+#ifdef HAVE_NSIDOMNSLOCATION_H
                 return domNSLocation->Reload ();
-
+#else
+                /* Gecko >= 1.9.1 */
+                return domLocation->Reload (PR_TRUE);
+#endif
 
         return NS_OK;
 }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]