Bug 879746 - Port GTK2 to GTK3 - uriloader fixes. r=karlt
authorMartin Stransky <stransky@redhat.com>
Mon, 10 Jun 2013 08:36:26 -0400
changeset 146000 0cb9ae85c68705aa7c9ce36a8d62b351fb74bda7
parent 145999 9aeae1c96b26041633d69468eb7cbff68628abe5
child 146001 6b0d5080b1d605dbcdecaa641e64906f4a59494e
push id2697
push userbbajaj@mozilla.com
push dateMon, 05 Aug 2013 18:49:53 +0000
treeherdermozilla-beta@dfec938c7b63 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskarlt
bugs879746
milestone24.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 879746 - Port GTK2 to GTK3 - uriloader fixes. r=karlt
uriloader/exthandler/Makefile.in
uriloader/exthandler/moz.build
uriloader/exthandler/tests/Makefile.in
uriloader/exthandler/unix/nsGNOMERegistry.cpp
uriloader/exthandler/unix/nsOSHelperAppService.cpp
--- a/uriloader/exthandler/Makefile.in
+++ b/uriloader/exthandler/Makefile.in
@@ -85,11 +85,11 @@ EXTRA_COMPONENTS = \
 
 # we don't want the shared lib, but we want to force the creation of a static lib.
 FORCE_STATIC_LIB = 1
 SRCS_IN_OBJDIR	= 1
 include $(topsrcdir)/config/config.mk
 include $(topsrcdir)/ipc/chromium/chromium-config.mk
 include $(topsrcdir)/config/rules.mk
 
-ifneq (,$(filter qt gtk2, $(MOZ_WIDGET_TOOLKIT)))
+ifneq (,$(filter qt gtk2 gtk3, $(MOZ_WIDGET_TOOLKIT)))
 CXXFLAGS += $(TK_CFLAGS) $(MOZ_DBUS_GLIB_CFLAGS)
 endif
--- a/uriloader/exthandler/moz.build
+++ b/uriloader/exthandler/moz.build
@@ -66,17 +66,17 @@ CPP_SOURCES += [
 if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa':
     # TODO: CMMSRCS go here
     pass
 else:
     CPP_SOURCES += [
         'nsOSHelperAppService.cpp',
     ]
 
-if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk2':
+if CONFIG['MOZ_ENABLE_GTK']:
     CPP_SOURCES += [
         'nsGNOMERegistry.cpp',
         'nsMIMEInfoUnix.cpp',
     ]
 elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'android':
     CPP_SOURCES += [
         'nsMIMEInfoAndroid.cpp',
         'nsAndroidHandlerApp.cpp',
--- a/uriloader/exthandler/tests/Makefile.in
+++ b/uriloader/exthandler/tests/Makefile.in
@@ -17,17 +17,17 @@ SIMPLE_PROGRAMS = $(CPPSRCS:.cpp=$(BIN_S
 include $(topsrcdir)/config/config.mk
 
 LIBS +=		\
 		$(NSPR_LIBS) \
 		$(NULL)
 
 include $(topsrcdir)/config/rules.mk
 
-ifeq ($(MOZ_WIDGET_TOOLKIT),gtk2)
+ifdef MOZ_WIDGET_GTK
 export PERSONAL_MAILCAP=$(call core_abspath,$(srcdir))/mailcap
 endif
 
 # need the executable for running the xpcshell unit tests
 ifneq (,$(SIMPLE_PROGRAMS))
 libs::
 	$(INSTALL) $(SIMPLE_PROGRAMS) $(DEPTH)/_tests/xpcshell/$(relativesrcdir)/unit
 endif
--- a/uriloader/exthandler/unix/nsGNOMERegistry.cpp
+++ b/uriloader/exthandler/unix/nsGNOMERegistry.cpp
@@ -8,17 +8,17 @@
 #include "nsIComponentManager.h"
 #include "nsIFile.h"
 #include "nsMIMEInfoUnix.h"
 #include "nsAutoPtr.h"
 #include "nsIGConfService.h"
 #include "nsIGnomeVFSService.h"
 #include "nsIGIOService.h"
 
-#ifdef MOZ_WIDGET_GTK2
+#ifdef MOZ_WIDGET_GTK
 #include <glib.h>
 #include <glib-object.h>
 #endif
 
 #ifdef MOZ_PLATFORM_MAEMO
 #include <libintl.h>
 #endif
 
--- a/uriloader/exthandler/unix/nsOSHelperAppService.cpp
+++ b/uriloader/exthandler/unix/nsOSHelperAppService.cpp
@@ -9,17 +9,17 @@
 
 #if defined(MOZ_ENABLE_CONTENTACTION)
 #include <contentaction/contentaction.h>
 #include <QString>
 #endif
 
 #include "nsOSHelperAppService.h"
 #include "nsMIMEInfoUnix.h"
-#ifdef MOZ_WIDGET_GTK2
+#ifdef MOZ_WIDGET_GTK
 #include "nsGNOMERegistry.h"
 #endif
 #include "nsISupports.h"
 #include "nsString.h"
 #include "nsReadableUtils.h"
 #include "nsUnicharUtils.h"
 #include "nsXPIDLString.h"
 #include "nsIURL.h"
@@ -1155,30 +1155,30 @@ nsresult nsOSHelperAppService::OSProtoco
   // libcontentaction requires character ':' after scheme
   ContentAction::Action action =
     ContentAction::Action::defaultActionForScheme(QString(aProtocolScheme) + ':');
 
   if (action.isValid())
     *aHandlerExists = true;
 #endif
 
-#ifdef MOZ_WIDGET_GTK2
+#ifdef MOZ_WIDGET_GTK
   // Check the GConf registry for a protocol handler
   *aHandlerExists = nsGNOMERegistry::HandlerExists(aProtocolScheme);
 #if (MOZ_PLATFORM_MAEMO == 5) && defined (MOZ_ENABLE_GNOMEVFS)
   *aHandlerExists = nsMIMEInfoUnix::HandlerExists(aProtocolScheme);
 #endif
 #endif
 
   return NS_OK;
 }
 
 NS_IMETHODIMP nsOSHelperAppService::GetApplicationDescription(const nsACString& aScheme, nsAString& _retval)
 {
-#ifdef MOZ_WIDGET_GTK2
+#ifdef MOZ_WIDGET_GTK
   nsGNOMERegistry::GetAppDescForScheme(aScheme, _retval);
   return _retval.IsEmpty() ? NS_ERROR_NOT_AVAILABLE : NS_OK;
 #else
   return NS_ERROR_NOT_AVAILABLE;
 #endif
 }
 
 nsresult nsOSHelperAppService::GetFileTokenForPath(const PRUnichar * platformAppPath, nsIFile ** aFile)
@@ -1263,17 +1263,17 @@ nsOSHelperAppService::GetFromExtension(c
   nsresult rv = LookUpTypeAndDescription(NS_ConvertUTF8toUTF16(aFileExt),
                                          majorType,
                                          minorType,
                                          mime_types_description,
                                          true);
 
   if (NS_FAILED(rv) || majorType.IsEmpty()) {
     
-#ifdef MOZ_WIDGET_GTK2
+#ifdef MOZ_WIDGET_GTK
     LOG(("Looking in GNOME registry\n"));
     nsRefPtr<nsMIMEInfoBase> gnomeInfo =
       nsGNOMERegistry::GetFromExtension(aFileExt);
     if (gnomeInfo) {
       LOG(("Got MIMEInfo from GNOME registry\n"));
       return gnomeInfo.forget();
     }
 #endif
@@ -1381,17 +1381,17 @@ nsOSHelperAppService::GetFromType(const 
                                 mailcap_description,
                                 mozillaFlags,
                                 true);
   
   LOG(("Private Handler/Description results:  handler='%s', description='%s'\n",
           NS_LossyConvertUTF16toASCII(handler).get(),
           NS_LossyConvertUTF16toASCII(mailcap_description).get()));
 
-#ifdef MOZ_WIDGET_GTK2
+#ifdef MOZ_WIDGET_GTK
   nsRefPtr<nsMIMEInfoBase> gnomeInfo;
   if (handler.IsEmpty()) {
     // No useful data yet.  Check the GNOME registry.  Unfortunately, newer
     // GNOME versions no longer have type-to-extension mappings, so we might
     // get back a MIMEInfo without any extensions set.  In that case we'll have
     // to look in our mime.types files for the extensions.    
     LOG(("Looking in GNOME registry\n"));
     gnomeInfo = nsGNOMERegistry::GetFromType(aMIMEType);
@@ -1404,17 +1404,17 @@ nsOSHelperAppService::GetFromType(const 
 
   // Now look up our extensions
   nsAutoString extensions, mime_types_description;
   LookUpExtensionsAndDescription(majorType,
                                  minorType,
                                  extensions,
                                  mime_types_description);
 
-#ifdef MOZ_WIDGET_GTK2
+#ifdef MOZ_WIDGET_GTK
   if (gnomeInfo) {
     LOG(("Got MIMEInfo from GNOME registry without extensions; setting them "
          "to %s\n", NS_LossyConvertUTF16toASCII(extensions).get()));
 
     NS_ASSERTION(!gnomeInfo->HasExtensions(), "How'd that happen?");
     gnomeInfo->SetFileExtensions(NS_ConvertUTF16toUTF8(extensions));
     return gnomeInfo.forget();
   }