Bug 906072 - Remove Maemo port. r=romaxa, r=ted, r=johns
authorDoug Turner <doug.turner@gmail.com>
Sun, 25 Aug 2013 16:56:53 -0700
changeset 146345 9d925d047ba50e5312ccab8b48b6b5237bb4e35b
parent 146344 e3e615c2a30267a6e3b8cc38e25ea5816850dd47
child 146346 0f939ca1606802376cd4193e8a96900e11f4fcc8
push id2961
push userlsblakk@mozilla.com
push dateMon, 28 Oct 2013 21:59:28 +0000
treeherdermozilla-esr52@73ef4f13486f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersromaxa, ted, johns
bugs906072
milestone26.0a1
Bug 906072 - Remove Maemo port. r=romaxa, r=ted, r=johns
browser/installer/Makefile.in
build/autoconf/arch.m4
config/system-headers
configure.in
content/base/src/nsGkAtomList.h
content/base/src/nsObjectLoadingContent.cpp
dom/plugins/base/PluginPRLibrary.cpp
dom/plugins/base/PluginPRLibrary.h
dom/plugins/base/npapi.h
dom/plugins/base/nsNPAPIPluginInstance.cpp
dom/plugins/base/nsNPAPIPluginInstance.h
dom/plugins/base/nsPluginInstanceOwner.cpp
dom/plugins/base/nsPluginInstanceOwner.h
dom/plugins/ipc/PPluginInstance.ipdl
dom/plugins/ipc/PluginInstanceChild.cpp
dom/plugins/ipc/PluginInstanceChild.h
dom/plugins/ipc/PluginInstanceParent.cpp
dom/plugins/ipc/PluginInstanceParent.h
dom/plugins/ipc/PluginLibrary.h
dom/plugins/ipc/PluginModuleChild.cpp
dom/plugins/ipc/PluginModuleParent.cpp
dom/plugins/ipc/PluginModuleParent.h
dom/src/geolocation/Makefile.in
dom/src/geolocation/nsGeolocation.cpp
dom/system/unix/MaemoLocationProvider.cpp
dom/system/unix/MaemoLocationProvider.h
dom/system/unix/Makefile.in
dom/system/unix/moz.build
gfx/gl/GLContextProvider.h
gfx/gl/GLContextProviderEGL.cpp
gfx/gl/moz.build
gfx/layers/ipc/ISurfaceAllocator.cpp
gfx/thebes/gfxPlatformGtk.h
js/src/build/autoconf/arch.m4
js/src/config/system-headers
layout/build/nsLayoutModule.cpp
layout/style/nsCSSRuleProcessor.cpp
layout/style/nsMediaFeatures.cpp
layout/style/test/test_media_queries.html
mobile/android/app/mobile.js
netwerk/base/src/Makefile.in
netwerk/base/src/moz.build
netwerk/base/src/nsAutodialMaemo.cpp
netwerk/base/src/nsAutodialMaemo.h
netwerk/base/src/nsIOService.cpp
netwerk/base/src/nsNativeConnectionHelper.cpp
netwerk/base/src/nsSocketTransport2.cpp
netwerk/build/Makefile.in
netwerk/build/nsNetModule.cpp
netwerk/protocol/http/nsHttpHandler.cpp
netwerk/system/maemo/Makefile.in
netwerk/system/maemo/moz.build
netwerk/system/maemo/nsMaemoNetworkLinkService.cpp
netwerk/system/maemo/nsMaemoNetworkLinkService.h
netwerk/system/maemo/nsMaemoNetworkManager.cpp
netwerk/system/maemo/nsMaemoNetworkManager.h
netwerk/system/moz.build
toolkit/components/downloads/nsDownloadManager.cpp
toolkit/components/jsdownloads/src/DownloadIntegration.jsm
toolkit/components/remote/nsQtRemoteService.cpp
toolkit/content/contentAreaUtils.js
toolkit/crashreporter/client/Makefile.in
toolkit/crashreporter/client/certdata2pem.py
toolkit/crashreporter/client/crashreporter_gtk_common.cpp
toolkit/crashreporter/client/crashreporter_maemo_gtk.cpp
toolkit/crashreporter/client/maemo-unit/crashreports.crt
toolkit/crashreporter/client/maemo-unit/opensslverify.sh
toolkit/crashreporter/client/maemo-unit/test_maemo_certs.js
toolkit/crashreporter/client/maemo-unit/xpcshell.ini
toolkit/crashreporter/client/moz.build
toolkit/crashreporter/google-breakpad/src/common/Makefile.in
toolkit/library/Makefile.in
toolkit/toolkit.mozbuild
toolkit/xre/nsAppRunner.cpp
toolkit/xre/nsNativeAppSupportQt.cpp
toolkit/xre/nsNativeAppSupportQt.h
toolkit/xre/nsNativeAppSupportUnix.cpp
toolkit/xre/nsQAppInstance.cpp
uriloader/exthandler/Makefile.in
uriloader/exthandler/nsDBusHandlerApp.cpp
uriloader/exthandler/nsExternalHelperAppService.cpp
uriloader/exthandler/unix/nsGNOMERegistry.cpp
uriloader/exthandler/unix/nsMIMEInfoUnix.cpp
uriloader/exthandler/unix/nsMIMEInfoUnix.h
uriloader/exthandler/unix/nsOSHelperAppService.cpp
widget/LookAndFeel.h
widget/android/nsLookAndFeel.cpp
widget/cocoa/nsLookAndFeel.mm
widget/gonk/nsLookAndFeel.cpp
widget/gtk2/Makefile.in
widget/gtk2/nsFilePicker.cpp
widget/gtk2/nsGtkIMModule.cpp
widget/gtk2/nsGtkIMModule.h
widget/gtk2/nsGtkKeyUtils.cpp
widget/gtk2/nsIdleServiceGTK.cpp
widget/gtk2/nsLookAndFeel.cpp
widget/gtk2/nsWindow.cpp
widget/os2/nsLookAndFeel.cpp
widget/qt/Makefile.in
widget/qt/faststartupqt/Makefile.in
widget/qt/faststartupqt/nsFastStartupQt.cpp
widget/qt/mozqwidget.cpp
widget/qt/nsIdleServiceQt.cpp
widget/qt/nsIdleServiceQt.h
widget/qt/nsLookAndFeel.cpp
widget/qt/nsWindow.cpp
widget/windows/nsLookAndFeel.cpp
widget/xpwidgets/GfxInfoX11.cpp
widget/xpwidgets/nsBaseWidget.cpp
xpcom/base/nsSystemInfo.cpp
xpcom/io/Makefile.in
xpcom/io/SpecialSystemDirectory.cpp
xpcom/io/nsLocalFileUnix.cpp
xulrunner/installer/Makefile.in
--- a/browser/installer/Makefile.in
+++ b/browser/installer/Makefile.in
@@ -96,18 +96,16 @@ MOZ_PKG_MAC_BACKGROUND=branding/backgrou
 MOZ_PKG_MAC_ICON=branding/disk.icns
 MOZ_PKG_MAC_EXTRA=--symlink "/Applications:/ "
 endif
 
 ifndef LIBXUL_SDK
 INSTALL_SDK = 1
 endif
 
-GENERATE_CACHE = 1
-
 include $(topsrcdir)/toolkit/mozapps/installer/signing.mk
 include $(topsrcdir)/toolkit/mozapps/installer/packager.mk
 
 ifeq (bundle, $(MOZ_FS_LAYOUT))
 BINPATH = $(_BINPATH)
 DEFINES += -DAPPNAME=$(_APPNAME)
 else
 # Every other platform just winds up in dist/bin
--- a/build/autoconf/arch.m4
+++ b/build/autoconf/arch.m4
@@ -32,26 +32,16 @@ if test -z "$MOZ_ARCH"; then
         MOZ_ARCH=armv7-a
         MOZ_FPU=vfp
         MOZ_FLOAT_ABI=softfp
         ;;
     arm-Darwin)
         MOZ_ARCH=toolchain-default
         MOZ_THUMB=yes
         ;;
-    arm-*)
-        if test -n "$MOZ_PLATFORM_MAEMO"; then
-            MOZ_THUMB=no
-            MOZ_ARCH=armv7-a
-            MOZ_FLOAT_ABI=softfp
-        fi
-        if test "$MOZ_PLATFORM_MAEMO" = 6; then
-            MOZ_THUMB=yes
-        fi
-        ;;
     esac
 fi
 
 if test "$MOZ_ARCH" = "armv6" -a "$OS_TARGET" = "Android"; then
    MOZ_FPU=vfp
 fi
 
 MOZ_ARG_WITH_STRING(thumb,
--- a/config/system-headers
+++ b/config/system-headers
@@ -1054,42 +1054,27 @@ libsn/sn-monitor.h
 libsn/sn-util.h
 #endif
 #if MOZ_NATIVE_HUNSPELL==1
 hunspell.hxx
 #endif
 #if MOZ_NATIVE_BZ2==1
 bzlib.h
 #endif
-#if MOZ_PLATFORM_MAEMO==5
-hildon-uri.h
-hildon-mime.h
-hildon-file-chooser-dialog.h
-libosso.h
-osso-mem.h
-#endif
 #ifdef MOZ_ENABLE_GIO
 gio/gio.h
 #endif
-#ifdef MOZ_ENABLE_LIBCONIC
-conic/conicconnection.h
-conic/conicconnectionevent.h
-conic/conicstatisticsevent.h
-#endif
 #if MOZ_NATIVE_LIBEVENT==1
 event.h
 #else
 sys/event.h
 #endif
 #ifdef MOZ_ENABLE_LIBPROXY
 proxy.h
 #endif
-#if MOZ_PLATFORM_MAEMO==6
-contentaction/contentaction.h
-#endif
 #ifdef MOZ_ENABLE_CONTENTMANAGER
 SelectSingleContentItemPage.h
 SelectMultipleContentItemsPage.h
 QtSparql/qsparqlconnection.h
 QtSparql/qsparqlquery.h
 QtSparql/qsparqlresult.h
 #endif
 
--- a/configure.in
+++ b/configure.in
@@ -4813,28 +4813,42 @@ incorrect])
     MOZ_ENABLE_QTMOBILITY=
     PKG_CHECK_MODULES(_QTMOBILITY, QtSensors QtFeedback QtLocation,
                       MOZ_ENABLE_QTMOBILITY=1,
                       MOZ_ENABLE_QTMOBILITY=)
     if test "$MOZ_ENABLE_QTMOBILITY"; then
        MOZ_ENABLE_QTMOBILITY=1
        MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS $_QTMOBILITY_CFLAGS"
        MOZ_QT_LIBS="$MOZ_QT_LIBS $_QTMOBILITY_LIBS"
+       AC_DEFINE(MOZ_ENABLE_QTMOBILITY)
+       AC_SUBST(MOZ_ENABLE_QTMOBILITY)
     else
        AC_CHECK_LIB(QtSensors, main, [
           MOZ_ENABLE_QTMOBILITY=1
           MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS -I$QTDIR/include/QtMobility"
           MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS -I$QTDIR/include/QtSensors"
           MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS -I$QTDIR/include/QtFeedback"
           MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS -I$QTDIR/include/QtLocation"
           MOZ_QT_LIBS="$MOZ_QT_LIBS -lQtSensors -lQtFeedback -lQtLocation"
        ])
     fi
-    if test "$MOZ_ENABLE_QTMOBILITY"; then
-       AC_DEFINE(MOZ_ENABLE_QTMOBILITY)
+
+    if test "$MOZ_ENABLE_CONTENTACTION"; then
+      MOZ_ENABLE_CONTENTACTION=1
+      AC_DEFINE(MOZ_ENABLE_CONTENTACTION)
+    fi
+
+    MOZ_ENABLE_CONTENTACTION=
+    PKG_CHECK_MODULES(LIBCONTENTACTION, contentaction-0.1, _LIB_FOUND=1, _LIB_FOUND=)
+    if test "$MOZ_ENABLE_CONTENTACTION"; then
+       MOZ_ENABLE_CONTENTACTION=1
+       MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS $_CONTENTACTION_CFLAGS"
+       MOZ_QT_LIBS="$MOZ_QT_LIBS $_CONTENTACTION_LIBS"
+       AC_DEFINE(MOZ_ENABLE_CONTENTACTION)
+       AC_SUBST(MOZ_ENABLE_CONTENTACTION)
     fi
 fi
 
 AC_SUBST(GTK_CONFIG)
 AC_SUBST(TK_CFLAGS)
 AC_SUBST(TK_LIBS)
 
 AC_SUBST(MOZ_ENABLE_GTK2)
@@ -6761,195 +6775,16 @@ dnl = Disable zipwriter
 dnl ========================================================
 MOZ_ARG_DISABLE_BOOL(zipwriter,
 [  --disable-zipwriter     Disable zipwriter component],
     MOZ_ZIPWRITER=,
     MOZ_ZIPWRITER=1 )
 AC_SUBST(MOZ_ZIPWRITER)
 
 dnl ========================================================
-dnl = libconic
-dnl ========================================================
-dnl superseded by QtNetwork starting from 4.7
-MOZ_ENABLE_LIBCONIC=1
-
-if test -n "$MOZ_ENABLE_QT"; then
-  if test "$MOZ_ENABLE_QTNETWORK"; then
-    MOZ_ENABLE_LIBCONIC=
-  fi
-fi
-
-MOZ_ARG_DISABLE_BOOL(libconic,
-[  --disable-libconic      Disable libconic],
-    MOZ_ENABLE_LIBCONIC=,
-    MOZ_ENABLE_LIBCONIC=1 )
-
-if test -n "$MOZ_ENABLE_LIBCONIC"; then
-    PKG_CHECK_MODULES(LIBCONIC, conic,
-                      MOZ_ENABLE_LIBCONIC=1,
-                      MOZ_ENABLE_LIBCONIC=)
-fi
-if test "$MOZ_ENABLE_LIBCONIC"; then
-    AC_DEFINE(MOZ_ENABLE_LIBCONIC)
-fi
-
-AC_SUBST(MOZ_ENABLE_LIBCONIC)
-AC_SUBST(LIBCONIC_CFLAGS)
-AC_SUBST(LIBCONIC_LIBS)
-
-dnl ========================================================
-dnl = Maemo checks
-dnl ========================================================
-
-MAEMO_SDK_TARGET_VER=-1
-
-MOZ_ARG_WITH_STRING(maemo-version,
-[  --with-maemo-version=MAEMO_SDK_TARGET_VER
-                          Maemo SDK Version],
-  MAEMO_SDK_TARGET_VER=$withval)
-
-case "$MAEMO_SDK_TARGET_VER" in
-5)
-    MOZ_PLATFORM_MAEMO=5
-    ;;
-
-6)
-    MOZ_PLATFORM_MAEMO=6
-    ;;
-
--1)
-    dnl We aren't compiling for Maemo, move on.
-    ;;
-*)
-    AC_MSG_ERROR([Unknown Maemo Version.  Try setting --with-maemo-version to 5 or 6.])
-    ;;
-esac
-
-if test $MOZ_PLATFORM_MAEMO; then
-   AC_DEFINE_UNQUOTED([MOZ_PLATFORM_MAEMO], $MOZ_PLATFORM_MAEMO)
-
-   if test -z "$MOZ_ENABLE_DBUS"; then
-       AC_MSG_ERROR([DBus is required when building for Maemo])
-   fi
-
-   MOZ_GFX_OPTIMIZE_MOBILE=1
-   MOZ_GL_DEFAULT_PROVIDER=EGL
-   MOZ_MAEMO_LIBLOCATION=
-
-   if test $MOZ_PLATFORM_MAEMO = 5; then
-      dnl if we have Xcomposite we should also have Xdamage and Xfixes
-      MOZ_CHECK_HEADERS([X11/extensions/Xdamage.h], [],
-          [AC_MSG_ERROR([Couldn't find X11/extensions/Xdamage.h which is required for composited plugins.])])
-      AC_CHECK_LIB(Xcomposite, XCompositeRedirectWindow, [XCOMPOSITE_LIBS="-lXcomposite -lXdamage -lXfixes"],
-                   [MISSING_X="$MISSING_X -lXcomposite"], $XLIBS)
-
-      AC_SUBST(XCOMPOSITE_LIBS)
-
-      PKG_CHECK_MODULES(LIBHILDONMIME,libhildonmime, _LIB_FOUND=1, _LIB_FOUND=)
-      MOZ_PLATFORM_MAEMO_LIBS="$MOZ_PLATFORM_MAEMO_LIBS $LIBHILDONMIME_LIBS"
-      MOZ_PLATFORM_MAEMO_CFLAGS="$MOZ_PLATFORM_MAEMO_CFLAGS $LIBHILDONMIME_CFLAGS"
-      if test -z "$_LIB_FOUND"; then
-         AC_MSG_ERROR([Hildon Mime is required when building for Maemo])
-      fi
-
-
-      PKG_CHECK_MODULES(LIBOSSO,libosso, _LIB_FOUND=1, _LIB_FOUND=)
-      MOZ_PLATFORM_MAEMO_LIBS="$MOZ_PLATFORM_MAEMO_LIBS $LIBOSSO_LIBS"
-      MOZ_PLATFORM_MAEMO_CFLAGS="$MOZ_PLATFORM_MAEMO_CFLAGS $LIBOSSO_CFLAGS"
-      if test -z "$_LIB_FOUND"; then
-         AC_MSG_ERROR([LibOSSO is required when building for Maemo])
-      fi
-
-      PKG_CHECK_MODULES(LIBHILDONFM,hildon-fm-2, _LIB_FOUND=1, _LIB_FOUND=)
-      MOZ_PLATFORM_MAEMO_LIBS="$MOZ_PLATFORM_MAEMO_LIBS $LIBHILDONFM_LIBS"
-      MOZ_PLATFORM_MAEMO_CFLAGS="$MOZ_PLATFORM_MAEMO_CFLAGS $LIBHILDONFM_CFLAGS"
-      if test -z "$_LIB_FOUND"; then
-         AC_MSG_ERROR([Hildon FM-2 is required when building for Maemo])
-      fi
-
-   fi
-   if test $MOZ_PLATFORM_MAEMO = 6; then
-
-      PKG_CHECK_MODULES(LIBCONTENTMANAGER, ContentManager QtSparql,
-                        _LIB_FOUND=1,
-                        _LIB_FOUND=)
-      if test "$_LIB_FOUND"; then
-         MOZ_PLATFORM_MAEMO_LIBS="$MOZ_PLATFORM_MAEMO_LIBS $LIBCONTENTMANAGER_LIBS"
-         MOZ_PLATFORM_MAEMO_CFLAGS="$MOZ_PLATFORM_MAEMO_CFLAGS $LIBCONTENTMANAGER_CFLAGS"
-         MOZ_ENABLE_CONTENTMANAGER=1
-         AC_DEFINE(MOZ_ENABLE_CONTENTMANAGER)
-      else
-         AC_MSG_WARN([Cannot find libcontentmanager and or QtSparql building for Maemo 6])
-      fi
-      AC_SUBST(MOZ_ENABLE_CONTENTMANAGER)
-
-      dnl ========================================================
-      dnl = Enable meego libcontentaction
-      dnl ========================================================
-      MOZ_ARG_ENABLE_BOOL(meegocontentaction,
-      [  --enable-meegocontentaction           Enable meegocontentaction support],
-         MOZ_MEEGOCONTENTACTION=1,
-         MOZ_MEEGOCONTENTACTION=)
-
-      if test -n "$MOZ_MEEGOCONTENTACTION"; then
-
-         PKG_CHECK_MODULES(LIBCONTENTACTION, contentaction-0.1, _LIB_FOUND=1, _LIB_FOUND=)
-         if test "$_LIB_FOUND"; then
-            MOZ_PLATFORM_MAEMO_LIBS="$MOZ_PLATFORM_MAEMO_LIBS $LIBCONTENTACTION_LIBS"
-            MOZ_PLATFORM_MAEMO_CFLAGS="$MOZ_PLATFORM_MAEMO_CFLAGS $LIBCONTENTACTION_CFLAGS"
-            MOZ_ENABLE_CONTENTACTION=1
-            AC_DEFINE(MOZ_ENABLE_CONTENTACTION)
-            AC_SUBST(MOZ_ENABLE_CONTENTACTION)
-         fi
-      fi
-
-      MOZ_ARG_ENABLE_BOOL(meegotouch,
-      [  --enable-meegotouch  Enable meegotouch support],
-         MOZ_MEEGOTOUCHENABLED=1,
-         MOZ_MEEGOTOUCHENABLED=)
-
-      if test -n "$MOZ_MEEGOTOUCHENABLED"; then
-          PKG_CHECK_MODULES(MOZ_MEEGOTOUCH, meegotouchcore, _LIB_FOUND=1, _LIB_FOUND=)
-          if test "$_LIB_FOUND"; then
-              MOZ_QT_CFLAGS="$MOZ_MEEGOTOUCH_CFLAGS $MOZ_QT_CFLAGS"
-              MOZ_QT_LIBS="$MOZ_MEEGOTOUCH_LIBS $MOZ_QT_LIBS"
-              AC_DEFINE(MOZ_ENABLE_MEEGOTOUCH)
-          else
-              AC_MSG_WARN([Cannot meegotouchcore-dev. Disabling Meegotouch support.])
-          fi
-      fi
-   fi
-
-   PKG_CHECK_MODULES(LIBLOCATION,liblocation, _LIB_FOUND=1, _LIB_FOUND=)
-   MOZ_PLATFORM_MAEMO_LIBS="$MOZ_PLATFORM_MAEMO_LIBS $LIBLOCATION_LIBS"
-   MOZ_PLATFORM_MAEMO_CFLAGS="$MOZ_PLATFORM_MAEMO_CFLAGS $LIBLOCATION_CFLAGS"
-   if test "$_LIB_FOUND"; then
-      MOZ_MAEMO_LIBLOCATION=1
-      AC_DEFINE(MOZ_MAEMO_LIBLOCATION)
-   else
-      AC_MSG_WARN([Cannot liblocation-dev. Disabling Maemo geolocation.])
-   fi
-   AC_SUBST(MOZ_MAEMO_LIBLOCATION)
-
-   PKG_CHECK_MODULES(LIBMEEGOTOUCHSHARE, ShareUiInterface-maemo-meegotouch >= 0.3.31 mdatauri, _LIB_FOUND=1, _LIB_FOUND=)
-   MOZ_PLATFORM_MAEMO_LIBS="$MOZ_PLATFORM_MAEMO_LIBS $LIBMEEGOTOUCHSHARE_LIBS"
-   MOZ_PLATFORM_MAEMO_CFLAGS="$MOZ_PLATFORM_MAEMO_CFLAGS $LIBMEEGOTOUCHSHARE_CFLAGS"
-   if test "$_LIB_FOUND"; then
-      MOZ_ENABLE_MEEGOTOUCHSHARE=1
-      AC_DEFINE(MOZ_ENABLE_MEEGOTOUCHSHARE)
-   else
-      AC_MSG_WARN([Cannot find maemo-meegotouch-interfaces-dev or libmdatauri-dev. Disabling meegotouch share ui.])
-   fi
-   AC_SUBST(MOZ_ENABLE_MEEGOTOUCHSHARE)
-
-   AC_SUBST(MOZ_PLATFORM_MAEMO_LIBS)
-   AC_SUBST(MOZ_PLATFORM_MAEMO_CFLAGS)
-fi
-
-dnl ========================================================
 dnl GL provider
 dnl ========================================================
 MOZ_GL_PROVIDER=
 MOZ_ARG_WITH_STRING(gl-provider,
 [  --with-gl-provider=ID
                           Set GL provider backend type],
 [ val=`echo $withval`
     MOZ_GL_PROVIDER="$val"])
@@ -8609,17 +8444,16 @@ AC_SUBST(RC)
 AC_SUBST(RCFLAGS)
 AC_SUBST(MC)
 AC_SUBST(WINDRES)
 AC_SUBST(IMPLIB)
 AC_SUBST(FILTER)
 AC_SUBST(BIN_FLAGS)
 AC_SUBST(MOZ_WIDGET_TOOLKIT)
 AC_SUBST(MOZ_UPDATE_XTERM)
-AC_SUBST(MOZ_PLATFORM_MAEMO)
 AC_SUBST(MOZ_AUTH_EXTENSION)
 AC_SUBST(MOZ_PERMISSIONS)
 AC_SUBST(MOZ_PREF_EXTENSIONS)
 AC_SUBST(MOZ_JS_LIBS)
 AC_SUBST(MOZ_DEBUG)
 AC_SUBST(MOZ_DEBUG_SYMBOLS)
 AC_SUBST(MOZ_DEBUG_ENABLE_DEFS)
 AC_SUBST(MOZ_DEBUG_DISABLE_DEFS)
--- a/content/base/src/nsGkAtomList.h
+++ b/content/base/src/nsGkAtomList.h
@@ -2007,17 +2007,16 @@ GK_ATOM(images_in_menus, "images-in-menu
 GK_ATOM(images_in_buttons, "images-in-buttons")
 GK_ATOM(overlay_scrollbars, "overlay-scrollbars")
 GK_ATOM(windows_default_theme, "windows-default-theme")
 GK_ATOM(mac_graphite_theme, "mac-graphite-theme")
 GK_ATOM(mac_lion_theme, "mac-lion-theme")
 GK_ATOM(windows_compositor, "windows-compositor")
 GK_ATOM(windows_glass, "windows-glass")
 GK_ATOM(touch_enabled, "touch-enabled")
-GK_ATOM(maemo_classic, "maemo-classic")
 GK_ATOM(menubar_drag, "menubar-drag")
 GK_ATOM(swipe_animation_enabled, "swipe-animation-enabled")
 GK_ATOM(physical_home_button, "physical-home-button")
 
 // windows theme selector metrics
 GK_ATOM(windows_classic, "windows-classic")
 GK_ATOM(windows_theme_aero, "windows-theme-aero")
 GK_ATOM(windows_theme_aero_lite, "windows-theme-aero-lite")
@@ -2048,17 +2047,16 @@ GK_ATOM(_moz_windows_default_theme, "-mo
 GK_ATOM(_moz_mac_graphite_theme, "-moz-mac-graphite-theme")
 GK_ATOM(_moz_mac_lion_theme, "-moz-mac-lion-theme")
 GK_ATOM(_moz_windows_compositor, "-moz-windows-compositor")
 GK_ATOM(_moz_windows_classic, "-moz-windows-classic")
 GK_ATOM(_moz_windows_glass, "-moz-windows-glass")
 GK_ATOM(_moz_windows_theme, "-moz-windows-theme")
 GK_ATOM(_moz_os_version, "-moz-os-version")
 GK_ATOM(_moz_touch_enabled, "-moz-touch-enabled")
-GK_ATOM(_moz_maemo_classic, "-moz-maemo-classic")
 GK_ATOM(_moz_menubar_drag, "-moz-menubar-drag")
 GK_ATOM(_moz_device_pixel_ratio, "-moz-device-pixel-ratio")
 GK_ATOM(_moz_device_orientation, "-moz-device-orientation")
 GK_ATOM(_moz_is_resource_document, "-moz-is-resource-document")
 GK_ATOM(_moz_swipe_animation_enabled, "-moz-swipe-animation-enabled")
 GK_ATOM(_moz_physical_home_button, "-moz-physical-home-button")
 
 // application commands
--- a/content/base/src/nsObjectLoadingContent.cpp
+++ b/content/base/src/nsObjectLoadingContent.cpp
@@ -2671,22 +2671,16 @@ nsObjectLoadingContent::GetSrcURI(nsIURI
   return NS_OK;
 }
 
 static bool
 DoDelayedStop(nsPluginInstanceOwner* aInstanceOwner,
               nsObjectLoadingContent* aContent,
               bool aDelayedStop)
 {
-#if (MOZ_PLATFORM_MAEMO==5)
-  // Don't delay stop on Maemo/Hildon (bug 530739).
-  if (aDelayedStop && aInstanceOwner->MatchPluginName("Shockwave Flash"))
-    return false;
-#endif
-
   // Don't delay stopping QuickTime (bug 425157), Flip4Mac (bug 426524),
   // XStandard (bug 430219), CMISS Zinc (bug 429604).
   if (aDelayedStop
 #if !(defined XP_WIN || defined MOZ_X11)
       && !aInstanceOwner->MatchPluginName("QuickTime")
       && !aInstanceOwner->MatchPluginName("Flip4Mac")
       && !aInstanceOwner->MatchPluginName("XStandard plugin")
       && !aInstanceOwner->MatchPluginName("CMISS Zinc Plugin")
--- a/dom/plugins/base/PluginPRLibrary.cpp
+++ b/dom/plugins/base/PluginPRLibrary.cpp
@@ -255,27 +255,16 @@ PluginPRLibrary::NPP_GetSitesWithData(In
 nsresult
 PluginPRLibrary::AsyncSetWindow(NPP instance, NPWindow* window)
 {
   nsNPAPIPluginInstance* inst = (nsNPAPIPluginInstance*)instance->ndata;
   NS_ENSURE_TRUE(inst, NS_ERROR_NULL_POINTER);
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
-#if defined(MOZ_WIDGET_QT) && (MOZ_PLATFORM_MAEMO == 6)
-nsresult
-PluginPRLibrary::HandleGUIEvent(NPP instance, const nsGUIEvent& anEvent,
-                                bool* handled)
-{
-  nsNPAPIPluginInstance* inst = (nsNPAPIPluginInstance*)instance->ndata;
-  NS_ENSURE_TRUE(inst, NS_ERROR_NULL_POINTER);
-  return NS_ERROR_NOT_IMPLEMENTED;
-}
-#endif
-
 nsresult
 PluginPRLibrary::GetImageContainer(NPP instance, ImageContainer** aContainer)
 {
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 #if defined(XP_MACOSX)
 nsresult
--- a/dom/plugins/base/PluginPRLibrary.h
+++ b/dom/plugins/base/PluginPRLibrary.h
@@ -116,21 +116,16 @@ public:
     virtual nsresult IsRemoteDrawingCoreAnimation(NPP instance, bool *aDrawing);
     virtual nsresult ContentsScaleFactorChanged(NPP instance, double aContentsScaleFactor);
 #endif
     virtual nsresult SetBackgroundUnknown(NPP instance) MOZ_OVERRIDE;
     virtual nsresult BeginUpdateBackground(NPP instance,
                                            const nsIntRect&, gfxContext** aCtx) MOZ_OVERRIDE;
     virtual nsresult EndUpdateBackground(NPP instance,
                                          gfxContext* aCtx, const nsIntRect&) MOZ_OVERRIDE;
-#if defined(MOZ_WIDGET_QT) && (MOZ_PLATFORM_MAEMO == 6)
-    virtual nsresult HandleGUIEvent(NPP instance,
-                                    const nsGUIEvent& anEvent, bool* handled);
-#endif
-
     virtual void GetLibraryPath(nsACString& aPath) { aPath.Assign(mFilePath); }
 
 private:
     NP_InitializeFunc mNP_Initialize;
     NP_ShutdownFunc mNP_Shutdown;
     NP_GetMIMEDescriptionFunc mNP_GetMIMEDescription;
 #if defined(XP_UNIX) && !defined(XP_MACOSX)
     NP_GetValueFunc mNP_GetValue;
--- a/dom/plugins/base/npapi.h
+++ b/dom/plugins/base/npapi.h
@@ -381,19 +381,16 @@ typedef enum {
   NPPVpluginDrawingModel = 1000
 #if defined(XP_MACOSX)
   /* Used for negotiating event models */
   , NPPVpluginEventModel = 1001
   /* In the NPDrawingModelCoreAnimation drawing model, the browser asks the plug-in for a Core Animation layer. */
   , NPPVpluginCoreAnimationLayer = 1003
 #endif
 
-#if defined(MOZ_PLATFORM_MAEMO) && ((MOZ_PLATFORM_MAEMO == 5) || (MOZ_PLATFORM_MAEMO == 6))
-  , NPPVpluginWindowlessLocalBool = 2002
-#endif
 } NPPVariable;
 
 /*
  * List of variable names for which NPN_GetValue should be implemented.
  */
 typedef enum {
   NPNVxDisplay = 1,
   NPNVxtAppContext,
@@ -442,19 +439,16 @@ typedef enum {
   , NPNVsupportsCarbonBool = 3000 /* TRUE if the browser supports the Carbon event model */
 #endif
   , NPNVsupportsCocoaBool = 3001 /* TRUE if the browser supports the Cocoa event model */
   , NPNVsupportsUpdatedCocoaTextInputBool = 3002 /* TRUE if the browser supports the updated
                                                     Cocoa text input specification. */
   , NPNVsupportsCompositingCoreAnimationPluginsBool = 74656 /* TRUE if the browser supports
                                                                CA model compositing */
 #endif
-#if defined(MOZ_PLATFORM_MAEMO) && ((MOZ_PLATFORM_MAEMO == 5) || (MOZ_PLATFORM_MAEMO == 6))
-  , NPNVSupportsWindowlessLocal = 2002
-#endif
 } NPNVariable;
 
 typedef enum {
   NPNURLVCookie = 501,
   NPNURLVProxy
 } NPNURLVariable;
 
 /*
--- a/dom/plugins/base/nsNPAPIPluginInstance.cpp
+++ b/dom/plugins/base/nsNPAPIPluginInstance.cpp
@@ -1198,33 +1198,16 @@ nsNPAPIPluginInstance::AsyncSetWindow(NP
 
   AutoPluginLibraryCall library(this);
   if (!library)
     return NS_ERROR_FAILURE;
 
   return library->AsyncSetWindow(&mNPP, window);
 }
 
-#if defined(MOZ_WIDGET_QT) && (MOZ_PLATFORM_MAEMO == 6)
-nsresult
-nsNPAPIPluginInstance::HandleGUIEvent(const nsGUIEvent& anEvent, bool* handled)
-{
-  if (RUNNING != mRunning) {
-    *handled = false;
-    return NS_OK;
-  }
-
-  AutoPluginLibraryCall library(this);
-  if (!library)
-    return NS_ERROR_FAILURE;
-
-  return library->HandleGUIEvent(&mNPP, anEvent, handled);
-}
-#endif
-
 nsresult
 nsNPAPIPluginInstance::GetImageContainer(ImageContainer**aContainer)
 {
   *aContainer = nullptr;
 
   if (RUNNING != mRunning)
     return NS_OK;
 
--- a/dom/plugins/base/nsNPAPIPluginInstance.h
+++ b/dom/plugins/base/nsNPAPIPluginInstance.h
@@ -113,19 +113,16 @@ public:
   nsresult GetPluginAPIVersion(uint16_t* version);
   nsresult InvalidateRect(NPRect *invalidRect);
   nsresult InvalidateRegion(NPRegion invalidRegion);
   nsresult GetMIMEType(const char* *result);
   nsresult GetJSContext(JSContext* *outContext);
   nsPluginInstanceOwner* GetOwner();
   void SetOwner(nsPluginInstanceOwner *aOwner);
   nsresult ShowStatus(const char* message);
-#if defined(MOZ_WIDGET_QT) && (MOZ_PLATFORM_MAEMO == 6)
-  nsresult HandleGUIEvent(const nsGUIEvent& anEvent, bool* handled);
-#endif
 
   nsNPAPIPlugin* GetPlugin();
 
   nsresult GetNPP(NPP * aNPP);
 
   NPError SetWindowless(bool aWindowless);
 
   NPError SetTransparent(bool aTransparent);
--- a/dom/plugins/base/nsPluginInstanceOwner.cpp
+++ b/dom/plugins/base/nsPluginInstanceOwner.cpp
@@ -1793,34 +1793,16 @@ nsresult nsPluginInstanceOwner::Dispatch
       aFocusEvent->PreventDefault();
       aFocusEvent->StopPropagation();
     }   
   }
   
   return NS_OK;
 }    
 
-#if defined(MOZ_WIDGET_QT) && (MOZ_PLATFORM_MAEMO == 6)
-nsresult nsPluginInstanceOwner::Text(nsIDOMEvent* aTextEvent)
-{
-  if (mInstance) {
-    nsEvent *event = aTextEvent->GetInternalNSEvent();
-    if (event && event->eventStructType == NS_TEXT_EVENT) {
-      nsEventStatus rv = ProcessEvent(*static_cast<nsGUIEvent*>(event));
-      if (nsEventStatus_eConsumeNoDefault == rv) {
-        aTextEvent->PreventDefault();
-        aTextEvent->StopPropagation();
-      }
-    }
-  }
-
-  return NS_OK;
-}
-#endif
-
 nsresult nsPluginInstanceOwner::ProcessKeyPress(nsIDOMEvent* aKeyEvent)
 {
 #ifdef XP_MACOSX
   return DispatchKeyToPlugin(aKeyEvent);
 #else
   if (SendNativeEvents())
     DispatchKeyToPlugin(aKeyEvent);
 
@@ -1948,21 +1930,16 @@ nsPluginInstanceOwner::HandleEvent(nsIDO
   }
   if (eventType.EqualsLiteral("keydown") ||
       eventType.EqualsLiteral("keyup")) {
     return DispatchKeyToPlugin(aEvent);
   }
   if (eventType.EqualsLiteral("keypress")) {
     return ProcessKeyPress(aEvent);
   }
-#if defined(MOZ_WIDGET_QT) && (MOZ_PLATFORM_MAEMO == 6)
-  if (eventType.EqualsLiteral("text")) {
-    return Text(aEvent);
-  }
-#endif
 
   nsCOMPtr<nsIDOMDragEvent> dragEvent(do_QueryInterface(aEvent));
   if (dragEvent && mInstance) {
     nsEvent* ievent = aEvent->GetInternalNSEvent();
     if ((ievent && ievent->mFlags.mIsTrusted) &&
          ievent->message != NS_DRAGDROP_ENTER && ievent->message != NS_DRAGDROP_OVER) {
       aEvent->PreventDefault();
     }
@@ -2391,39 +2368,20 @@ nsEventStatus nsPluginInstanceOwner::Pro
           event.same_screen = False;
         }
       else
         {
           // If we need to send synthesized key events, then
           // DOMKeyCodeToGdkKeyCode(keyEvent.keyCode) and
           // gdk_keymap_get_entries_for_keyval will be useful, but the
           // mappings will not be unique.
-#if defined(MOZ_WIDGET_QT) && (MOZ_PLATFORM_MAEMO == 6)
-          bool handled;
-          if (NS_SUCCEEDED(mInstance->HandleGUIEvent(anEvent, &handled)) &&
-              handled) {
-            rv = nsEventStatus_eConsumeNoDefault;
-          }
-#else
           NS_WARNING("Synthesized key event not sent to plugin");
-#endif
         }
       break;
 
-#if defined(MOZ_WIDGET_QT) && (MOZ_PLATFORM_MAEMO == 6)
-   case NS_TEXT_EVENT:
-        {
-          bool handled;
-          if (NS_SUCCEEDED(mInstance->HandleGUIEvent(anEvent, &handled)) &&
-              handled) {
-            rv = nsEventStatus_eConsumeNoDefault;
-          }
-        }
-      break;
-#endif
     default: 
       switch (anEvent.message)
         {
         case NS_FOCUS_CONTENT:
         case NS_BLUR_CONTENT:
           {
             XFocusChangeEvent &event = pluginEvent.xfocus;
             event.type =
@@ -2577,19 +2535,16 @@ nsPluginInstanceOwner::Destroy()
   mContent->RemoveEventListener(NS_LITERAL_STRING("drag"), this, true);
   mContent->RemoveEventListener(NS_LITERAL_STRING("dragenter"), this, true);
   mContent->RemoveEventListener(NS_LITERAL_STRING("dragover"), this, true);
   mContent->RemoveEventListener(NS_LITERAL_STRING("dragleave"), this, true);
   mContent->RemoveEventListener(NS_LITERAL_STRING("dragexit"), this, true);
   mContent->RemoveEventListener(NS_LITERAL_STRING("dragstart"), this, true);
   mContent->RemoveEventListener(NS_LITERAL_STRING("draggesture"), this, true);
   mContent->RemoveEventListener(NS_LITERAL_STRING("dragend"), this, true);
-#if defined(MOZ_WIDGET_QT) && (MOZ_PLATFORM_MAEMO == 6)
-  mContent->RemoveEventListener(NS_LITERAL_STRING("text"), this, true);
-#endif
 
 #if MOZ_WIDGET_ANDROID
   RemovePluginView();
 #endif
 
   if (mWidget) {
     if (mPluginWindow) {
       mPluginWindow->SetPluginWidget(nullptr);
@@ -3006,19 +2961,16 @@ nsresult nsPluginInstanceOwner::Init(nsI
   mContent->AddEventListener(NS_LITERAL_STRING("drag"), this, true);
   mContent->AddEventListener(NS_LITERAL_STRING("dragenter"), this, true);
   mContent->AddEventListener(NS_LITERAL_STRING("dragover"), this, true);
   mContent->AddEventListener(NS_LITERAL_STRING("dragleave"), this, true);
   mContent->AddEventListener(NS_LITERAL_STRING("dragexit"), this, true);
   mContent->AddEventListener(NS_LITERAL_STRING("dragstart"), this, true);
   mContent->AddEventListener(NS_LITERAL_STRING("draggesture"), this, true);
   mContent->AddEventListener(NS_LITERAL_STRING("dragend"), this, true);
-#if defined(MOZ_WIDGET_QT) && (MOZ_PLATFORM_MAEMO == 6)
-  mContent->AddEventListener(NS_LITERAL_STRING("text"), this, true);
-#endif
 
   return NS_OK; 
 }
 
 void* nsPluginInstanceOwner::GetPluginPortFromWidget()
 {
 //!!! Port must be released for windowless plugins on Windows, because it is HDC !!!
 
--- a/dom/plugins/base/nsPluginInstanceOwner.h
+++ b/dom/plugins/base/nsPluginInstanceOwner.h
@@ -78,20 +78,16 @@ public:
   //nsIPluginTagInfo interface
   NS_DECL_NSIPLUGINTAGINFO
   
   // nsIDOMEventListener interfaces 
   NS_DECL_NSIDOMEVENTLISTENER
   
   nsresult ProcessMouseDown(nsIDOMEvent* aKeyEvent);
   nsresult ProcessKeyPress(nsIDOMEvent* aKeyEvent);
-#if defined(MOZ_WIDGET_QT) && (MOZ_PLATFORM_MAEMO == 6)
-  nsresult Text(nsIDOMEvent* aTextEvent);
-#endif
-
   nsresult Destroy();  
 
 #ifdef XP_WIN
   void Paint(const RECT& aDirty, HDC aDC);
 #elif defined(XP_MACOSX)
   void Paint(const gfxRect& aDirtyRect, CGContextRef cgContext);  
   void RenderCoreAnimation(CGContextRef aCGContext, int aWidth, int aHeight);
   void DoCocoaEventDrawRect(const gfxRect& aDrawRect, CGContextRef cgContext);
--- a/dom/plugins/ipc/PPluginInstance.ipdl
+++ b/dom/plugins/ipc/PPluginInstance.ipdl
@@ -134,21 +134,16 @@ child:
 
   // There is now an opaque background behind this instance (or the
   // background was updated).  The changed area is |rect|.  The
   // browser owns the background surface, and it's read-only from
   // within the plugin process.  |background| is either null_t to
   // refer to the existing background or a fresh descriptor.
   async UpdateBackground(SurfaceDescriptor background, nsIntRect rect);
 
-  rpc HandleTextEvent(nsTextEvent event)
-    returns (bool handled);
-  rpc HandleKeyEvent(nsKeyEvent event)
-    returns (bool handled);
-
   async NPP_DidComposite();
 
   rpc NPP_Destroy()
     returns (NPError rv);
 
 parent:
   rpc NPN_GetValue_NPNVWindowNPObject()
     returns (nullable PPluginScriptableObject value, NPError result);
--- a/dom/plugins/ipc/PluginInstanceChild.cpp
+++ b/dom/plugins/ipc/PluginInstanceChild.cpp
@@ -1,23 +1,14 @@
 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
  * vim: sw=4 ts=4 et :
  * This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-#if defined(MOZ_WIDGET_QT) && (MOZ_PLATFORM_MAEMO == 6)
-#include <QEvent>
-#include <QKeyEvent>
-#include <QApplication>
-#include <QInputMethodEvent>
-#include "nsQtKeyUtils.h"
-#include "NestedLoopTimer.h"
-#endif
-
 #include "PluginBackgroundDestroyer.h"
 #include "PluginInstanceChild.h"
 #include "PluginModuleChild.h"
 #include "BrowserStreamChild.h"
 #include "PluginStreamChild.h"
 #include "StreamNotifyChild.h"
 #include "PluginProcessChild.h"
 #include "gfxASurface.h"
@@ -146,19 +137,16 @@ PluginInstanceChild::PluginInstanceChild
     , mIsTransparent(false)
     , mSurfaceType(gfxASurface::SurfaceTypeMax)
     , mCurrentInvalidateTask(nullptr)
     , mCurrentAsyncSetWindowTask(nullptr)
     , mPendingPluginCall(false)
     , mDoAlphaExtraction(false)
     , mHasPainted(false)
     , mSurfaceDifferenceRect(0,0,0,0)
-#if (MOZ_PLATFORM_MAEMO == 5) || (MOZ_PLATFORM_MAEMO == 6)
-    , mMaemoImageRendering(true)
-#endif
 {
     memset(&mWindow, 0, sizeof(mWindow));
     mWindow.type = NPWindowTypeWindow;
     mData.ndata = (void*) this;
     mData.pdata = nullptr;
     mAsyncBitmaps.Init();
 #if defined(MOZ_X11) && defined(XP_UNIX) && !defined(XP_MACOSX)
     mWindow.ws_info = &mWsInfo;
@@ -288,28 +276,16 @@ NPError
 PluginInstanceChild::NPN_GetValue(NPNVariable aVar,
                                   void* aValue)
 {
     PLUGIN_LOG_DEBUG(("%s (aVar=%i)", FULLFUNCTION, (int) aVar));
     AssertPluginThread();
 
     switch(aVar) {
 
-#if (MOZ_PLATFORM_MAEMO == 5) || (MOZ_PLATFORM_MAEMO == 6)
-    case NPNVSupportsWindowlessLocal: {
-#ifdef MOZ_WIDGET_QT
-        const char *graphicsSystem = PR_GetEnv("MOZ_QT_GRAPHICSSYSTEM");
-        // we should set local rendering to false in order to render X-Plugin
-        // there is no possibility to change it later on maemo5 platform
-        mMaemoImageRendering = (!(graphicsSystem && !strcmp(graphicsSystem, "native")));
-#endif
-        *((NPBool*)aValue) = mMaemoImageRendering;
-        return NPERR_NO_ERROR;
-    }
-#endif
 #if defined(MOZ_X11)
     case NPNVToolkit:
         *((NPNToolkitType*)aValue) = NPNVGtk2;
         return NPERR_NO_ERROR;
 
     case NPNVxDisplay:
         if (!mWsInfo.display) {
             // We are called before Initialize() so we have to call it now.
@@ -2724,67 +2700,16 @@ PluginInstanceChild::RecvAsyncSetWindow(
                           gfxSurfaceType, NPRemoteWindow, bool>
         (this, &PluginInstanceChild::DoAsyncSetWindow,
          aSurfaceType, aWindow, true);
     MessageLoop::current()->PostTask(FROM_HERE, mCurrentAsyncSetWindowTask);
 
     return true;
 }
 
-bool
-PluginInstanceChild::AnswerHandleKeyEvent(const nsKeyEvent& aKeyEvent,
-                                          bool* handled)
-{
-    AssertPluginThread();
-#if defined(MOZ_WIDGET_QT) && (MOZ_PLATFORM_MAEMO == 6)
-    Qt::KeyboardModifiers modifier;
-    if (aKeyEvent.IsShift())
-        modifier |= Qt::ShiftModifier;
-    if (aKeyEvent.IsControl())
-        modifier |= Qt::ControlModifier;
-    if (aKeyEvent.IsAlt())
-        modifier |= Qt::AltModifier;
-    if (aKeyEvent.IsMeta())
-        modifier |= Qt::MetaModifier;
-
-    QEvent::Type type;
-    if (aKeyEvent.message == NS_KEY_DOWN) {
-        type = QEvent::KeyPress;
-    } else if (aKeyEvent.message == NS_KEY_UP) {
-        type = QEvent::KeyRelease;
-    } else {
-        *handled = false;
-        return true;
-    }
-    QKeyEvent keyEv(type, DOMKeyCodeToQtKeyCode(aKeyEvent.keyCode), modifier);
-    *handled = QApplication::sendEvent(qApp, &keyEv);
-#else
-    NS_ERROR("Not implemented");
-#endif
-
-    return true;
-}
-
-bool
-PluginInstanceChild::AnswerHandleTextEvent(const nsTextEvent& aEvent,
-                                           bool* handled)
-{
-    AssertPluginThread();
-#if defined(MOZ_WIDGET_QT) && (MOZ_PLATFORM_MAEMO == 6)
-    QInputMethodEvent event;
-    event.setCommitString(QString((const QChar*)aEvent.theText.get(),
-                          aEvent.theText.Length()));
-    *handled = QApplication::sendEvent(qApp, &event);
-#else
-    NS_ERROR("Not implemented");
-#endif
-
-    return true;
-}
-
 void
 PluginInstanceChild::DoAsyncSetWindow(const gfxSurfaceType& aSurfaceType,
                                       const NPRemoteWindow& aWindow,
                                       bool aIsAsync)
 {
     PLUGIN_LOG_DEBUG(
         ("[InstanceChild][%p] AsyncSetWindow to <x=%d,y=%d, w=%d,h=%d>",
          this, aWindow.x, aWindow.y, aWindow.width, aWindow.height));
@@ -2853,27 +2778,16 @@ PluginInstanceChild::CreateOptSurface(vo
     nsRefPtr<gfxASurface> retsurf;
     // Use an opaque surface unless we're transparent and *don't* have
     // a background to source from.
     gfxASurface::gfxImageFormat format =
         (mIsTransparent && !mBackground) ? gfxASurface::ImageFormatARGB32 :
                                            gfxASurface::ImageFormatRGB24;
 
 #ifdef MOZ_X11
-#if (MOZ_PLATFORM_MAEMO == 5) || (MOZ_PLATFORM_MAEMO == 6)
-    // On Maemo 5, we must send the Visibility event to activate the plugin
-    if (mMaemoImageRendering) {
-        NPEvent pluginEvent;
-        XVisibilityEvent& visibilityEvent = pluginEvent.xvisibility;
-        visibilityEvent.type = VisibilityNotify;
-        visibilityEvent.display = 0;
-        visibilityEvent.state = VisibilityUnobscured;
-        mPluginIface->event(&mData, reinterpret_cast<void*>(&pluginEvent));
-    }
-#endif
     Display* dpy = mWsInfo.display;
     Screen* screen = DefaultScreenOfDisplay(dpy);
     if (format == gfxASurface::ImageFormatRGB24 &&
         DefaultDepth(dpy, DefaultScreen(dpy)) == 16) {
         format = gfxASurface::ImageFormatRGB16_565;
     }
 
     if (mSurfaceType == gfxASurface::SurfaceTypeXlib) {
@@ -2927,22 +2841,17 @@ bool
 PluginInstanceChild::MaybeCreatePlatformHelperSurface(void)
 {
     if (!mCurrentSurface) {
         NS_ERROR("Cannot create helper surface without mCurrentSurface");
         return false;
     }
 
 #ifdef MOZ_X11
-#ifdef MOZ_PLATFORM_MAEMO
-    // On maemo plugins support non-default visual rendering
-    bool supportNonDefaultVisual = true;
-#else
     bool supportNonDefaultVisual = false;
-#endif
     Screen* screen = DefaultScreenOfDisplay(mWsInfo.display);
     Visual* defaultVisual = DefaultVisualOfScreen(screen);
     Visual* visual = nullptr;
     Colormap colormap = 0;
     mDoAlphaExtraction = false;
     bool createHelperSurface = false;
 
     if (mCurrentSurface->GetType() == gfxASurface::SurfaceTypeXlib) {
@@ -2951,24 +2860,16 @@ PluginInstanceChild::MaybeCreatePlatform
         // Create helper surface if layer surface visual not same as default
         // and we don't support non-default visual rendering
         if (!visual || (defaultVisual != visual && !supportNonDefaultVisual)) {
             createHelperSurface = true;
             visual = defaultVisual;
             mDoAlphaExtraction = mIsTransparent;
         }
     } else if (mCurrentSurface->GetType() == gfxASurface::SurfaceTypeImage) {
-#if (MOZ_PLATFORM_MAEMO == 5) || (MOZ_PLATFORM_MAEMO == 6)
-        if (mMaemoImageRendering) {
-            // No helper surface needed, when mMaemoImageRendering is TRUE.
-            // we can rendering directly into image memory
-            // with NPImageExpose Maemo5 NPAPI
-            return true;
-        }
-#endif
         // For image layer surface we should always create helper surface
         createHelperSurface = true;
         // Check if we can create helper surface with non-default visual
         visual = gfxXlibSurface::FindVisual(screen,
             static_cast<gfxImageSurface*>(mCurrentSurface.get())->Format());
         if (!visual || (defaultVisual != visual && !supportNonDefaultVisual)) {
             visual = defaultVisual;
             mDoAlphaExtraction = mIsTransparent;
@@ -3115,32 +3016,16 @@ PluginInstanceChild::UpdateWindowAttribu
         static_cast<gfxXlibSurface*>(curSurface.get())->
             GetColormapAndVisual(&colormap, &visual);
         if (visual != mWsInfo.visual || colormap != mWsInfo.colormap) {
             mWsInfo.visual = visual;
             mWsInfo.colormap = colormap;
             needWindowUpdate = true;
         }
     }
-#if (MOZ_PLATFORM_MAEMO == 5) || (MOZ_PLATFORM_MAEMO == 6)
-    else if (curSurface && curSurface->GetType() == gfxASurface::SurfaceTypeImage
-             && mMaemoImageRendering) {
-        // For maemo5 we need to setup window/colormap to 0
-        // and specify depth of image surface
-        gfxImageSurface* img = static_cast<gfxImageSurface*>(curSurface.get());
-        if (mWindow.window ||
-            mWsInfo.depth != gfxUtils::ImageFormatToDepth(img->Format()) ||
-            mWsInfo.colormap) {
-            mWindow.window = nullptr;
-            mWsInfo.depth = gfxUtils::ImageFormatToDepth(img->Format());
-            mWsInfo.colormap = 0;
-            needWindowUpdate = true;
-        }
-    }
-#endif // MAEMO
 #endif // MOZ_X11
 #ifdef XP_WIN
     HDC dc = NULL;
 
     if (curSurface) {
         if (!SharedDIBSurface::IsSharedDIBSurface(curSurface))
             NS_RUNTIMEABORT("Expected SharedDIBSurface!");
 
@@ -3213,56 +3098,16 @@ PluginInstanceChild::UpdateWindowAttribu
 
 void
 PluginInstanceChild::PaintRectToPlatformSurface(const nsIntRect& aRect,
                                                 gfxASurface* aSurface)
 {
     UpdateWindowAttributes();
 
 #ifdef MOZ_X11
-#if (MOZ_PLATFORM_MAEMO == 5) || (MOZ_PLATFORM_MAEMO == 6)
-    // On maemo5 we do support Image rendering NPAPI
-    if (mMaemoImageRendering &&
-        aSurface->GetType() == gfxASurface::SurfaceTypeImage) {
-        aSurface->Flush();
-        gfxImageSurface* image = static_cast<gfxImageSurface*>(aSurface);
-        NPImageExpose imgExp;
-        imgExp.depth = gfxUtils::ImageFormatToDepth(image->Format());
-        imgExp.x = aRect.x;
-        imgExp.y = aRect.y;
-        imgExp.width = aRect.width;
-        imgExp.height = aRect.height;
-        imgExp.stride = image->Stride();
-        imgExp.data = (char *)image->Data();
-        imgExp.dataSize.width = image->Width();
-        imgExp.dataSize.height = image->Height();
-        imgExp.translateX = 0;
-        imgExp.translateY = 0;
-        imgExp.scaleX = 1;
-        imgExp.scaleY = 1;
-        NPEvent pluginEvent;
-        XGraphicsExposeEvent& exposeEvent = pluginEvent.xgraphicsexpose;
-        exposeEvent.type = GraphicsExpose;
-        exposeEvent.display = 0;
-        // Store imageExpose structure pointer as drawable member
-        exposeEvent.drawable = (Drawable)&imgExp;
-        exposeEvent.x = imgExp.x;
-        exposeEvent.y = imgExp.y;
-        exposeEvent.width = imgExp.width;
-        exposeEvent.height = imgExp.height;
-        exposeEvent.count = 0;
-        // information not set:
-        exposeEvent.serial = 0;
-        exposeEvent.send_event = False;
-        exposeEvent.major_code = 0;
-        exposeEvent.minor_code = 0;
-        mPluginIface->event(&mData, reinterpret_cast<void*>(&exposeEvent));
-        aSurface->MarkDirty(gfxRect(aRect.x, aRect.y, aRect.width, aRect.height));
-    } else
-#endif
     {
         NS_ASSERTION(aSurface->GetType() == gfxASurface::SurfaceTypeXlib,
                      "Non supported platform surface type");
 
         NPEvent pluginEvent;
         XGraphicsExposeEvent& exposeEvent = pluginEvent.xgraphicsexpose;
         exposeEvent.type = GraphicsExpose;
         exposeEvent.display = mWsInfo.display;
@@ -3319,21 +3164,16 @@ PluginInstanceChild::PaintRectToSurface(
         // Work around a bug in Flash up to 10.1 d51 at least, where expose event
         // top left coordinates within the plugin-rect and not at the drawable
         // origin are misinterpreted.  (We can move the top left coordinate
         // provided it is within the clipRect.), see bug 574583
         plPaintRect.SetRect(0, 0, aRect.XMost(), aRect.YMost());
     }
     if (mHelperSurface) {
         // On X11 we can paint to non Xlib surface only with HelperSurface
-#if (MOZ_PLATFORM_MAEMO == 5) || (MOZ_PLATFORM_MAEMO == 6)
-        // Don't use mHelperSurface if surface is image and mMaemoImageRendering is TRUE
-        if (!mMaemoImageRendering ||
-            renderSurface->GetType() != gfxASurface::SurfaceTypeImage)
-#endif
         renderSurface = mHelperSurface;
     }
 #endif
 
     if (mIsTransparent && !CanPaintOnBackground()) {
        // Clear surface content for transparent rendering
        nsRefPtr<gfxContext> ctx = new gfxContext(renderSurface);
        ctx->SetDeviceColor(aColor);
--- a/dom/plugins/ipc/PluginInstanceChild.h
+++ b/dom/plugins/ipc/PluginInstanceChild.h
@@ -95,21 +95,16 @@ protected:
     RecvAsyncSetWindow(const gfxSurfaceType& aSurfaceType,
                        const NPRemoteWindow& aWindow);
 
     virtual void
     DoAsyncSetWindow(const gfxSurfaceType& aSurfaceType,
                      const NPRemoteWindow& aWindow,
                      bool aIsAsync);
 
-    virtual bool
-    AnswerHandleKeyEvent(const nsKeyEvent& aEvent, bool* handled);
-    virtual bool
-    AnswerHandleTextEvent(const nsTextEvent& aEvent, bool* handled);
-
     virtual PPluginSurfaceChild* AllocPPluginSurfaceChild(const WindowsSharedMemoryHandle&,
                                                           const gfxIntSize&, const bool&) {
         return new PPluginSurfaceChild();
     }
 
     virtual bool DeallocPPluginSurfaceChild(PPluginSurfaceChild* s) {
         delete s;
         return true;
@@ -593,34 +588,29 @@ private:
     bool mPendingPluginCall;
 
     // On some platforms, plugins may not support rendering to a surface with
     // alpha, or not support rendering to an image surface.
     // In those cases we need to draw to a temporary platform surface; we cache
     // that surface here.
     nsRefPtr<gfxASurface> mHelperSurface;
 
-    // true when plugin does not support painting to ARGB32 surface
-    // this is false for maemo platform, and false if plugin
-    // supports NPPVpluginTransparentAlphaBool (which is not part of NPAPI yet)
+    // true when plugin does not support painting to ARGB32
+    // surface this is false if plugin supports
+    // NPPVpluginTransparentAlphaBool (which is not part of
+    // NPAPI yet)
     bool mDoAlphaExtraction;
 
     // true when the plugin has painted at least once. We use this to ensure
     // that we ask a plugin to paint at least once even if it's invisible;
     // some plugin (instances) rely on this in order to work properly.
     bool mHasPainted;
 
     // Cached rectangle rendered to previous surface(mBackSurface)
     // Used for reading back to current surface and syncing data,
     // in plugin coordinates.
     nsIntRect mSurfaceDifferenceRect;
-
-#if (MOZ_PLATFORM_MAEMO == 5) || (MOZ_PLATFORM_MAEMO == 6)
-    // Maemo5 Flash does not remember WindowlessLocal state
-    // we should listen for NPP values negotiation and remember it
-    bool                  mMaemoImageRendering;
-#endif
 };
 
 } // namespace plugins
 } // namespace mozilla
 
 #endif // ifndef dom_plugins_PluginInstanceChild_h
--- a/dom/plugins/ipc/PluginInstanceParent.cpp
+++ b/dom/plugins/ipc/PluginInstanceParent.cpp
@@ -681,41 +681,16 @@ PluginInstanceParent::AsyncSetWindow(NPW
 #endif
     if (!SendAsyncSetWindow(gfxPlatform::GetPlatform()->ScreenReferenceSurface()->GetType(),
                             window))
         return NS_ERROR_FAILURE;
 
     return NS_OK;
 }
 
-#if defined(MOZ_WIDGET_QT) && (MOZ_PLATFORM_MAEMO == 6)
-nsresult
-PluginInstanceParent::HandleGUIEvent(const nsGUIEvent& anEvent, bool* handled)
-{
-    switch (anEvent.eventStructType) {
-    case NS_KEY_EVENT:
-        if (!CallHandleKeyEvent(static_cast<const nsKeyEvent&>(anEvent),
-                                handled)) {
-            return NS_ERROR_FAILURE;
-        }
-        break;
-    case NS_TEXT_EVENT:
-        if (!CallHandleTextEvent(static_cast<const nsTextEvent&>(anEvent),
-                                 handled)) {
-            return NS_ERROR_FAILURE;
-        }
-        break;
-    default:
-        NS_ERROR("Not implemented for this event type");
-        return NS_ERROR_FAILURE;
-    }
-    return NS_OK;
-}
-#endif
-
 nsresult
 PluginInstanceParent::GetImageContainer(ImageContainer** aContainer)
 {
 #ifdef XP_MACOSX
     MacIOSurface* ioSurface = NULL;
   
     if (mFrontIOSurface) {
       ioSurface = mFrontIOSurface;
--- a/dom/plugins/ipc/PluginInstanceParent.h
+++ b/dom/plugins/ipc/PluginInstanceParent.h
@@ -273,20 +273,16 @@ public:
     nsresult IsRemoteDrawingCoreAnimation(bool *aDrawing);
     nsresult ContentsScaleFactorChanged(double aContentsScaleFactor);
 #endif
     nsresult SetBackgroundUnknown();
     nsresult BeginUpdateBackground(const nsIntRect& aRect,
                                    gfxContext** aCtx);
     nsresult EndUpdateBackground(gfxContext* aCtx,
                                  const nsIntRect& aRect);
-#if defined(MOZ_WIDGET_QT) && (MOZ_PLATFORM_MAEMO == 6)
-    nsresult HandleGUIEvent(const nsGUIEvent& anEvent, bool* handled);
-#endif
-
     void DidComposite() { unused << SendNPP_DidComposite(); }
 
 private:
     // Create an appropriate platform surface for a background of size
     // |aSize|.  Return true if successful.
     bool CreateBackground(const nsIntSize& aSize);
     void DestroyBackground();
     SurfaceDescriptor BackgroundDescriptor() /*const*/;
--- a/dom/plugins/ipc/PluginLibrary.h
+++ b/dom/plugins/ipc/PluginLibrary.h
@@ -80,17 +80,14 @@ public:
    * PluginInstanceParent.  They approximately follow the ReadbackSink
    * API.
    */
   virtual nsresult SetBackgroundUnknown(NPP instance) = 0;
   virtual nsresult BeginUpdateBackground(NPP instance,
                                          const nsIntRect&, gfxContext**) = 0;
   virtual nsresult EndUpdateBackground(NPP instance,
                                        gfxContext*, const nsIntRect&) = 0;
-#if defined(MOZ_WIDGET_QT) && (MOZ_PLATFORM_MAEMO == 6)
-  virtual nsresult HandleGUIEvent(NPP instance, const nsGUIEvent&, bool*) = 0;
-#endif
 };
 
 
 } // namespace mozilla
 
 #endif  // ifndef mozilla_PluginLibrary_h
--- a/dom/plugins/ipc/PluginModuleChild.cpp
+++ b/dom/plugins/ipc/PluginModuleChild.cpp
@@ -164,24 +164,22 @@ PluginModuleChild::Init(const std::strin
                     getter_AddRefs(localFile));
 
     bool exists;
     localFile->Exists(&exists);
     NS_ASSERTION(exists, "plugin file ain't there");
 
     nsPluginFile pluginFile(localFile);
 
-    // Maemo flash can render with any provided rectangle and so does not
-    // require this quirk.
-#if (defined(MOZ_X11) && !defined(MOZ_PLATFORM_MAEMO)) || defined(OS_MACOSX)
+#if defined(MOZ_X11) || defined(OS_MACOSX)
     nsPluginInfo info = nsPluginInfo();
     if (NS_FAILED(pluginFile.GetPluginInfo(info, &mLibrary)))
         return false;
 
-#if defined(MOZ_X11) && !defined(MOZ_PLATFORM_MAEMO)
+#if defined(MOZ_X11)
     NS_NAMED_LITERAL_CSTRING(flash10Head, "Shockwave Flash 10.");
     if (StringBeginsWith(nsDependentCString(info.fDescription), flash10Head)) {
         AddQuirk(QUIRK_FLASH_EXPOSE_COORD_TRANSLATION);
     }
 #else // defined(OS_MACOSX)
     mozilla::plugins::PluginUtilsOSX::SetProcessName(info.fName);
 #endif
 
--- a/dom/plugins/ipc/PluginModuleParent.cpp
+++ b/dom/plugins/ipc/PluginModuleParent.cpp
@@ -1110,30 +1110,16 @@ PluginModuleParent::AsyncSetWindow(NPP i
 {
     PluginInstanceParent* i = InstCast(instance);
     if (!i)
         return NS_ERROR_FAILURE;
 
     return i->AsyncSetWindow(window);
 }
 
-#if defined(MOZ_WIDGET_QT) && (MOZ_PLATFORM_MAEMO == 6)
-nsresult
-PluginModuleParent::HandleGUIEvent(NPP instance,
-                                   const nsGUIEvent& anEvent,
-                                   bool* handled)
-{
-    PluginInstanceParent* i = InstCast(instance);
-    if (!i)
-        return NS_ERROR_FAILURE;
-
-    return i->HandleGUIEvent(anEvent, handled);
-}
-#endif
-
 nsresult
 PluginModuleParent::GetImageContainer(NPP instance,
                              mozilla::layers::ImageContainer** aContainer)
 {
     PluginInstanceParent* i = InstCast(instance);
     return !i ? NS_ERROR_FAILURE : i->GetImageContainer(aContainer);
 }
 
--- a/dom/plugins/ipc/PluginModuleParent.h
+++ b/dom/plugins/ipc/PluginModuleParent.h
@@ -269,20 +269,16 @@ private:
     virtual nsresult NPP_ClearSiteData(const char* site, uint64_t flags,
                                        uint64_t maxAge);
     virtual nsresult NPP_GetSitesWithData(InfallibleTArray<nsCString>& result);
 
 #if defined(XP_MACOSX)
     virtual nsresult IsRemoteDrawingCoreAnimation(NPP instance, bool *aDrawing);
     virtual nsresult ContentsScaleFactorChanged(NPP instance, double aContentsScaleFactor);
 #endif
-#if defined(MOZ_WIDGET_QT) && (MOZ_PLATFORM_MAEMO == 6)
-    virtual nsresult HandleGUIEvent(NPP instance, const nsGUIEvent& anEvent,
-                                    bool* handled);
-#endif
 
 private:
     CrashReporterParent* CrashReporter();
 
 #ifdef MOZ_CRASHREPORTER
     void ProcessFirstMinidump();
     void WriteExtraDataForMinidump(CrashReporter::AnnotationTable& notes);
 #endif
--- a/dom/src/geolocation/Makefile.in
+++ b/dom/src/geolocation/Makefile.in
@@ -11,21 +11,16 @@ include $(DEPTH)/config/autoconf.mk
 
 LOCAL_INCLUDES = \
 		-I$(topsrcdir)/dom/base \
 		-I$(topsrcdir)/dom/ipc \
 		-I$(topsrcdir)/content/base/src \
 		-I$(topsrcdir)/content/events/src \
 		$(NULL)
 
-ifdef MOZ_MAEMO_LIBLOCATION
-LOCAL_INCLUDES  += $(MOZ_PLATFORM_MAEMO_CFLAGS) \
-                   -I$(topsrcdir)/dom/system/unix \
-                   $(NULL)
-endif
 ifdef MOZ_ENABLE_QTMOBILITY
 LOCAL_INCLUDES  += $(MOZ_QT_CFLAGS) \
                    -I$(topsrcdir)/dom/system/unix \
                    $(NULL)
 endif
 
 ifeq ($(MOZ_WIDGET_TOOLKIT),android)
 LOCAL_INCLUDES  += -I$(topsrcdir)/dom/system/android
--- a/dom/src/geolocation/nsGeolocation.cpp
+++ b/dom/src/geolocation/nsGeolocation.cpp
@@ -22,20 +22,16 @@
 #include "mozilla/Services.h"
 #include "mozilla/unused.h"
 #include "mozilla/Preferences.h"
 #include "mozilla/ClearOnShutdown.h"
 #include "PCOMContentPermissionRequestChild.h"
 
 class nsIPrincipal;
 
-#ifdef MOZ_MAEMO_LIBLOCATION
-#include "MaemoLocationProvider.h"
-#endif
-
 #ifdef MOZ_ENABLE_QTMOBILITY
 #include "QTMLocationProvider.h"
 #endif
 
 #ifdef MOZ_WIDGET_ANDROID
 #include "AndroidLocationProvider.h"
 #endif
 
@@ -676,20 +672,16 @@ nsresult nsGeolocationService::Init()
   nsCOMPtr<nsIObserverService> obs = services::GetObserverService();
   if (!obs) {
     return NS_ERROR_FAILURE;
   }
 
   obs->AddObserver(this, "quit-application", false);
   obs->AddObserver(this, "mozsettings-changed", false);
 
-#ifdef MOZ_MAEMO_LIBLOCATION
-  mProvider = new MaemoLocationProvider();
-#endif
-
 #ifdef MOZ_ENABLE_QTMOBILITY
   mProvider = new QTMLocationProvider();
 #endif
 
 #ifdef MOZ_WIDGET_ANDROID
   mProvider = new AndroidLocationProvider();
 #endif
 
deleted file mode 100644
--- a/dom/system/unix/MaemoLocationProvider.cpp
+++ /dev/null
@@ -1,251 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include <stdio.h>
-#include <math.h>
-#include "nsGeoPosition.h"
-#include "MaemoLocationProvider.h"
-#include "nsIClassInfo.h"
-#include "nsDOMClassInfoID.h"
-#include "nsIServiceManager.h"
-#include "nsServiceManagerUtils.h"
-#include "mozilla/Preferences.h"
-
-using namespace mozilla;
-
-NS_IMPL_ISUPPORTS2(MaemoLocationProvider, nsIGeolocationProvider, nsITimerCallback)
-
-MaemoLocationProvider::MaemoLocationProvider() :
-  mLocationChanged(0),
-  mControlError(0),
-  mDeviceDisconnected(0),
-  mControlStopped(0),
-  mHasSeenLocation(false),
-  mHasGPS(true),
-  mGPSControl(nullptr),
-  mGPSDevice(nullptr),
-  mIgnoreMinorChanges(false),
-  mPrevLat(0.0),
-  mPrevLong(0.0),
-  mIgnoreBigHErr(true),
-  mMaxHErr(1000),
-  mIgnoreBigVErr(true),
-  mMaxVErr(100)
-{
-}
-
-MaemoLocationProvider::~MaemoLocationProvider()
-{
-}
-
-void MaemoLocationProvider::DeviceDisconnected(LocationGPSDevice* device, void* self)
-{
-}
-
-void MaemoLocationProvider::ControlStopped(LocationGPSDControl* device, void* self)
-{
-  MaemoLocationProvider* provider = static_cast<MaemoLocationProvider*>(self);
-  provider->StartControl();
-}
-
-void MaemoLocationProvider::ControlError(LocationGPSDControl* control, void* self)
-{
-}
-
-void MaemoLocationProvider::LocationChanged(LocationGPSDevice* device, void* self)
-{
-  if (!device || !device->fix)
-    return;
-
-  guint32 &fields = device->fix->fields;
-  if (!(fields & LOCATION_GPS_DEVICE_LATLONG_SET))
-    return;
-
-  if (!(device->fix->eph && !isnan(device->fix->eph)))
-    return;
-
-  MaemoLocationProvider* provider = static_cast<MaemoLocationProvider*>(self);
-  NS_ENSURE_TRUE_VOID(provider);
-  provider->LocationUpdate(device);
-}
-
-nsresult
-MaemoLocationProvider::LocationUpdate(LocationGPSDevice* aDev)
-{
-  double hErr = aDev->fix->eph/100;
-  if (mIgnoreBigHErr && hErr > (double)mMaxHErr)
-    hErr = (double)mMaxHErr;
-
-  double vErr = aDev->fix->epv/2;
-  if (mIgnoreBigVErr && vErr > (double)mMaxVErr)
-    vErr = (double)mMaxVErr;
-
-  double altitude = 0, speed = 0, track = 0;
-  if (aDev->fix->epv && !isnan(aDev->fix->epv))
-    altitude = aDev->fix->altitude;
-  if (aDev->fix->eps && !isnan(aDev->fix->eps))
-    speed = aDev->fix->speed;
-  if (aDev->fix->epd && !isnan(aDev->fix->epd))
-    track = aDev->fix->track;
-
-#ifdef DEBUG
-  double dist = location_distance_between(mPrevLat, mPrevLong, aDev->fix->latitude, aDev->fix->longitude)*1000;
-  fprintf(stderr, "dist:%.9f, Lat: %.6f, Long:%.6f, HErr:%g, Alt:%.6f, VErr:%g, dir:%g[%g], sp:%g[%g]\n",
-           dist, aDev->fix->latitude, aDev->fix->longitude,
-           hErr, altitude,
-           aDev->fix->epv/2, track, aDev->fix->epd,
-           speed, aDev->fix->eps);
-  mPrevLat = aDev->fix->latitude;
-  mPrevLong = aDev->fix->longitude;
-#endif
-
-  nsRefPtr<nsGeoPosition> somewhere = new nsGeoPosition(aDev->fix->latitude,
-                                                        aDev->fix->longitude,
-                                                        altitude,
-                                                        hErr,
-                                                        vErr,
-                                                        track,
-                                                        speed,
-                                                        PR_Now());
-  Update(somewhere);
-
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-MaemoLocationProvider::Notify(nsITimer* aTimer)
-{
-  LocationChanged(mGPSDevice, this);
-  return NS_OK;
-}
-
-nsresult
-MaemoLocationProvider::StartControl()
-{
-  if (mGPSControl)
-    return NS_OK;
-
-  mGPSControl = location_gpsd_control_get_default();
-  NS_ENSURE_TRUE(mGPSControl, NS_ERROR_FAILURE);
-
-  mControlError = g_signal_connect(mGPSControl, "error",
-                                   G_CALLBACK(ControlError), this);
-
-  mControlStopped = g_signal_connect(mGPSControl, "gpsd_stopped",
-                                     G_CALLBACK(ControlStopped), this);
-
-  location_gpsd_control_start(mGPSControl);
-  return NS_OK;
-}
-
-nsresult
-MaemoLocationProvider::StartDevice()
-{
-  if (mGPSDevice)
-    return NS_OK;
-
-  mGPSDevice = (LocationGPSDevice*)g_object_new(LOCATION_TYPE_GPS_DEVICE, NULL);
-  NS_ENSURE_TRUE(mGPSDevice, NS_ERROR_FAILURE);
-
-  mLocationChanged    = g_signal_connect(mGPSDevice, "changed",
-                                         G_CALLBACK(LocationChanged), this);
-
-  mDeviceDisconnected = g_signal_connect(mGPSDevice, "disconnected",
-                                         G_CALLBACK(DeviceDisconnected), this);
-  return NS_OK;
-}
-
-NS_IMETHODIMP MaemoLocationProvider::Startup()
-{
-  nsresult rv(NS_OK);
-
-  rv = StartControl();
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  rv = StartDevice();
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  mIgnoreBigHErr =
-    Preferences::GetBool("geo.herror.ignore.big", mIgnoreBigHErr);
-
-  if (mIgnoreBigHErr) {
-    mMaxHErr = Preferences::GetInt("geo.herror.max.value", mMaxHErr);
-  }
-
-  mIgnoreBigVErr =
-    Preferences::GetBool("geo.verror.ignore.big", mIgnoreBigVErr);
-
-  if (mIgnoreBigVErr) {
-    mMaxVErr = Preferences::GetInt("geo.verror.max.value", mMaxVErr);
-  }
-
-  if (mUpdateTimer)
-    return NS_OK;
-
-  // 0 second no timer created
-  int32_t update = Preferences::GetInt("geo.default.update", 0);
-
-  if (!update)
-    return NS_OK;
-
-  mUpdateTimer = do_CreateInstance("@mozilla.org/timer;1", &rv);
-
-  if (NS_FAILED(rv))
-    return NS_ERROR_FAILURE;
-
-  if (update)
-    mUpdateTimer->InitWithCallback(this, update, nsITimer::TYPE_REPEATING_SLACK);
-
-  return NS_OK;
-}
-
-NS_IMETHODIMP MaemoLocationProvider::Watch(nsIGeolocationUpdate *callback)
-{
-  if (mCallback)
-    return NS_OK;
-
-  mCallback = callback;
-  return NS_OK;
-}
-
-NS_IMETHODIMP MaemoLocationProvider::Shutdown()
-{
-  if (mUpdateTimer)
-    mUpdateTimer->Cancel();
-
-  g_signal_handler_disconnect(mGPSDevice, mLocationChanged);
-  g_signal_handler_disconnect(mGPSDevice, mDeviceDisconnected);
-
-  g_signal_handler_disconnect(mGPSDevice, mControlError);
-  g_signal_handler_disconnect(mGPSDevice, mControlStopped);
-
-  mHasSeenLocation = false;
-  mCallback = nullptr;
-
-  if (mGPSControl) {
-    location_gpsd_control_stop(mGPSControl);
-    g_object_unref(mGPSControl);
-    mGPSControl = nullptr;
-  }
-  if (mGPSDevice) {
-    g_object_unref(mGPSDevice);
-    mGPSDevice = nullptr;
-  }
-
-  return NS_OK;
-}
-
-void MaemoLocationProvider::Update(nsIDOMGeoPosition* aPosition)
-{
-  mHasSeenLocation = true;
-  if (mCallback)
-    mCallback->Update(aPosition);
-}
-
-NS_IMETHODIMP
-MaemoLocationProvider::SetHighAccuracy(bool)
-{
-  return NS_OK;
-}
deleted file mode 100644
--- a/dom/system/unix/MaemoLocationProvider.h
+++ /dev/null
@@ -1,85 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "nsCOMPtr.h"
-#include "nsAutoPtr.h"
-#include "nsCOMArray.h"
-#include "nsTArray.h"
-#include "nsITimer.h"
-#include "nsIObserver.h"
-#include "nsIURI.h"
-
-#include "nsWeakPtr.h"
-#include "nsCycleCollectionParticipant.h"
-
-#include "nsIDOMGeoGeolocation.h"
-#include "nsIDOMGeoPosition.h"
-#include "nsIDOMGeoPositionError.h"
-#include "nsIDOMGeoPositionCallback.h"
-#include "nsIDOMGeoPositionErrorCallback.h"
-#include "nsIDOMGeoPositionCoords.h"
-
-#include "nsPIDOMWindow.h"
-
-#include "nsIGeolocationProvider.h"
-
-
-extern "C"
-{
-#include <location/location-gps-device.h>
-#include <location/location-gpsd-control.h>
-#include <location/location-distance-utils.h>
-#include <location/location-misc.h>
-}
-
-class MaemoLocationProvider : public nsIGeolocationProvider,
-                              public nsITimerCallback
-
-{
- public:
-  NS_DECL_ISUPPORTS
-  NS_DECL_NSIGEOLOCATIONPROVIDER
-  NS_DECL_NSITIMERCALLBACK
-
-  MaemoLocationProvider();
-
-  void Update(nsIDOMGeoPosition* aPosition);
-
- private:
-  ~MaemoLocationProvider();
-
-  nsresult StartControl();
-  nsresult StartDevice();
-  nsresult LocationUpdate(LocationGPSDevice* aDev);
-
-  static void DeviceDisconnected(LocationGPSDevice* device, void* self);
-  static void ControlStopped(LocationGPSDControl* device, void* self);
-  static void ControlError(LocationGPSDControl* control, void* self);
-  static void LocationChanged(LocationGPSDevice* device, void* self);
-
-  gulong mLocationChanged;
-  gulong mControlError;
-  gulong mDeviceDisconnected;
-  gulong mControlStopped;
-
-  nsCOMPtr<nsIGeolocationUpdate> mCallback;
-  bool mHasSeenLocation;
-  bool mHasGPS;
-
-  nsCOMPtr<nsITimer> mUpdateTimer;
-  LocationGPSDControl* mGPSControl;
-  LocationGPSDevice* mGPSDevice;
-
-  bool mIgnoreMinorChanges;
-
-  double mPrevLat;
-  double mPrevLong;
-
-  bool mIgnoreBigHErr;
-  int32_t mMaxHErr;
-  bool mIgnoreBigVErr;
-  int32_t mMaxVErr;
-
-};
--- a/dom/system/unix/Makefile.in
+++ b/dom/system/unix/Makefile.in
@@ -5,26 +5,16 @@
 DEPTH       = @DEPTH@
 topsrcdir   = @top_srcdir@
 srcdir      = @srcdir@
 VPATH       = @srcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
 EXPORT_LIBRARY = 1
-ifdef MOZ_MAEMO_LIBLOCATION
-        LOCAL_INCLUDES  += $(MOZ_PLATFORM_MAEMO_CFLAGS) \
-                           -I$(topsrcdir)/dom/src/geolocation \
-                           $(NULL)
-endif
-
-ifdef MOZ_PLATFORM_MAEMO
-LOCAL_INCLUDES  += $(MOZ_DBUS_CFLAGS) \
-                   $(NULL)
-endif
 ifdef MOZ_ENABLE_QTMOBILITY
 LOCAL_INCLUDES  += $(MOZ_QT_CFLAGS) \
                    -I$(topsrcdir)/dom/src/geolocation \
                    $(NULL)
 endif
 
 include $(topsrcdir)/config/rules.mk
 include $(topsrcdir)/ipc/chromium/chromium-config.mk
--- a/dom/system/unix/moz.build
+++ b/dom/system/unix/moz.build
@@ -1,26 +1,16 @@
 # -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
 # vim: set filetype=python:
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 MODULE = 'dom'
 
-if CONFIG['MOZ_MAEMO_LIBLOCATION']:
-    CPP_SOURCES += [
-        'MaemoLocationProvider.cpp',
-    ]
-
-if CONFIG['MOZ_PLATFORM_MAEMO']:
-    CPP_SOURCES += [
-        'nsHapticFeedback.cpp',
-    ]
-
 if CONFIG['MOZ_ENABLE_QTMOBILITY']:
     CPP_SOURCES += [
         'moc_QTMLocationProvider.cpp',
         'QTMLocationProvider.cpp',
     ]
 
 FAIL_ON_WARNINGS = True
 
--- a/gfx/gl/GLContextProvider.h
+++ b/gfx/gl/GLContextProvider.h
@@ -35,17 +35,17 @@ namespace gl {
 
 #ifdef XP_MACOSX
 #define GL_CONTEXT_PROVIDER_NAME GLContextProviderCGL
 #include "GLContextProviderImpl.h"
 #undef GL_CONTEXT_PROVIDER_NAME
 #define GL_CONTEXT_PROVIDER_DEFAULT GLContextProviderCGL
 #endif
 
-#if defined(ANDROID) || defined(MOZ_PLATFORM_MAEMO) || defined(XP_WIN)
+#if defined(ANDROID) || defined(XP_WIN)
 #define GL_CONTEXT_PROVIDER_NAME GLContextProviderEGL
 #include "GLContextProviderImpl.h"
 #undef GL_CONTEXT_PROVIDER_NAME
 #ifndef GL_CONTEXT_PROVIDER_DEFAULT
 #define GL_CONTEXT_PROVIDER_DEFAULT GLContextProviderEGL
 #endif
 #endif
 
--- a/gfx/gl/GLContextProviderEGL.cpp
+++ b/gfx/gl/GLContextProviderEGL.cpp
@@ -117,17 +117,17 @@ public:
 #include "nsThreadUtils.h"
 
 #include "nsIWidget.h"
 
 #include "gfxCrashReporterUtils.h"
 
 using namespace mozilla::gfx;
 
-#if defined(MOZ_PLATFORM_MAEMO) || defined(MOZ_WIDGET_GONK)
+#if defined(MOZ_WIDGET_GONK)
 static bool gUseBackingSurface = true;
 #else
 static bool gUseBackingSurface = false;
 #endif
 
 #ifdef MOZ_WIDGET_GONK
 extern nsIntRect gScreenBounds;
 #endif
@@ -1985,19 +1985,17 @@ GLContextEGL::CreateEGLPixmapOffscreenCo
         return nullptr;
     }
 
     glContext->HoldSurface(thebesSurface);
 
     return glContext.forget();
 }
 
-// Under EGL, if we're under X11, then we have to create a Pixmap
-// because Maemo's EGL implementation doesn't support pbuffers at all
-// for some reason.  On Android, pbuffers are supported fine, though
+// Under EGL, on Android, pbuffers are supported fine, though
 // often without the ability to texture from them directly.
 already_AddRefed<GLContext>
 GLContextProviderEGL::CreateOffscreen(const gfxIntSize& size,
                                       const SurfaceCaps& caps,
                                       ContextFlags flags)
 {
     if (!sEGLLibrary.EnsureInitialized()) {
         return nullptr;
--- a/gfx/gl/moz.build
+++ b/gfx/gl/moz.build
@@ -8,28 +8,22 @@ MODULE = 'gl'
 
 gl_provider = 'Null'
 
 if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows':
     gl_provider = 'WGL'
 elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa':
     gl_provider = 'CGL'
 elif CONFIG['MOZ_WIDGET_GTK']:
-    if CONFIG['MOZ_PLATFORM_MAEMO']:
-        gl_provider = 'EGL'
-    else:
-        if CONFIG['MOZ_EGL_XRENDER_COMPOSITE']:
-            gl_provider = 'EGL'
-        else:
-            gl_provider = 'GLX'
-elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'qt':
-    if CONFIG['MOZ_PLATFORM_MAEMO']:
+    if CONFIG['MOZ_EGL_XRENDER_COMPOSITE']:
         gl_provider = 'EGL'
     else:
         gl_provider = 'GLX'
+elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'qt':
+    gl_provider = 'GLX'
 elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'android':
     gl_provider = 'EGL'
 elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk':
     gl_provider = 'EGL'
 
 if CONFIG['MOZ_GL_PROVIDER']:
     gl_provider = CONFIG['MOZ_GL_PROVIDER']
 
--- a/gfx/layers/ipc/ISurfaceAllocator.cpp
+++ b/gfx/layers/ipc/ISurfaceAllocator.cpp
@@ -24,26 +24,17 @@
 
 using namespace mozilla::ipc;
 
 namespace mozilla {
 namespace layers {
 
 SharedMemory::SharedMemoryType OptimalShmemType()
 {
-#if defined(MOZ_PLATFORM_MAEMO) && defined(MOZ_HAVE_SHAREDMEMORYSYSV)
-  // Use SysV memory because maemo5 on the N900 only allots 64MB to
-  // /dev/shm, even though it has 1GB(!!) of system memory.  Sys V shm
-  // is allocated from a different pool.  We don't want an arbitrary
-  // cap that's much much lower than available memory on the memory we
-  // use for layers.
-  return SharedMemory::TYPE_SYSV;
-#else
   return SharedMemory::TYPE_BASIC;
-#endif
 }
 
 bool
 IsSurfaceDescriptorValid(const SurfaceDescriptor& aSurface)
 {
   return aSurface.type() != SurfaceDescriptor::T__None &&
          aSurface.type() != SurfaceDescriptor::Tnull_t;
 }
--- a/gfx/thebes/gfxPlatformGtk.h
+++ b/gfx/thebes/gfxPlatformGtk.h
@@ -94,28 +94,17 @@ public:
     static void SetGdkDrawable(gfxASurface *target,
                                GdkDrawable *drawable);
     static GdkDrawable *GetGdkDrawable(gfxASurface *target);
 #endif
 
     static int32_t GetDPI();
 
     bool UseXRender() {
-#if defined(MOZ_X11) && defined(MOZ_PLATFORM_MAEMO)
-        // XRender is not accelerated on the Maemo at the moment, and 
-        // X server pixman is out of our control; it's likely to be 
-        // older than (our) cairo's.   So fall back on software 
-        // rendering for more predictable performance.
-        // This setting will likely not be relevant when we have
-        // GL-accelerated compositing. We know of other platforms 
-        // with bad drivers where we'd like to also use client side 
-        // rendering, but until we have the ability to featuer test 
-        // this, we'll only disable this for maemo.
-        return true;
-#elif defined(MOZ_X11)
+#if defined(MOZ_X11)
         if (GetContentBackend() != mozilla::gfx::BACKEND_NONE &&
             GetContentBackend() != mozilla::gfx::BACKEND_CAIRO)
             return false;
 
         return sUseXRender;
 #else
         return false;
 #endif
--- a/js/src/build/autoconf/arch.m4
+++ b/js/src/build/autoconf/arch.m4
@@ -32,26 +32,16 @@ if test -z "$MOZ_ARCH"; then
         MOZ_ARCH=armv7-a
         MOZ_FPU=vfp
         MOZ_FLOAT_ABI=softfp
         ;;
     arm-Darwin)
         MOZ_ARCH=toolchain-default
         MOZ_THUMB=yes
         ;;
-    arm-*)
-        if test -n "$MOZ_PLATFORM_MAEMO"; then
-            MOZ_THUMB=no
-            MOZ_ARCH=armv7-a
-            MOZ_FLOAT_ABI=softfp
-        fi
-        if test "$MOZ_PLATFORM_MAEMO" = 6; then
-            MOZ_THUMB=yes
-        fi
-        ;;
     esac
 fi
 
 if test "$MOZ_ARCH" = "armv6" -a "$OS_TARGET" = "Android"; then
    MOZ_FPU=vfp
 fi
 
 MOZ_ARG_WITH_STRING(thumb,
--- a/js/src/config/system-headers
+++ b/js/src/config/system-headers
@@ -1054,42 +1054,27 @@ libsn/sn-monitor.h
 libsn/sn-util.h
 #endif
 #if MOZ_NATIVE_HUNSPELL==1
 hunspell.hxx
 #endif
 #if MOZ_NATIVE_BZ2==1
 bzlib.h
 #endif
-#if MOZ_PLATFORM_MAEMO==5
-hildon-uri.h
-hildon-mime.h
-hildon-file-chooser-dialog.h
-libosso.h
-osso-mem.h
-#endif
 #ifdef MOZ_ENABLE_GIO
 gio/gio.h
 #endif
-#ifdef MOZ_ENABLE_LIBCONIC
-conic/conicconnection.h
-conic/conicconnectionevent.h
-conic/conicstatisticsevent.h
-#endif
 #if MOZ_NATIVE_LIBEVENT==1
 event.h
 #else
 sys/event.h
 #endif
 #ifdef MOZ_ENABLE_LIBPROXY
 proxy.h
 #endif
-#if MOZ_PLATFORM_MAEMO==6
-contentaction/contentaction.h
-#endif
 #ifdef MOZ_ENABLE_CONTENTMANAGER
 SelectSingleContentItemPage.h
 SelectMultipleContentItemsPage.h
 QtSparql/qsparqlconnection.h
 QtSparql/qsparqlquery.h
 QtSparql/qsparqlresult.h
 #endif
 
--- a/layout/build/nsLayoutModule.cpp
+++ b/layout/build/nsLayoutModule.cpp
@@ -144,17 +144,17 @@ using mozilla::dom::AudioChannelAgent;
 #include "nsTextServicesCID.h"
 
 #include "nsScriptSecurityManager.h"
 #include "nsPrincipal.h"
 #include "nsSystemPrincipal.h"
 #include "nsNullPrincipal.h"
 #include "nsNetCID.h"
 #ifndef MOZ_WIDGET_GONK
-#if defined(MOZ_WIDGET_ANDROID) || defined(MOZ_PLATFORM_MAEMO)
+#if defined(MOZ_WIDGET_ANDROID)
 #include "nsHapticFeedback.h"
 #endif
 #endif
 #include "nsParserUtils.h"
 
 #define NS_EDITORCOMMANDTABLE_CID \
 { 0x4f5e62b8, 0xd659, 0x4156, { 0x84, 0xfc, 0x2f, 0x60, 0x99, 0x40, 0x03, 0x69 }}
 
@@ -307,17 +307,17 @@ NS_GENERIC_FACTORY_CONSTRUCTOR(AudioMana
 NS_GENERIC_FACTORY_CONSTRUCTOR(FMRadio)
 #endif
 
 NS_GENERIC_FACTORY_CONSTRUCTOR(AudioChannelAgent)
 
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsDeviceSensors)
 
 #ifndef MOZ_WIDGET_GONK
-#if defined(ANDROID) || defined(MOZ_PLATFORM_MAEMO)
+#if defined(ANDROID)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsHapticFeedback)
 #endif
 #endif
 NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(ThirdPartyUtil, Init)
 NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsISmsService,
                                          SmsServicesFactory::CreateSmsService)
 NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsIMmsService,
                                          SmsServicesFactory::CreateMmsService)
@@ -789,17 +789,17 @@ NS_DEFINE_NAMED_CID(NS_PRINCIPAL_CID);
 NS_DEFINE_NAMED_CID(NS_SYSTEMPRINCIPAL_CID);
 NS_DEFINE_NAMED_CID(NS_NULLPRINCIPAL_CID);
 NS_DEFINE_NAMED_CID(NS_SECURITYNAMESET_CID);
 NS_DEFINE_NAMED_CID(THIRDPARTYUTIL_CID);
 NS_DEFINE_NAMED_CID(NS_STRUCTUREDCLONECONTAINER_CID);
 NS_DEFINE_NAMED_CID(NS_DEVICE_SENSORS_CID);
 
 #ifndef MOZ_WIDGET_GONK
-#if defined(ANDROID) || defined(MOZ_PLATFORM_MAEMO)
+#if defined(ANDROID)
 NS_DEFINE_NAMED_CID(NS_HAPTICFEEDBACK_CID);
 #endif
 #endif
 NS_DEFINE_NAMED_CID(SMS_SERVICE_CID);
 NS_DEFINE_NAMED_CID(MMS_SERVICE_CID);
 NS_DEFINE_NAMED_CID(MOBILE_MESSAGE_SERVICE_CID);
 NS_DEFINE_NAMED_CID(MOBILE_MESSAGE_DATABASE_SERVICE_CID);
 NS_DEFINE_NAMED_CID(NS_POWERMANAGERSERVICE_CID);
@@ -1077,17 +1077,17 @@ static const mozilla::Module::CIDEntry k
   { &kNSCHANNELPOLICY_CID, false, NULL, nsChannelPolicyConstructor },
   { &kNS_SCRIPTSECURITYMANAGER_CID, false, NULL, Construct_nsIScriptSecurityManager },
   { &kNS_PRINCIPAL_CID, false, NULL, nsPrincipalConstructor },
   { &kNS_SYSTEMPRINCIPAL_CID, false, NULL, nsSystemPrincipalConstructor },
   { &kNS_NULLPRINCIPAL_CID, false, NULL, nsNullPrincipalConstructor },
   { &kNS_SECURITYNAMESET_CID, false, NULL, nsSecurityNameSetConstructor },
   { &kNS_DEVICE_SENSORS_CID, false, NULL, nsDeviceSensorsConstructor },
 #ifndef MOZ_WIDGET_GONK
-#if defined(ANDROID) || defined(MOZ_PLATFORM_MAEMO)
+#if defined(ANDROID)
   { &kNS_HAPTICFEEDBACK_CID, false, NULL, nsHapticFeedbackConstructor },
 #endif
 #endif
   { &kTHIRDPARTYUTIL_CID, false, NULL, ThirdPartyUtilConstructor },
   { &kNS_STRUCTUREDCLONECONTAINER_CID, false, NULL, nsStructuredCloneContainerConstructor },
   { &kSMS_SERVICE_CID, false, NULL, nsISmsServiceConstructor },
   { &kMMS_SERVICE_CID, false, NULL, nsIMmsServiceConstructor },
   { &kMOBILE_MESSAGE_SERVICE_CID, false, NULL, nsIMobileMessageServiceConstructor },
@@ -1234,17 +1234,17 @@ static const mozilla::Module::ContractID
   { NS_SCRIPTSECURITYMANAGER_CONTRACTID, &kNS_SCRIPTSECURITYMANAGER_CID },
   { NS_GLOBAL_CHANNELEVENTSINK_CONTRACTID, &kNS_SCRIPTSECURITYMANAGER_CID },
   { NS_PRINCIPAL_CONTRACTID, &kNS_PRINCIPAL_CID },
   { NS_SYSTEMPRINCIPAL_CONTRACTID, &kNS_SYSTEMPRINCIPAL_CID },
   { NS_NULLPRINCIPAL_CONTRACTID, &kNS_NULLPRINCIPAL_CID },
   { NS_SECURITYNAMESET_CONTRACTID, &kNS_SECURITYNAMESET_CID },
   { NS_DEVICE_SENSORS_CONTRACTID, &kNS_DEVICE_SENSORS_CID },
 #ifndef MOZ_WIDGET_GONK
-#if defined(ANDROID) || defined(MOZ_PLATFORM_MAEMO)
+#if defined(ANDROID)
   { "@mozilla.org/widget/hapticfeedback;1", &kNS_HAPTICFEEDBACK_CID },
 #endif
 #endif
   { THIRDPARTYUTIL_CONTRACTID, &kTHIRDPARTYUTIL_CID },
   { NS_STRUCTUREDCLONECONTAINER_CONTRACTID, &kNS_STRUCTUREDCLONECONTAINER_CID },
   { SMS_SERVICE_CONTRACTID, &kSMS_SERVICE_CID },
   { MMS_SERVICE_CONTRACTID, &kMMS_SERVICE_CID },
   { MOBILE_MESSAGE_SERVICE_CONTRACTID, &kMOBILE_MESSAGE_SERVICE_CID },
--- a/layout/style/nsCSSRuleProcessor.cpp
+++ b/layout/style/nsCSSRuleProcessor.cpp
@@ -1182,21 +1182,16 @@ InitSystemMetrics()
     sSystemMetrics->AppendElement(nsGkAtoms::windows_classic);
   }
 
   rv = LookAndFeel::GetInt(LookAndFeel::eIntID_TouchEnabled, &metricResult);
   if (NS_SUCCEEDED(rv) && metricResult) {
     sSystemMetrics->AppendElement(nsGkAtoms::touch_enabled);
   }
  
-  rv = LookAndFeel::GetInt(LookAndFeel::eIntID_MaemoClassic, &metricResult);
-  if (NS_SUCCEEDED(rv) && metricResult) {
-    sSystemMetrics->AppendElement(nsGkAtoms::maemo_classic);
-  }
-
   rv = LookAndFeel::GetInt(LookAndFeel::eIntID_SwipeAnimationEnabled,
                            &metricResult);
   if (NS_SUCCEEDED(rv) && metricResult) {
     sSystemMetrics->AppendElement(nsGkAtoms::swipe_animation_enabled);
   }
 
   rv = LookAndFeel::GetInt(LookAndFeel::eIntID_PhysicalHomeButton,
                            &metricResult);
--- a/layout/style/nsMediaFeatures.cpp
+++ b/layout/style/nsMediaFeatures.cpp
@@ -588,23 +588,16 @@ nsMediaFeatures::features[] = {
     {
         &nsGkAtoms::_moz_touch_enabled,
         nsMediaFeature::eMinMaxNotAllowed,
         nsMediaFeature::eBoolInteger,
         { &nsGkAtoms::touch_enabled },
         GetSystemMetric
     },
     {
-        &nsGkAtoms::_moz_maemo_classic,
-        nsMediaFeature::eMinMaxNotAllowed,
-        nsMediaFeature::eBoolInteger,
-        { &nsGkAtoms::maemo_classic },
-        GetSystemMetric
-    },
-    {
         &nsGkAtoms::_moz_menubar_drag,
         nsMediaFeature::eMinMaxNotAllowed,
         nsMediaFeature::eBoolInteger,
         { &nsGkAtoms::menubar_drag },
         GetSystemMetric
     },
     {
         &nsGkAtoms::_moz_windows_theme,
--- a/layout/style/test/test_media_queries.html
+++ b/layout/style/test/test_media_queries.html
@@ -597,17 +597,16 @@ function run() {
   expression_should_be_parseable("-moz-overlay-scrollbars");
   expression_should_be_parseable("-moz-windows-default-theme");
   expression_should_be_parseable("-moz-mac-graphite-theme");
   expression_should_be_parseable("-moz-mac-lion-theme");
   expression_should_be_parseable("-moz-windows-compositor");
   expression_should_be_parseable("-moz-windows-classic");
   expression_should_be_parseable("-moz-windows-glass");
   expression_should_be_parseable("-moz-touch-enabled");
-  expression_should_be_parseable("-moz-maemo-classic");
   expression_should_be_parseable("-moz-swipe-animation-enabled");
 
   expression_should_be_parseable("-moz-scrollbar-start-backward: 0");
   expression_should_be_parseable("-moz-scrollbar-start-forward: 0");
   expression_should_be_parseable("-moz-scrollbar-end-backward: 0");
   expression_should_be_parseable("-moz-scrollbar-end-forward: 0");
   expression_should_be_parseable("-moz-scrollbar-thumb-proportional: 0");
   expression_should_be_parseable("-moz-images-in-menus: 0");
@@ -615,17 +614,16 @@ function run() {
   expression_should_be_parseable("-moz-overlay-scrollbars: 0");
   expression_should_be_parseable("-moz-windows-default-theme: 0");
   expression_should_be_parseable("-moz-mac-graphite-theme: 0");
   expression_should_be_parseable("-moz-mac-lion-theme: 0");
   expression_should_be_parseable("-moz-windows-compositor: 0");
   expression_should_be_parseable("-moz-windows-classic: 0");
   expression_should_be_parseable("-moz-windows-glass: 0");
   expression_should_be_parseable("-moz-touch-enabled: 0");
-  expression_should_be_parseable("-moz-maemo-classic: 0");
   expression_should_be_parseable("-moz-swipe-animation-enabled: 0");
 
   expression_should_be_parseable("-moz-scrollbar-start-backward: 1");
   expression_should_be_parseable("-moz-scrollbar-start-forward: 1");
   expression_should_be_parseable("-moz-scrollbar-end-backward: 1");
   expression_should_be_parseable("-moz-scrollbar-end-forward: 1");
   expression_should_be_parseable("-moz-scrollbar-thumb-proportional: 1");
   expression_should_be_parseable("-moz-images-in-menus: 1");
@@ -633,17 +631,16 @@ function run() {
   expression_should_be_parseable("-moz-overlay-scrollbars: 1");
   expression_should_be_parseable("-moz-windows-default-theme: 1");
   expression_should_be_parseable("-moz-mac-graphite-theme: 1");
   expression_should_be_parseable("-moz-mac-lion-theme: 1");
   expression_should_be_parseable("-moz-windows-compositor: 1");
   expression_should_be_parseable("-moz-windows-classic: 1");
   expression_should_be_parseable("-moz-windows-glass: 1");
   expression_should_be_parseable("-moz-touch-enabled: 1");
-  expression_should_be_parseable("-moz-maemo-classic: 1");
   expression_should_be_parseable("-moz-swipe-animation-enabled: 1");
 
   expression_should_not_be_parseable("-moz-scrollbar-start-backward: -1");
   expression_should_not_be_parseable("-moz-scrollbar-start-forward: -1");
   expression_should_not_be_parseable("-moz-scrollbar-end-backward: -1");
   expression_should_not_be_parseable("-moz-scrollbar-end-forward: -1");
   expression_should_not_be_parseable("-moz-scrollbar-thumb-proportional: -1");
   expression_should_not_be_parseable("-moz-images-in-menus: -1");
@@ -651,17 +648,16 @@ function run() {
   expression_should_not_be_parseable("-moz-overlay-scrollbars: -1");
   expression_should_not_be_parseable("-moz-windows-default-theme: -1");
   expression_should_not_be_parseable("-moz-mac-graphite-theme: -1");
   expression_should_not_be_parseable("-moz-mac-lion-theme: -1");
   expression_should_not_be_parseable("-moz-windows-compositor: -1");
   expression_should_not_be_parseable("-moz-windows-classic: -1");
   expression_should_not_be_parseable("-moz-windows-glass: -1");
   expression_should_not_be_parseable("-moz-touch-enabled: -1");
-  expression_should_not_be_parseable("-moz-maemo-classic: -1");
   expression_should_not_be_parseable("-moz-swipe-animation-enabled: -1");
 
   expression_should_not_be_parseable("-moz-scrollbar-start-backward: true");
   expression_should_not_be_parseable("-moz-scrollbar-start-forward: true");
   expression_should_not_be_parseable("-moz-scrollbar-end-backward: true");
   expression_should_not_be_parseable("-moz-scrollbar-end-forward: true");
   expression_should_not_be_parseable("-moz-scrollbar-thumb-proportional: true");
   expression_should_not_be_parseable("-moz-images-in-menus: true");
@@ -669,17 +665,16 @@ function run() {
   expression_should_not_be_parseable("-moz-overlay-scrollbars: true");
   expression_should_not_be_parseable("-moz-windows-default-theme: true");
   expression_should_not_be_parseable("-moz-mac-graphite-theme: true");
   expression_should_not_be_parseable("-moz-mac-lion-theme: true");
   expression_should_not_be_parseable("-moz-windows-compositor: true");
   expression_should_not_be_parseable("-moz-windows-classic: true");
   expression_should_not_be_parseable("-moz-windows-glass: true");
   expression_should_not_be_parseable("-moz-touch-enabled: true");
-  expression_should_not_be_parseable("-moz-maemo-classic: true");
   expression_should_not_be_parseable("-moz-swipe-animation-enabled: true");
 
   // windows theme media queries
   expression_should_be_parseable("-moz-windows-theme: aero");
   expression_should_be_parseable("-moz-windows-theme: aero-lite");
   expression_should_be_parseable("-moz-windows-theme: luna-blue");
   expression_should_be_parseable("-moz-windows-theme: luna-olive");
   expression_should_be_parseable("-moz-windows-theme: luna-silver");
--- a/mobile/android/app/mobile.js
+++ b/mobile/android/app/mobile.js
@@ -218,17 +218,16 @@ pref("dom.disable_window_find", true);
 
 pref("keyword.enabled", true);
 
 pref("accessibility.typeaheadfind", false);
 pref("accessibility.typeaheadfind.timeout", 5000);
 pref("accessibility.typeaheadfind.flashBar", 1);
 pref("accessibility.typeaheadfind.linksonly", false);
 pref("accessibility.typeaheadfind.casesensitive", 0);
-// zoom key(F7) conflicts with caret browsing on maemo
 pref("accessibility.browsewithcaret_shortcut.enabled", false);
 
 // Whether the character encoding menu is under the main Firefox button. This
 // preference is a string so that localizers can alter it.
 pref("browser.menu.showCharacterEncoding", "chrome://browser/locale/browser.properties");
 pref("intl.charsetmenu.browser.static", "chrome://browser/locale/browser.properties");
 
 // pointer to the default engine name
--- a/netwerk/base/src/Makefile.in
+++ b/netwerk/base/src/Makefile.in
@@ -8,25 +8,20 @@ DEPTH		= @DEPTH@
 topsrcdir	= @top_srcdir@
 srcdir		= @srcdir@
 VPATH		= @srcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
 LOCAL_INCLUDES	+= -I$(topsrcdir)/dom/base
 
-ifdef MOZ_PLATFORM_MAEMO
-ifdef MOZ_ENABLE_LIBCONIC
-	LOCAL_INCLUDES += -I$(srcdir)/../../system/maemo
-endif
 ifdef MOZ_ENABLE_QTNETWORK
 	LOCAL_INCLUDES += -I$(srcdir)/../../system/qt
 	OS_INCLUDES += $(MOZ_QT_CFLAGS)
 endif
-endif
 
 include $(topsrcdir)/config/rules.mk
 include $(topsrcdir)/ipc/chromium/chromium-config.mk
 
 ifeq ($(OS_TARGET),Android)
 # this works around a "branch out of range" error when compiling this file opt
 nsURLParsers.$(OBJ_SUFFIX): MOZ_OPTIMIZE_FLAGS=
 endif
--- a/netwerk/base/src/moz.build
+++ b/netwerk/base/src/moz.build
@@ -89,28 +89,20 @@ elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'co
     CPP_SOURCES += [
         'nsURLHelperOSX.cpp',
     ]
 else:
     CPP_SOURCES += [
         'nsURLHelperUnix.cpp',
     ]
 
-if CONFIG['MOZ_PLATFORM_MAEMO']:
+if CONFIG['MOZ_ENABLE_QTNETWORK']:
     CPP_SOURCES += [
-        'nsNativeConnectionHelper.cpp',
+        'nsAutodialQt.cpp',
     ]
-    if CONFIG['MOZ_ENABLE_LIBCONIC']:
-        CPP_SOURCES += [
-            'nsAutodialMaemo.cpp',
-        ]
-    if CONFIG['MOZ_ENABLE_QTNETWORK']:
-        CPP_SOURCES += [
-            'nsAutodialQt.cpp',
-        ]
 
 EXTRA_JS_MODULES += [
     'NetUtil.jsm',
 ]
 
 FAIL_ON_WARNINGS = True
 
 LIBXUL_LIBRARY = True
deleted file mode 100644
--- a/netwerk/base/src/nsAutodialMaemo.cpp
+++ /dev/null
@@ -1,44 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "nsAutodialMaemo.h"
-#include "nsNetCID.h"
-#include "nsCOMPtr.h"
-#include "nsIPrefBranch.h"
-#include "nsIPrefService.h"
-#include "nsIServiceManager.h"
-#include "nsMaemoNetworkManager.h"
-
-
-nsAutodial::nsAutodial()
-{
-}
-
-nsAutodial::~nsAutodial()
-{
-}
-
-nsresult
-nsAutodial::Init()
-{
-  return NS_OK;
-}
-
-nsresult
-nsAutodial::DialDefault(const PRUnichar* hostName)
-{
-  if (nsMaemoNetworkManager::OpenConnectionSync())
-    return NS_OK;
-
-  return NS_ERROR_FAILURE;
-}
-
-bool
-nsAutodial::ShouldDialOnNetworkError()
-{
-  if (nsMaemoNetworkManager::IsConnected())
-    return false;
-
-  return true;
-}
deleted file mode 100644
--- a/netwerk/base/src/nsAutodialMaemo.h
+++ /dev/null
@@ -1,26 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef nsAutodialMaemo_h__
-#define nsAutodialMaemo_h__
-
-#include "nspr.h"
-#include "nscore.h"
-
-class nsAutodial
-{
-public:
-    nsAutodial();
-    ~nsAutodial();
-
-    nsresult Init();
-
-    // Dial the default RAS dialup connection.
-    nsresult DialDefault(const PRUnichar* hostName);
-
-    // Should we try to dial on network error?
-    bool ShouldDialOnNetworkError();
-};
-
-#endif /* nsAutodialMaemo_h__ */
--- a/netwerk/base/src/nsIOService.cpp
+++ b/netwerk/base/src/nsIOService.cpp
@@ -40,17 +40,17 @@
 #include "nsTArray.h"
 #include "nsIConsoleService.h"
 #include "nsIUploadChannel2.h"
 #include "nsXULAppAPI.h"
 #include "nsIProxiedChannel.h"
 #include "nsIProtocolProxyCallback.h"
 #include "nsICancelable.h"
 
-#if defined(XP_WIN) || defined(MOZ_PLATFORM_MAEMO)
+#if defined(XP_WIN)
 #include "nsNativeConnectionHelper.h"
 #endif
 
 using namespace mozilla;
 
 #define PORT_PREF_PREFIX           "network.security.ports."
 #define PORT_PREF(x)               PORT_PREF_PREFIX x
 #define AUTODIAL_PREF              "network.autodial-helper.enabled"
@@ -1100,20 +1100,21 @@ nsIOService::TrackNetworkLinkStatusForOf
     // check to make sure this won't collide with Autodial
     if (mSocketTransportService) {
         bool autodialEnabled = false;
         mSocketTransportService->GetAutodialEnabled(&autodialEnabled);
         // If autodialing-on-link-down is enabled, check if the OS auto dial 
         // option is set to always autodial. If so, then we are 
         // always up for the purposes of offline management.
         if (autodialEnabled) {
-#if defined(XP_WIN) || defined(MOZ_PLATFORM_MAEMO)
-            // On Windows and Maemo (libconic) we should first check with the OS
-            // to see if autodial is enabled.  If it is enabled then we are
-            // allowed to manage the offline state.
+#if defined(XP_WIN)
+            // On Windows, we should first check with the OS
+            // to see if autodial is enabled.  If it is
+            // enabled then we are allowed to manage the
+            // offline state.
             if(nsNativeConnectionHelper::IsAutodialEnabled()) 
                 return SetOffline(false);
 #else
             return SetOffline(false);
 #endif
         }
     }
 
--- a/netwerk/base/src/nsNativeConnectionHelper.cpp
+++ b/netwerk/base/src/nsNativeConnectionHelper.cpp
@@ -1,37 +1,25 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsNativeConnectionHelper.h"
-
-#if defined(MOZ_PLATFORM_MAEMO)
-#include "nsAutodialMaemo.h"
-#else
 #include "nsAutodialWin.h"
-#endif
-
 #include "nsIOService.h"
 
 //-----------------------------------------------------------------------------
 // API typically invoked on the socket transport thread
 //-----------------------------------------------------------------------------
 
 bool
 nsNativeConnectionHelper::OnConnectionFailed(const PRUnichar* hostName)
 {
-  // On mobile platforms, instead of relying on the link service, we
-  // should ask the dialer directly.  This allows the dialer to update
-  // link status more forcefully rather than passively watching link
-  // status changes.
-#if !defined(MOZ_PLATFORM_MAEMO)
     if (gIOService->IsLinkUp())
         return false;
-#endif
 
     nsAutodial autodial;
     if (autodial.ShouldDialOnNetworkError())
         return NS_SUCCEEDED(autodial.DialDefault(hostName));
 
     return false;
 }
 
--- a/netwerk/base/src/nsSocketTransport2.cpp
+++ b/netwerk/base/src/nsSocketTransport2.cpp
@@ -32,17 +32,17 @@
 #include "nsISocketProvider.h"
 #include "nsISSLSocketControl.h"
 #include "nsINSSErrorsService.h"
 #include "nsIPipe.h"
 #include "nsIProgrammingLanguage.h"
 #include "nsIClassInfoImpl.h"
 #include <algorithm>
 
-#if defined(XP_WIN) || defined(MOZ_PLATFORM_MAEMO)
+#if defined(XP_WIN)
 #include "nsNativeConnectionHelper.h"
 #endif
 
 using namespace mozilla;
 using namespace mozilla::net;
 
 //-----------------------------------------------------------------------------
 
@@ -1296,17 +1296,17 @@ nsSocketTransport::RecoverFromError()
             SOCKET_LOG(("  failed to connect all ipv4-only or ipv6-only hosts,"
                         " trying lookup/connect again with both ipv4/ipv6\n"));
             mState = STATE_CLOSED;
             mConnectionFlags &= ~(DISABLE_IPV6 | DISABLE_IPV4);
             tryAgain = true;
         }
     }
 
-#if defined(XP_WIN) || defined(MOZ_PLATFORM_MAEMO)
+#if defined(XP_WIN)
     // If not trying next address, try to make a connection using dialup. 
     // Retry if that connection is made.
     if (!tryAgain) {
         bool autodialEnabled;
         gSocketTransportService->GetAutodialEnabled(&autodialEnabled);
         if (autodialEnabled) {
           tryAgain = nsNativeConnectionHelper::OnConnectionFailed(
                        NS_ConvertUTF8toUTF16(SocketHost()).get());
--- a/netwerk/build/Makefile.in
+++ b/netwerk/build/Makefile.in
@@ -43,21 +43,16 @@ ifeq ($(OS_ARCH),WINNT)
         ../system/win32/$(LIB_PREFIX)neckosystem_s.$(LIB_SUFFIX)
 endif
 
 ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
     SHARED_LIBRARY_LIBS += \
         ../system/mac/$(LIB_PREFIX)neckosystem_s.$(LIB_SUFFIX)
 endif
 
-ifdef MOZ_ENABLE_LIBCONIC
-    SHARED_LIBRARY_LIBS += \
-        ../system/maemo/$(LIB_PREFIX)neckosystem_s.$(LIB_SUFFIX)
-endif
-
 ifdef MOZ_ENABLE_QTNETWORK
     SHARED_LIBRARY_LIBS += \
         ../system/qt/$(LIB_PREFIX)neckosystem_s.$(LIB_SUFFIX)
 endif
 
 ifeq (android,$(MOZ_WIDGET_TOOLKIT))
     SHARED_LIBRARY_LIBS += \
         ../system/android/$(LIB_PREFIX)neckosystem_s.$(LIB_SUFFIX)
@@ -85,20 +80,16 @@ LOCAL_INCLUDES = \
 ifeq ($(OS_ARCH),WINNT)
     LOCAL_INCLUDES += -I$(srcdir)/../system/win32
 endif
 
 ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
     LOCAL_INCLUDES += -I$(srcdir)/../system/mac
 endif
 
-ifdef MOZ_ENABLE_LIBCONIC
-    LOCAL_INCLUDES += -I$(srcdir)/../system/maemo
-endif
-
 ifdef MOZ_ENABLE_QTNETWORK
     LOCAL_INCLUDES += -I$(srcdir)/../system/qt
 endif
 
 ifeq (android,$(MOZ_WIDGET_TOOLKIT))
     LOCAL_INCLUDES += -I$(srcdir)/../system/android
 endif
 
--- a/netwerk/build/nsNetModule.cpp
+++ b/netwerk/build/nsNetModule.cpp
@@ -351,19 +351,16 @@ NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsID
 
 ///////////////////////////////////////////////////////////////////////////////
 #if defined(XP_WIN)
 #include "nsNotifyAddrListener.h"
 NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsNotifyAddrListener, Init)
 #elif defined(MOZ_WIDGET_COCOA)
 #include "nsNetworkLinkService.h"
 NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsNetworkLinkService, Init)
-#elif defined(MOZ_ENABLE_LIBCONIC)
-#include "nsMaemoNetworkLinkService.h"
-NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsMaemoNetworkLinkService, Init)
 #elif defined(MOZ_ENABLE_QTNETWORK)
 #include "nsQtNetworkLinkService.h"
 NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsQtNetworkLinkService, Init)
 #elif defined(MOZ_WIDGET_ANDROID)
 #include "nsAndroidNetworkLinkService.h"
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsAndroidNetworkLinkService)
 #endif
 
@@ -798,18 +795,16 @@ NS_DEFINE_NAMED_CID(NS_WYCIWYGPROTOCOLHA
 #ifdef NECKO_PROTOCOL_websocket
 NS_DEFINE_NAMED_CID(NS_WEBSOCKETPROTOCOLHANDLER_CID);
 NS_DEFINE_NAMED_CID(NS_WEBSOCKETSSLPROTOCOLHANDLER_CID);
 #endif
 #if defined(XP_WIN)
 NS_DEFINE_NAMED_CID(NS_NETWORK_LINK_SERVICE_CID);
 #elif defined(MOZ_WIDGET_COCOA)
 NS_DEFINE_NAMED_CID(NS_NETWORK_LINK_SERVICE_CID);
-#elif defined(MOZ_ENABLE_LIBCONIC)
-NS_DEFINE_NAMED_CID(NS_NETWORK_LINK_SERVICE_CID);
 #elif defined(MOZ_ENABLE_QTNETWORK)
 NS_DEFINE_NAMED_CID(NS_NETWORK_LINK_SERVICE_CID);
 #elif defined(MOZ_WIDGET_ANDROID)
 NS_DEFINE_NAMED_CID(NS_NETWORK_LINK_SERVICE_CID);
 #endif
 NS_DEFINE_NAMED_CID(NS_SERIALIZATION_HELPER_CID);
 NS_DEFINE_NAMED_CID(NS_REDIRECTCHANNELREGISTRAR_CID);
 
@@ -939,18 +934,16 @@ static const mozilla::Module::CIDEntry k
       mozilla::net::WebSocketChannelConstructor },
     { &kNS_WEBSOCKETSSLPROTOCOLHANDLER_CID, false, NULL,
       mozilla::net::WebSocketSSLChannelConstructor },
 #endif
 #if defined(XP_WIN)
     { &kNS_NETWORK_LINK_SERVICE_CID, false, NULL, nsNotifyAddrListenerConstructor },
 #elif defined(MOZ_WIDGET_COCOA)
     { &kNS_NETWORK_LINK_SERVICE_CID, false, NULL, nsNetworkLinkServiceConstructor },
-#elif defined(MOZ_ENABLE_LIBCONIC)
-    { &kNS_NETWORK_LINK_SERVICE_CID, false, NULL, nsMaemoNetworkLinkServiceConstructor },
 #elif defined(MOZ_ENABLE_QTNETWORK)
     { &kNS_NETWORK_LINK_SERVICE_CID, false, NULL, nsQtNetworkLinkServiceConstructor },
 #elif defined(MOZ_WIDGET_ANDROID)
     { &kNS_NETWORK_LINK_SERVICE_CID, false, NULL, nsAndroidNetworkLinkServiceConstructor },
 #endif
     { &kNS_SERIALIZATION_HELPER_CID, false, NULL, nsSerializationHelperConstructor },
     { &kNS_REDIRECTCHANNELREGISTRAR_CID, false, NULL, RedirectChannelRegistrarConstructor },
     { NULL }
@@ -1083,18 +1076,16 @@ static const mozilla::Module::ContractID
 #ifdef NECKO_PROTOCOL_websocket
     { NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX "ws", &kNS_WEBSOCKETPROTOCOLHANDLER_CID },
     { NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX "wss", &kNS_WEBSOCKETSSLPROTOCOLHANDLER_CID },
 #endif
 #if defined(XP_WIN)
     { NS_NETWORK_LINK_SERVICE_CONTRACTID, &kNS_NETWORK_LINK_SERVICE_CID },
 #elif defined(MOZ_WIDGET_COCOA)
     { NS_NETWORK_LINK_SERVICE_CONTRACTID, &kNS_NETWORK_LINK_SERVICE_CID },
-#elif defined(MOZ_ENABLE_LIBCONIC)
-    { NS_NETWORK_LINK_SERVICE_CONTRACTID, &kNS_NETWORK_LINK_SERVICE_CID },
 #elif defined(MOZ_ENABLE_QTNETWORK)
     { NS_NETWORK_LINK_SERVICE_CONTRACTID, &kNS_NETWORK_LINK_SERVICE_CID },
 #elif defined(MOZ_WIDGET_ANDROID)
     { NS_NETWORK_LINK_SERVICE_CONTRACTID, &kNS_NETWORK_LINK_SERVICE_CID },
 #endif
     { NS_SERIALIZATION_HELPER_CONTRACTID, &kNS_SERIALIZATION_HELPER_CID },
     { NS_REDIRECTCHANNELREGISTRAR_CONTRACTID, &kNS_REDIRECTCHANNELREGISTRAR_CID },
     { NULL }
--- a/netwerk/protocol/http/nsHttpHandler.cpp
+++ b/netwerk/protocol/http/nsHttpHandler.cpp
@@ -669,25 +669,23 @@ nsHttpHandler::InitUserAgentComponents()
 #if defined(ANDROID)
     "Android"
 #elif defined(XP_OS2)
     "OS/2"
 #elif defined(XP_WIN)
     "Windows"
 #elif defined(XP_MACOSX)
     "Macintosh"
-#elif defined(MOZ_PLATFORM_MAEMO)
-    "Maemo"
 #elif defined(MOZ_X11)
     "X11"
 #endif
     );
 #endif
 
-#if defined(ANDROID) || defined(MOZ_PLATFORM_MAEMO) || defined(MOZ_B2G)
+#if defined(ANDROID) || defined(MOZ_B2G)
     nsCOMPtr<nsIPropertyBag2> infoService = do_GetService("@mozilla.org/system-info;1");
     MOZ_ASSERT(infoService, "Could not find a system info service");
 
     bool isTablet;
     nsresult rv = infoService->GetPropertyAsBool(NS_LITERAL_STRING("tablet"), &isTablet);
     if (NS_SUCCEEDED(rv) && isTablet)
         mCompatDevice.AssignLiteral("Tablet");
     else
deleted file mode 100644
--- a/netwerk/system/maemo/Makefile.in
+++ /dev/null
@@ -1,15 +0,0 @@
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-DEPTH		= @DEPTH@
-topsrcdir	= @top_srcdir@
-srcdir		= @srcdir@
-VPATH		= @srcdir@
-include $(DEPTH)/config/autoconf.mk
-
-include $(topsrcdir)/config/rules.mk
-
-OS_INCLUDES += $(GLIB_CFLAGS) $(LIBCONIC_CFLAGS)
-LOCAL_INCLUDES += -I$(srcdir)/../../base/src
- 
deleted file mode 100644
--- a/netwerk/system/maemo/moz.build
+++ /dev/null
@@ -1,19 +0,0 @@
-# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
-# vim: set filetype=python:
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-MODULE = 'necko'
-
-CPP_SOURCES += [
-    'nsMaemoNetworkLinkService.cpp',
-    'nsMaemoNetworkManager.cpp',
-]
-
-LIBRARY_NAME = 'neckosystem_s'
-
-FAIL_ON_WARNINGS = True
-
-LIBXUL_LIBRARY = True
-
deleted file mode 100644
--- a/netwerk/system/maemo/nsMaemoNetworkLinkService.cpp
+++ /dev/null
@@ -1,85 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=2 et sw=2 tw=80: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "nsMaemoNetworkLinkService.h"
-#include "nsCOMPtr.h"
-#include "nsIObserverService.h"
-#include "nsServiceManagerUtils.h"
-#include "nsString.h"
-#include "nsMaemoNetworkManager.h"
-#include "mozilla/Services.h"
-#include "nsCRT.h"
-
-NS_IMPL_ISUPPORTS2(nsMaemoNetworkLinkService,
-                   nsINetworkLinkService,
-                   nsIObserver)
-
-nsMaemoNetworkLinkService::nsMaemoNetworkLinkService()
-{
-}
-
-nsMaemoNetworkLinkService::~nsMaemoNetworkLinkService()
-{
-}
-
-NS_IMETHODIMP
-nsMaemoNetworkLinkService::GetIsLinkUp(bool *aIsUp)
-{
-  *aIsUp = nsMaemoNetworkManager::IsConnected();
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-nsMaemoNetworkLinkService::GetLinkStatusKnown(bool *aIsKnown)
-{
-  *aIsKnown = nsMaemoNetworkManager::GetLinkStatusKnown();
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-nsMaemoNetworkLinkService::GetLinkType(uint32_t *aLinkType)
-{
-  NS_ENSURE_ARG_POINTER(aLinkType);
-
-  // XXX This function has not yet been implemented for this platform
-  *aLinkType = nsINetworkLinkService::LINK_TYPE_UNKNOWN;
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-nsMaemoNetworkLinkService::Observe(nsISupports *aSubject,
-                                   const char *aTopic,
-                                   const PRUnichar *aData)
-{
-  if (!strcmp(aTopic, "xpcom-shutdown"))
-    Shutdown();
-
-  return NS_OK;
-}
-
-nsresult
-nsMaemoNetworkLinkService::Init(void)
-{
-  nsCOMPtr<nsIObserverService> observerService =
-    mozilla::services::GetObserverService();
-  if (!observerService)
-    return NS_ERROR_FAILURE;
-
-  nsresult rv = observerService->AddObserver(this, "xpcom-shutdown", false);
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  if (!nsMaemoNetworkManager::Startup())
-    return NS_ERROR_FAILURE;
-
-  return NS_OK;
-}
-
-nsresult
-nsMaemoNetworkLinkService::Shutdown()
-{
-  nsMaemoNetworkManager::Shutdown();
-  return NS_OK;
-}
deleted file mode 100644
--- a/netwerk/system/maemo/nsMaemoNetworkLinkService.h
+++ /dev/null
@@ -1,28 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=2 et sw=2 tw=80: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef NSMAEMONETWORKLINKSERVICE_H_
-#define NSMAEMONETWORKLINKSERVICE_H_
-
-#include "nsINetworkLinkService.h"
-#include "nsIObserver.h"
-
-class nsMaemoNetworkLinkService: public nsINetworkLinkService,
-                                 public nsIObserver
-{
-public:
-  NS_DECL_ISUPPORTS
-  NS_DECL_NSINETWORKLINKSERVICE
-  NS_DECL_NSIOBSERVER
-
-  nsMaemoNetworkLinkService();
-  virtual ~nsMaemoNetworkLinkService();
-
-  nsresult Init();
-  nsresult Shutdown();
-};
-
-#endif /* NSMAEMONETWORKLINKSERVICE_H_ */
deleted file mode 100644
--- a/netwerk/system/maemo/nsMaemoNetworkManager.cpp
+++ /dev/null
@@ -1,172 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=2 et sw=2 tw=80: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "nsMaemoNetworkManager.h"
-#include "mozilla/ReentrantMonitor.h"
-
-#include <dbus/dbus.h>
-#include <dbus/dbus-glib-lowlevel.h>
-
-#include <conic/conicconnection.h>
-#include <conic/conicconnectionevent.h>
-#include <conicstatisticsevent.h>
-
-#include <stdio.h>
-#include <unistd.h>
-
-#include "nsIOService.h"
-#include "nsIObserverService.h"
-#include "nsIOService.h"
-#include "nsCOMPtr.h"
-#include "nsThreadUtils.h"
-
-#include "nsINetworkLinkService.h"
-
-enum InternalState
-{
-  InternalState_Invalid = -1,
-  InternalState_Disconnected,
-  InternalState_Connected
-};
-
-static InternalState gInternalState = InternalState_Invalid;
-static ConIcConnection* gConnection = nullptr;
-static bool gConnectionCallbackInvoked = false;
-
-using namespace mozilla;
-
-static ReentrantMonitor* gReentrantMonitor = nullptr;
-
-static void NotifyNetworkLinkObservers()
-{
-  nsCOMPtr<nsIIOService> ioService = do_GetService("@mozilla.org/network/io-service;1");
-  if (!ioService)
-    return;
-
-  ioService->SetOffline(gInternalState != InternalState_Connected);
-}
-
-static void
-connection_event_callback(ConIcConnection *aConnection,
-                          ConIcConnectionEvent *aEvent,
-                          gpointer aUser_data)
-{
-  ConIcConnectionStatus status = con_ic_connection_event_get_status(aEvent);
-  {
-    ReentrantMonitorAutoEnter mon(*gReentrantMonitor);
-
-    // When we are not connected, we are always disconnected.
-    gInternalState = (CON_IC_STATUS_CONNECTED == status ?
-                     InternalState_Connected : InternalState_Disconnected);
-
-    gConnectionCallbackInvoked = true;
-    mon.Notify();
-  }
-
-  NotifyNetworkLinkObservers();
-}
-
-bool
-nsMaemoNetworkManager::OpenConnectionSync()
-{
-  if (NS_IsMainThread() || !gConnection)
-    return false;
-
-  // protect gInternalState.  This also allows us
-  // to block and wait in this method on this thread
-  // until our callback on the main thread.
-  ReentrantMonitorAutoEnter mon(*gReentrantMonitor);
-
-  gConnectionCallbackInvoked = false;
-
-  if (!con_ic_connection_connect(gConnection,
-                                 CON_IC_CONNECT_FLAG_NONE))
-    g_error("openConnectionSync: Error while connecting. %p \n",
-            (void*) PR_GetCurrentThread());
-
-  while (!gConnectionCallbackInvoked)
-    mon.Wait();
-
-  if (gInternalState == InternalState_Connected)
-    return true;
-
-  return false;
-}
-
-void
-nsMaemoNetworkManager::CloseConnection()
-{
-  if (gConnection)
-    con_ic_connection_disconnect(gConnection);
-}
-
-bool
-nsMaemoNetworkManager::IsConnected()
-{
-  return gInternalState == InternalState_Connected;
-}
-
-bool
-nsMaemoNetworkManager::GetLinkStatusKnown()
-{
-  return gInternalState != InternalState_Invalid;
-}
-
-bool
-nsMaemoNetworkManager::Startup()
-{
-  if (gConnection)
-    return true;
-
-  gReentrantMonitor = new ReentrantMonitor("MaemoAutodialer");
-  if (!gReentrantMonitor)
-    return false;
-
-  DBusError error;
-  dbus_error_init(&error);
-
-  DBusConnection* dbusConnection = dbus_bus_get(DBUS_BUS_SYSTEM, &error);
-  NS_ASSERTION(dbusConnection, "Error when connecting to the session bus");
-
-  dbus_connection_setup_with_g_main(dbusConnection, nullptr);
-
-  // grab a connection:
-  gConnection = con_ic_connection_new();
-  NS_ASSERTION(gConnection, "Error when creating connection");
-  if (!gConnection) {
-    delete gReentrantMonitor;
-    gReentrantMonitor = nullptr;
-    return false;
-  }
-
-  g_signal_connect(G_OBJECT(gConnection),
-                   "connection-event",
-                   G_CALLBACK(connection_event_callback),
-                   nullptr);
-  
-  g_object_set(G_OBJECT(gConnection),
-               "automatic-connection-events",
-               true,
-               nullptr);
-  return true;
-}
-
-void
-nsMaemoNetworkManager::Shutdown()
-{
-  gConnection = nullptr;
-
-  if (gReentrantMonitor) {
-    // notify anyone waiting
-    ReentrantMonitorAutoEnter mon(*gReentrantMonitor);
-    gInternalState = InternalState_Invalid;    
-    mon.Notify();
-  }
-  
-  // We are leaking the gReentrantMonitor because a race condition could occur. We need
-  // a notification after xpcom-shutdown-threads so we can safely delete the monitor
-}
-
deleted file mode 100644
--- a/netwerk/system/maemo/nsMaemoNetworkManager.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=2 et sw=2 tw=80: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef NSMAEMONETWORKMANAGER_H_
-#define NSMAEMONETWORKMANAGER_H_
-
-#include "nscore.h"
-
-class nsMaemoNetworkManager
-{
-public:
-  // Can be called from any thread, most likely the socket transport thread
-  static bool OpenConnectionSync();
-  static void CloseConnection();
-
-  static bool IsConnected();
-  static bool GetLinkStatusKnown();
-
-  // Called from the nsMaemoNetworkLinkService (main thread only)
-  static bool Startup();
-  static void Shutdown();
-};
-
-#endif /* NSMAEMONETWORKMANAGER_H_ */
--- a/netwerk/system/moz.build
+++ b/netwerk/system/moz.build
@@ -5,19 +5,16 @@
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 if CONFIG['OS_ARCH'] == 'WINNT':
     DIRS += ['win32']
 
 if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa':
     DIRS += ['mac']
 
-if CONFIG['MOZ_ENABLE_LIBCONIC']:
-    DIRS += ['maemo']
-
 if CONFIG['MOZ_ENABLE_QTNETWORK']:
     DIRS += ['qt']
 
 if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'android':
     DIRS += ['android']
 
 MODULE = 'necko'
 
--- a/toolkit/components/downloads/nsDownloadManager.cpp
+++ b/toolkit/components/downloads/nsDownloadManager.cpp
@@ -1387,26 +1387,17 @@ nsDownloadManager::GetDefaultDownloadsDi
     rv = downloadDir->Exists(&exists);
     NS_ENSURE_SUCCESS(rv, rv);
     if (!exists) {
       rv = downloadDir->Create(nsIFile::DIRECTORY_TYPE, 0755);
       NS_ENSURE_SUCCESS(rv, rv);
     }
   }
 #elif defined(XP_UNIX)
-#if defined(MOZ_PLATFORM_MAEMO)
-    // As maemo does not follow the XDG "standard" (as usually desktop
-    // Linux distros do) neither has a working $HOME/Desktop folder
-    // for us to fallback into, "$HOME/MyDocs/.documents/" is the folder
-    // we found most apropriate to be the default target folder for downloads
-    // on the platform.
-    rv = dirService->Get(NS_UNIX_XDG_DOCUMENTS_DIR,
-                         NS_GET_IID(nsIFile),
-                         getter_AddRefs(downloadDir));
-#elif defined(MOZ_WIDGET_ANDROID)
+#if defined(MOZ_WIDGET_ANDROID)
     // Android doesn't have a $HOME directory, and by default we only have
     // write access to /data/data/org.mozilla.{$APP} and /sdcard
     char* downloadDirPath = getenv("DOWNLOADS_DIRECTORY");
     if (downloadDirPath) {
       rv = NS_NewNativeLocalFile(nsDependentCString(downloadDirPath),
                                  true, getter_AddRefs(downloadDir));
       NS_ENSURE_SUCCESS(rv, rv);
     }
--- a/toolkit/components/jsdownloads/src/DownloadIntegration.jsm
+++ b/toolkit/components/jsdownloads/src/DownloadIntegration.jsm
@@ -254,24 +254,17 @@ this.DownloadIntegration = {
       // the default Downloads directory.
       let version = parseFloat(Services.sysinfo.getProperty("version"));
       if (version < 6) {
         directory = yield this._createDownloadsDirectory("Pers");
       } else {
         directory = this._getDirectory("DfltDwnld");
       }
 #elifdef XP_UNIX
-#ifdef MOZ_PLATFORM_MAEMO
-      // As maemo does not follow the XDG "standard" (as usually desktop
-      // Linux distros do) neither has a working $HOME/Desktop folder
-      // for us to fallback into, "$HOME/MyDocs/.documents/" is the folder
-      // we found most appropriate to be the default target folder for
-      // downloads on the platform.
-      directory = this._getDirectory("XDGDocs");
-#elifdef ANDROID
+#ifdef ANDROID
       // Android doesn't have a $HOME directory, and by default we only have
       // write access to /data/data/org.mozilla.{$APP} and /sdcard
       let directoryPath = gEnvironment.get("DOWNLOADS_DIRECTORY");
       if (!directoryPath) {
         throw new Components.Exception("DOWNLOADS_DIRECTORY is not set.",
                                        Cr.NS_ERROR_FILE_UNRECOGNIZED_PATH);
       }
       directory = new FileUtils.File(directoryPath);
--- a/toolkit/components/remote/nsQtRemoteService.cpp
+++ b/toolkit/components/remote/nsQtRemoteService.cpp
@@ -60,19 +60,16 @@ NS_IMPL_ISUPPORTS2(nsQtRemoteService,
 nsQtRemoteService::nsQtRemoteService():
 mServerWindow(0)
 {
 }
 
 NS_IMETHODIMP
 nsQtRemoteService::Startup(const char* aAppName, const char* aProfileName)
 {
-#if (MOZ_PLATFORM_MAEMO == 5)
-  return NS_ERROR_NOT_IMPLEMENTED;
-#endif
   if (mServerWindow) return NS_ERROR_ALREADY_INITIALIZED;
   NS_ASSERTION(aAppName, "Don't pass a null appname!");
 
   XRemoteBaseStartup(aAppName,aProfileName);
 
   //Create window, which is not shown.
   mServerWindow = new MozQRemoteEventHandlerWidget(*this);
 
--- a/toolkit/content/contentAreaUtils.js
+++ b/toolkit/content/contentAreaUtils.js
@@ -928,18 +928,17 @@ function validateFileName(aFileName)
     re = /[\\\/\|]+/g;
     aFileName = aFileName.replace(/[\"]+/g, "'");
     aFileName = aFileName.replace(/[\*\:\?]+/g, " ");
     aFileName = aFileName.replace(/[\<]+/g, "(");
     aFileName = aFileName.replace(/[\>]+/g, ")");
   }
   else if (navigator.appVersion.indexOf("Macintosh") != -1)
     re = /[\:\/]+/g;
-  else if (navigator.appVersion.indexOf("Android") != -1 ||
-           navigator.appVersion.indexOf("Maemo") != -1) {
+  else if (navigator.appVersion.indexOf("Android") != -1) {
     // On mobile devices, the filesystem may be very limited in what
     // it considers valid characters. To avoid errors, we sanitize
     // conservatively.
     const dangerousChars = "*?<>|\":/\\[];,+=";
     var processed = "";
     for (var i = 0; i < aFileName.length; i++)
       processed += aFileName.charCodeAt(i) >= 32 &&
                    !(dangerousChars.indexOf(aFileName[i]) >= 0) ? aFileName[i]
--- a/toolkit/crashreporter/client/Makefile.in
+++ b/toolkit/crashreporter/client/Makefile.in
@@ -45,25 +45,16 @@ LIBS += \
   $(DEPTH)/toolkit/crashreporter/google-breakpad/src/common/mac/$(LIB_PREFIX)breakpad_mac_common_s.$(LIB_SUFFIX) \
   $(NULL)
 
 LOCAL_INCLUDES += -I$(srcdir) -I$(srcdir)/../google-breakpad/src/common/mac/
 endif
 
 ifdef MOZ_WIDGET_GTK
 
-ifdef MOZ_PLATFORM_MAEMO
-# Maemo's libcurl doesn't ship with a set of CA certificates,
-# so we have to ship our own.
-libs:: $(DIST)/bin/crashreporter.crt
-
-$(DIST)/bin/crashreporter.crt: $(topsrcdir)/security/nss/lib/ckfw/builtins/certdata.txt certdata2pem.py
-	$(PYTHON) $(srcdir)/certdata2pem.py < $< > $@
-endif
-
 LIBS += \
   $(DEPTH)/toolkit/crashreporter/google-breakpad/src/common/linux/$(LIB_PREFIX)breakpad_linux_common_s.$(LIB_SUFFIX) \
   $(NULL)
 LOCAL_INCLUDES += -I$(srcdir)
 OS_CXXFLAGS += $(TK_CFLAGS) $(MOZ_GTHREAD_CFLAGS)
 OS_LIBS += $(TK_LIBS) $(MOZ_GTHREAD_LIBS)
 endif
 
@@ -88,13 +79,8 @@ libs::
 	$(NSINSTALL) $(DIST)/bin/crashreporter $(DIST)/bin/crashreporter.app/Contents/MacOS
 	rm -f $(DIST)/bin/crashreporter
 endif
 
 ifeq (,$(filter-out Linux SunOS,$(OS_ARCH)))
 libs:: $(topsrcdir)/toolkit/themes/windows/global/throbber/Throbber-small.gif
 	$(INSTALL) $^ $(DIST)/bin
 endif
-
-ifdef MOZ_PLATFORM_MAEMO
-libs::
-	$(INSTALL) $(DIST)/bin/crashreporter.crt $(DEPTH)/_tests/xpcshell/$(MODULE)/maemo-unit/
-endif
deleted file mode 100755
--- a/toolkit/crashreporter/client/certdata2pem.py
+++ /dev/null
@@ -1,111 +0,0 @@
-#!/usr/bin/python
-# vim:set et sw=4:
-#
-# Originally from:
-# http://cvs.fedoraproject.org/viewvc/F-13/ca-certificates/certdata2pem.py?revision=1.1&content-type=text%2Fplain&view=co
-#
-# certdata2pem.py - converts certdata.txt into PEM format. 
-#
-# Copyright (C) 2009 Philipp Kern <pkern@debian.org>
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301,
-# USA.
-
-import base64
-import os.path
-import re
-import sys
-import textwrap
-
-objects = []
-
-# Dirty file parser.
-in_data, in_multiline, in_obj = False, False, False
-field, type, value, obj = None, None, None, dict()
-for line in sys.stdin: 
-    # Ignore the file header.
-    if not in_data:
-        if line.startswith('BEGINDATA'):
-            in_data = True
-        continue
-    # Ignore comment lines.
-    if line.startswith('#'):
-        continue
-    # Empty lines are significant if we are inside an object.
-    if in_obj and len(line.strip()) == 0:
-        objects.append(obj)
-        obj = dict()
-        in_obj = False
-        continue
-    if len(line.strip()) == 0:
-        continue
-    if in_multiline:
-        if not line.startswith('END'):
-            if type == 'MULTILINE_OCTAL':
-                line = line.strip()
-                for i in re.finditer(r'\\([0-3][0-7][0-7])', line):
-                    value += chr(int(i.group(1), 8))
-            else:
-                value += line
-            continue
-        obj[field] = value
-        in_multiline = False
-        continue
-    if line.startswith('CKA_CLASS'):
-        in_obj = True
-    line_parts = line.strip().split(' ', 2)
-    if len(line_parts) > 2:
-        field, type = line_parts[0:2]
-        value = ' '.join(line_parts[2:])
-    elif len(line_parts) == 2:
-        field, type = line_parts
-        value = None
-    else:
-        raise NotImplementedError, 'line_parts < 2 not supported.'
-    if type == 'MULTILINE_OCTAL':
-        in_multiline = True
-        value = ""
-        continue
-    obj[field] = value
-if len(obj.items()) > 0:
-    objects.append(obj)
-
-# Build up trust database.
-trust = dict()
-for obj in objects:
-    if obj['CKA_CLASS'] != 'CKO_NETSCAPE_TRUST':
-        continue
-    # For some reason, OpenSSL on Maemo has a bug where if we include
-    # this certificate, and it winds up as the last certificate in the file,
-    # then OpenSSL is unable to verify the server certificate. For now,
-    # we'll just omit this particular CA cert, since it's not one we need
-    # for crash reporting.
-    # This is likely to be fragile if the NSS certdata.txt changes.
-    # The bug is filed upstream:
-    # https://bugs.maemo.org/show_bug.cgi?id=10069
-    if obj['CKA_LABEL'] == '"ACEDICOM Root"':
-        continue
-    # We only want certs that are trusted for SSL server auth
-    if obj['CKA_TRUST_SERVER_AUTH'] == 'CKT_NETSCAPE_TRUSTED_DELEGATOR':
-        trust[obj['CKA_LABEL']] = True
-
-for obj in objects:
-    if obj['CKA_CLASS'] == 'CKO_CERTIFICATE':
-        if not obj['CKA_LABEL'] in trust or not trust[obj['CKA_LABEL']]:
-            continue
-        sys.stdout.write("-----BEGIN CERTIFICATE-----\n")
-        sys.stdout.write("\n".join(textwrap.wrap(base64.b64encode(obj['CKA_VALUE']), 64)))
-        sys.stdout.write("\n-----END CERTIFICATE-----\n\n")
-
--- a/toolkit/crashreporter/client/crashreporter_gtk_common.cpp
+++ b/toolkit/crashreporter/client/crashreporter_gtk_common.cpp
@@ -46,17 +46,17 @@ StringTable gQueryParameters;
 string gHttpProxy;
 string gAuth;
 string gCACertificateFile;
 string gSendURL;
 string gURLParameter;
 vector<string> gRestartArgs;
 GThread* gSendThreadID;
 
-// From crashreporter_linux.cpp or crashreporter_maemo_gtk.cpp
+// From crashreporter_linux.cpp
 void SaveSettings();
 void SendReport();
 void TryInitGnome();
 void UpdateSubmit();
 
 static bool RestartApplication()
 {
   char** argv = reinterpret_cast<char**>(
@@ -279,19 +279,16 @@ bool UIInit()
 
   if (gtk_init_check(&gArgc, &gArgv)) {
     gInitialized = true;
 
     if (gStrings.find("isRTL") != gStrings.end() &&
         gStrings["isRTL"] == "yes")
       gtk_widget_set_default_direction(GTK_TEXT_DIR_RTL);
 
-#ifndef MOZ_PLATFORM_MAEMO
-    TryInitGnome();
-#endif
     return true;
   }
 
   return false;
 }
 
 void UIShowDefaultUI()
 {
deleted file mode 100644
--- a/toolkit/crashreporter/client/crashreporter_maemo_gtk.cpp
+++ /dev/null
@@ -1,251 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include <fcntl.h>
-#include <hildon-1/hildon/hildon.h>
-#include <glib.h>
-#include <gtk/gtk.h>
-#include <string.h>
-
-#include <cctype>
-
-#include "crashreporter.h"
-#include "crashreporter_gtk_common.h"
-
-using std::string;
-using std::vector;
-
-using namespace CrashReporter;
-
-void LoadSettings()
-{
-  /*
-   * NOTE! This code needs to stay in sync with the preference checking
-   *       code in in nsExceptionHandler.cpp.
-   */
-
-  //XXX: share with desktop linux code?
-  StringTable settings;
-  if (ReadStringsFromFile(gSettingsPath + "/" + kIniFile, settings, true)) {
-    if (settings.find("IncludeURL") != settings.end() &&
-        gIncludeURLCheck != 0) {
-      gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(gIncludeURLCheck),
-                                   settings["IncludeURL"][0] != '0');
-    }
-    bool enabled;
-    if (settings.find("SubmitReport") != settings.end())
-      enabled = settings["SubmitReport"][0] != '0';
-    else
-      enabled = ShouldEnableSending();
-    gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(gSubmitReportCheck),
-                                 enabled);
-  }
-}
-
-void SaveSettings()
-{
-  /*
-   * NOTE! This code needs to stay in sync with the preference setting
-   *       code in in nsExceptionHandler.cpp.
-   */
-
-  StringTable settings;
-
-  ReadStringsFromFile(gSettingsPath + "/" + kIniFile, settings, true);
-
-  if (gIncludeURLCheck != 0)
-    settings["IncludeURL"] =
-      gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(gIncludeURLCheck))
-      ? "1" : "0";
-  settings["SubmitReport"] =
-    gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(gSubmitReportCheck))
-    ? "1" : "0";
-
-  WriteStringsToFile(gSettingsPath + "/" + kIniFile,
-                     "Crash Reporter", settings, true);
-}
-
-/*
- * Check if a crashreporter.crt file exists next
- * to the crashreporter binary, and if so set gCACertificateFile
- * to its path. The CA cert will then be used by libcurl to authenticate
- * the server's SSL certificate.
- */
-static void FindCACertificateFile()
-{
-  string path = gArgv[0];
-  path += ".crt";
-  if (UIFileExists(path)) {
-    gCACertificateFile = path;
-  }
-}
-
-void SendReport()
-{
-  // disable all our gui controls, show the throbber + change the progress text
-  gtk_widget_set_sensitive(gSubmitReportCheck, FALSE);
-  if (gIncludeURLCheck)
-    gtk_widget_set_sensitive(gIncludeURLCheck, FALSE);
-  gtk_widget_set_sensitive(gCloseButton, FALSE);
-  if (gRestartButton)
-    gtk_widget_set_sensitive(gRestartButton, FALSE);
-  gtk_widget_show_all(gThrobber);
-  gtk_label_set_text(GTK_LABEL(gProgressLabel),
-                     gStrings[ST_REPORTDURINGSUBMIT].c_str());
-
-#ifdef MOZ_ENABLE_GCONF
-  LoadProxyinfo();
-#endif
-
-  FindCACertificateFile();
-
-  // and spawn a thread to do the sending
-  GError* err;
-  gSendThreadID = g_thread_create(SendThread, NULL, TRUE, &err);
-}
-
-void UpdateSubmit()
-{
-  if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(gSubmitReportCheck))) {
-    if (gIncludeURLCheck)
-      gtk_widget_set_sensitive(gIncludeURLCheck, TRUE);
-    gtk_label_set_text(GTK_LABEL(gProgressLabel),
-                       gStrings[ST_REPORTPRESUBMIT].c_str());
-  } else {
-    if (gIncludeURLCheck)
-      gtk_widget_set_sensitive(gIncludeURLCheck, FALSE);
-    gtk_label_set_text(GTK_LABEL(gProgressLabel), "");
-  }
-}
-
-/* === Crashreporter UI Functions === */
-
-/*
- * Anything not listed here is in crashreporter_gtk_common.cpp:
- *  UIInit
- *  UIShowDefaultUI
- *  UIError_impl
- *  UIGetIniPath
- *  UIGetSettingsPath
- *  UIEnsurePathExists
- *  UIFileExists
- *  UIMoveFile
- *  UIDeleteFile
- *  UIOpenRead
- *  UIOpenWrite
- */
-
-void UIShutdown()
-{
-}
-
-bool UIShowCrashUI(const string& dumpfile,
-                   const StringTable& queryParameters,
-                   const string& sendURL,
-                   const vector<string>& restartArgs)
-{
-  gDumpFile = dumpfile;
-  gQueryParameters = queryParameters;
-  gSendURL = sendURL;
-  gRestartArgs = restartArgs;
-  if (gQueryParameters.find("URL") != gQueryParameters.end())
-    gURLParameter = gQueryParameters["URL"];
-
-  gWindow = gtk_window_new(GTK_WINDOW_TOPLEVEL);
-  gtk_window_set_title(GTK_WINDOW(gWindow),
-                       gStrings[ST_CRASHREPORTERTITLE].c_str());
-  gtk_window_set_resizable(GTK_WINDOW(gWindow), FALSE);
-  gtk_window_set_position(GTK_WINDOW(gWindow), GTK_WIN_POS_CENTER);
-  gtk_container_set_border_width(GTK_CONTAINER(gWindow), 12);
-  g_signal_connect(gWindow, "delete-event", G_CALLBACK(WindowDeleted), 0);
-
-  GtkWidget* vbox = gtk_vbox_new(FALSE, 6);
-  gtk_container_add(GTK_CONTAINER(gWindow), vbox);
-
-  GtkWidget* titleLabel = gtk_label_new("");
-  gtk_box_pack_start(GTK_BOX(vbox), titleLabel, FALSE, FALSE, 0);
-  gtk_misc_set_alignment(GTK_MISC(titleLabel), 0, 0.5);
-  char* markup = g_strdup_printf("<b>%s</b>",
-                                 gStrings[ST_CRASHREPORTERHEADER].c_str());
-  gtk_label_set_markup(GTK_LABEL(titleLabel), markup);
-  g_free(markup);
-
-  GtkWidget* descriptionLabel =
-    gtk_label_new(gStrings[ST_CRASHREPORTERDESCRIPTION].c_str());
-  gtk_box_pack_start(GTK_BOX(vbox), descriptionLabel, TRUE, TRUE, 0);
-  // force the label to line wrap
-  gtk_widget_set_size_request(descriptionLabel, -1, -1);
-  gtk_label_set_line_wrap(GTK_LABEL(descriptionLabel), TRUE);
-  gtk_label_set_selectable(GTK_LABEL(descriptionLabel), TRUE);
-  gtk_misc_set_alignment(GTK_MISC(descriptionLabel), 0, 0.5);
-
-  gSubmitReportCheck =
-    gtk_check_button_new_with_label(gStrings[ST_CHECKSUBMIT].c_str());
-
-  gtk_box_pack_start(GTK_BOX(vbox), gSubmitReportCheck, FALSE, FALSE, 0);
-  g_signal_connect(gSubmitReportCheck, "clicked",
-                   G_CALLBACK(SubmitReportChecked), 0);
-
-  if (gQueryParameters.find("URL") != gQueryParameters.end()) {
-    gIncludeURLCheck =
-      gtk_check_button_new_with_label(gStrings[ST_CHECKURL].c_str());
-    gtk_box_pack_start(GTK_BOX(vbox), gIncludeURLCheck, FALSE, FALSE, 0);
-    g_signal_connect(gIncludeURLCheck, "clicked", G_CALLBACK(IncludeURLClicked), 0);
-    // on by default
-    gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(gIncludeURLCheck), TRUE);
-  }
-
-  GtkWidget* progressBox = gtk_hbox_new(FALSE, 6);
-  gtk_box_pack_start(GTK_BOX(vbox), progressBox, TRUE, TRUE, 0);
-
-  // Get the throbber image from alongside the executable
-  char* dir = g_path_get_dirname(gArgv[0]);
-  char* path = g_build_filename(dir, "Throbber-small.gif", NULL);
-  g_free(dir);
-  gThrobber = gtk_image_new_from_file(path);
-  gtk_box_pack_start(GTK_BOX(progressBox), gThrobber, FALSE, FALSE, 0);
-
-  gProgressLabel =
-    gtk_label_new(gStrings[ST_REPORTPRESUBMIT].c_str());
-  gtk_box_pack_start(GTK_BOX(progressBox), gProgressLabel, TRUE, TRUE, 0);
-  // force the label to line wrap
-  gtk_widget_set_size_request(gProgressLabel, 500, -1);
-  gtk_label_set_line_wrap(GTK_LABEL(gProgressLabel), TRUE);
-
-  GtkWidget* buttonBox = gtk_hbutton_box_new();
-  gtk_box_pack_end(GTK_BOX(vbox), buttonBox, FALSE, FALSE, 0);
-  gtk_box_set_spacing(GTK_BOX(buttonBox), 6);
-  gtk_button_box_set_layout(GTK_BUTTON_BOX(buttonBox), GTK_BUTTONBOX_END);
-
-  gCloseButton =
-    gtk_button_new_with_label(gStrings[ST_QUIT].c_str());
-  gtk_box_pack_start(GTK_BOX(buttonBox), gCloseButton, FALSE, FALSE, 0);
-  GTK_WIDGET_SET_FLAGS(gCloseButton, GTK_CAN_DEFAULT);
-  g_signal_connect(gCloseButton, "clicked", G_CALLBACK(CloseClicked), 0);
-
-  gRestartButton = 0;
-  if (restartArgs.size() > 0) {
-    gRestartButton = gtk_button_new_with_label(gStrings[ST_RESTART].c_str());
-    gtk_box_pack_start(GTK_BOX(buttonBox), gRestartButton, FALSE, FALSE, 0);
-    GTK_WIDGET_SET_FLAGS(gRestartButton, GTK_CAN_DEFAULT);
-    g_signal_connect(gRestartButton, "clicked", G_CALLBACK(RestartClicked), 0);
-  }
-
-  gtk_widget_grab_focus(gSubmitReportCheck);
-
-  gtk_widget_grab_default(gRestartButton ? gRestartButton : gCloseButton);
-
-  LoadSettings();
-
-  UpdateSubmit();
-
-  gtk_widget_show_all(gWindow);
-  // stick this here to avoid the show_all above...
-  gtk_widget_hide_all(gThrobber);
-
-  gtk_main();
-
-  return gDidTrySend;
-}
deleted file mode 100644
--- a/toolkit/crashreporter/client/maemo-unit/crashreports.crt
+++ /dev/null
@@ -1,20 +0,0 @@
------BEGIN CERTIFICATE-----
-MIIDPTCCAqagAwIBAgIDDjAwMA0GCSqGSIb3DQEBBQUAME4xCzAJBgNVBAYTAlVT
-MRAwDgYDVQQKEwdFcXVpZmF4MS0wKwYDVQQLEyRFcXVpZmF4IFNlY3VyZSBDZXJ0
-aWZpY2F0ZSBBdXRob3JpdHkwHhcNMDkxMjAyMDY0MzE1WhcNMTIwMjAyMTIwMDI1
-WjCBxzEpMCcGA1UEBRMgbG5qYnUvcVJXL2p3UC9EUXFHNEFOTDNDUWdlZHg2d24x
-CzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpDYWxpZm9ybmlhMRYwFAYDVQQHEw1Nb3Vu
-dGFpbiBWaWV3MRwwGgYDVQQKExNNb3ppbGxhIENvcnBvcmF0aW9uMR4wHAYDVQQL
-ExVNb3ppbGxhIENyYXNoIFJlcG9ydHMxIjAgBgNVBAMTGWNyYXNoLXJlcG9ydHMu
-bW96aWxsYS5jb20wgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAMrrjxQWtgh6
-xJkFb6DebjldmLr0IU3SUymHaMcos6ISJ4w8IkkGGJS+59sMpLGR6bMZmioH4dpS
-ZqwQqCYPpMQxi8XjdkeIzxP8Q2+01lYYK/fTVqp2jh3TWwOk1gbiNBzYYYxxkhXO
-R5yjj6pfSHdWBJZZJRajYo/xddzmq5p9AgMBAAGjga4wgaswDgYDVR0PAQH/BAQD
-AgTwMB0GA1UdDgQWBBTd2p7ARtLT3nVeh8a/M5NdAUWyTzA6BgNVHR8EMzAxMC+g
-LaArhilodHRwOi8vY3JsLmdlb3RydXN0LmNvbS9jcmxzL3NlY3VyZWNhLmNybDAf
-BgNVHSMEGDAWgBRI5mj5K9KylddH2CMgEE8zmJCf1DAdBgNVHSUEFjAUBggrBgEF
-BQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQEFBQADgYEAoV0j092DMZXaVlNXT9vr
-Fmt6lrVQcTgvYJlutFa9vnnXFqYt4i5VVrRPo+BigZN8p1KGdD/dIgYQM+JubrnA
-qEWAyoBHropuEpiR8Fa0qcZHPVQOCWBfK1PB5W6CvUiDNOYl89mBqzuwSMKzojsT
-yiI0JD1SVgnoTumvkZd5w+I=
------END CERTIFICATE-----
deleted file mode 100755
--- a/toolkit/crashreporter/client/maemo-unit/opensslverify.sh
+++ /dev/null
@@ -1,17 +0,0 @@
-#!/bin/sh
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-# Run as:
-# opensslverify.sh <ca certificate file> <server certificate file>
-#
-# `openssl verify` doesn't return an error code if the cert fails
-# to verify, so we have to grep the output, and we can't do that via
-# nsIProcess, so we use a shell script.
-
-if openssl verify -CAfile $1 -purpose sslserver $2 2>&1 | grep -q "^error"; then
-  exit 1;
-else
-  exit 0;
-fi
deleted file mode 100644
--- a/toolkit/crashreporter/client/maemo-unit/test_maemo_certs.js
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
-/*
- * This test validates that OpenSSL running on this system can
- * validate the server certificate in crashreports.crt against the
- * list of CA certificates in crashreporter.crt. On Maemo systems,
- * OpenSSL has a bug where the ordering of certain certificates
- * in the CA certificate file can cause validation to fail.
- * This test is intended to catch that condition in case the NSS
- * certificate list changes in a way that would trigger the bug.
- */
-function run_test() {
-  let file = Components.classes["@mozilla.org/file/local;1"]
-                       .createInstance(Components.interfaces.nsILocalFile);
-  file.initWithPath("/bin/sh");
-
-  let process = Components.classes["@mozilla.org/process/util;1"]
-                        .createInstance(Components.interfaces.nsIProcess);
-  process.init(file);
-
-  let shscript = do_get_file("opensslverify.sh");
-  let cacerts = do_get_file("crashreporter.crt");
-  let servercert = do_get_file("crashreports.crt");
-  let args = [shscript.path, cacerts.path, servercert.path];
-  process.run(true, args, args.length);
-
-  dump('If the following test fails, the logic in toolkit/crashreporter/client/certdata2pem.py needs to be fixed, otherwise crash report submission on Maemo will fail.\n');
-  do_check_eq(process.exitValue, 0);
-}
deleted file mode 100644
--- a/toolkit/crashreporter/client/maemo-unit/xpcshell.ini
+++ /dev/null
@@ -1,10 +0,0 @@
-; This Source Code Form is subject to the terms of the Mozilla Public
-; License, v. 2.0. If a copy of the MPL was not distributed with this
-; file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-[DEFAULT]
-head = 
-tail = 
-
-[test_maemo_certs.js]
-
--- a/toolkit/crashreporter/client/moz.build
+++ b/toolkit/crashreporter/client/moz.build
@@ -4,18 +4,16 @@
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 MODULE = 'crashreporter'
 
 if CONFIG['OS_TARGET'] != 'Android':
     PROGRAM = 'crashreporter'
 # The xpcshell test case here verifies that the CA certificate list
-if CONFIG['MOZ_ENABLE_GTK'] and CONFIG['MOZ_PLATFORM_MAEMO']:
-    XPCSHELL_TESTS_MANIFESTS += ['maemo-unit/xpcshell.ini']
 
 CPP_SOURCES += [
     'crashreporter.cpp',
 ]
 
 if CONFIG['OS_ARCH'] == 'WINNT':
     CPP_SOURCES += [
         'crashreporter_win.cpp',
@@ -29,22 +27,15 @@ elif CONFIG['OS_ARCH'] == 'SunOS':
         'crashreporter_linux.cpp',
         'crashreporter_unix.cpp',
     ]
 
 if CONFIG['MOZ_ENABLE_GTK']:
     CPP_SOURCES += [
         'crashreporter_gtk_common.cpp',
         'crashreporter_unix_common.cpp',
-    ]
-    if CONFIG['MOZ_PLATFORM_MAEMO']:
-        CPP_SOURCES += [
-            'crashreporter_maemo_gtk.cpp',
-        ]
-    else:
-        CPP_SOURCES += [
-            'crashreporter_linux.cpp',
+        'crashreporter_linux.cpp'
         ]
 
 if CONFIG['OS_ARCH'] == 'Darwin':
     CMMSRCS += [
         'crashreporter_osx.mm',
     ]
--- a/toolkit/crashreporter/google-breakpad/src/common/Makefile.in
+++ b/toolkit/crashreporter/google-breakpad/src/common/Makefile.in
@@ -42,23 +42,16 @@ VPATH += $(srcdir)/android
 TARGET_LOCAL_INCLUDES += -I$(topsrcdir)/toolkit/crashreporter/google-breakpad/src/common/android/include/
 DEFINES += -DNO_STABS_SUPPORT
 endif
 
 ifeq (gonk,$(MOZ_WIDGET_TOOLKIT))
 DEFINES += -DELFSIZE=32
 endif
 
-ifdef MOZ_PLATFORM_MAEMO
-# The GCC in scratchbox crashes writing DWARF debug info for language.cc.
-# Since we don't really need debug symbols for the host tools anyway,
-# just get rid of debug options.
-HOST_CXXFLAGS = $(patsubst -g%,,$(CXXFLAGS))
-endif
-
 # This kind of sucks.
 ifeq (Linux,$(OS_ARCH))
 HOST_CXXFLAGS += -DHAVE_A_OUT_H
 OS_CXXFLAGS += -DHAVE_A_OUT_H
 endif
 ifeq (Darwin,$(OS_ARCH))
 HOST_CXXFLAGS += -DHAVE_MACH_O_NLIST_H
 OS_CXXFLAGS += -DHAVE_MACH_O_NLIST_H
--- a/toolkit/library/Makefile.in
+++ b/toolkit/library/Makefile.in
@@ -512,24 +512,16 @@ OS_LIBS += \
 endif
 
 ifeq (OpenBSD,$(OS_ARCH))
 ifdef MOZ_CUBEB
 EXTRA_DSO_LDOPTS += -lsndio
 endif
 endif
 
-ifdef MOZ_PLATFORM_MAEMO
-EXTRA_DSO_LDOPTS += $(MOZ_PLATFORM_MAEMO_LIBS)
-endif
-
-ifdef MOZ_ENABLE_LIBCONIC
-EXTRA_DSO_LDOPTS += $(LIBCONIC_LIBS)
-endif
-
 ifdef MOZ_ENABLE_DBUS
 EXTRA_DSO_LDOPTS += $(MOZ_DBUS_GLIB_LIBS)
 endif
 
 ifdef MOZ_WIDGET_GTK
 EXTRA_DSO_LDOPTS += $(TK_LIBS)
 EXTRA_DSO_LDOPTS += $(XLDFLAGS) $(XLIBS) $(XEXT_LIBS) $(XCOMPOSITE_LIBS) $(MOZ_PANGO_LIBS) $(XT_LIBS) -lgthread-2.0
 EXTRA_DSO_LDOPTS += $(FT2_LIBS)
--- a/toolkit/toolkit.mozbuild
+++ b/toolkit/toolkit.mozbuild
@@ -169,18 +169,18 @@ if CONFIG['MOZ_REPLACE_MALLOC']:
     add_tier_dir('platform', 'memory/replace')
 
 if CONFIG['NS_TRACE_MALLOC']:
     add_tier_dir('platform', 'tools/trace-malloc')
 
 if CONFIG['MOZ_ENABLE_GNOME_COMPONENT']:
     add_tier_dir('platform', 'toolkit/system/gnome')
 
-# if libconic or QtNetwork is present, it will do its own network monitoring
-if not CONFIG['MOZ_ENABLE_LIBCONIC'] and not CONFIG['MOZ_ENABLE_QTNETWORK'] and CONFIG['MOZ_ENABLE_DBUS']:
+# if QtNetwork is present, it will do its own network monitoring
+if not CONFIG['MOZ_ENABLE_QTNETWORK'] and CONFIG['MOZ_ENABLE_DBUS']:
     add_tier_dir('platform', 'toolkit/system/dbus')
 
 add_tier_dir('platform', 'addon-sdk')
 
 if CONFIG['ENABLE_MARIONETTE'] or CONFIG['MOZ_WIDGET_TOOLKIT'] not in ('gonk', 'android'):
     add_tier_dir('platform', 'testing/marionette')
 
 if CONFIG['ENABLE_TESTS']:
--- a/toolkit/xre/nsAppRunner.cpp
+++ b/toolkit/xre/nsAppRunner.cpp
@@ -3257,28 +3257,16 @@ XREMain::XRE_mainStartup(bool* aExitFlag
   if (desktopStartupIDEnv) {
     mDesktopStartupID.Assign(desktopStartupIDEnv);
   }
 #endif
 
 #if defined(MOZ_WIDGET_QT)
   nsQAppInstance::AddRef(gArgc, gArgv, true);
 
-#if MOZ_PLATFORM_MAEMO > 5
-  if (XRE_GetProcessType() == GeckoProcessType_Default) {
-    // try to get the MInputContext if possible to support the MeeGo VKB
-    QInputContext* inputContext = qApp->inputContext();
-    if (inputContext && inputContext->identifierName() != "MInputContext") {
-        QInputContext* context = QInputContextFactory::create("MInputContext",
-                                                              qApp);
-        if (context)
-            qApp->setInputContext(context);
-    }
-  }
-#endif
   QStringList nonQtArguments = qApp->arguments();
   gQtOnlyArgc = 1;
   gQtOnlyArgv = (char**) malloc(sizeof(char*) 
                 * (gRestartArgc - nonQtArguments.size() + 2));
 
   // copy binary path
   gQtOnlyArgv[0] = gRestartArgv[0];
 
--- a/toolkit/xre/nsNativeAppSupportQt.cpp
+++ b/toolkit/xre/nsNativeAppSupportQt.cpp
@@ -87,65 +87,25 @@ nsNativeAppSupportQt::Start(bool* aRetVa
   connect(&mActivity, SIGNAL(activityChanged(MeeGo::QmActivity::Activity)), this, SLOT(activityChanged(MeeGo::QmActivity::Activity)));
   connect(&mDeviceMode, SIGNAL(deviceModeChanged(MeeGo::QmDeviceMode::DeviceMode)), this, SLOT(deviceModeChanged(MeeGo::QmDeviceMode::DeviceMode)));
   connect(&mDisplayState, SIGNAL(displayStateChanged(MeeGo::QmDisplayState::DisplayState)), this, SLOT(displayStateChanged(MeeGo::QmDisplayState::DisplayState)));
   // Init states withing next event loop iteration
   QTimer::singleShot(0, this, SLOT(RefreshStates()));
 #endif
 
   *aRetVal = true;
-#ifdef MOZ_ENABLE_LIBCONIC
-  g_type_init();
-#endif
-
-#if (MOZ_PLATFORM_MAEMO == 5)
-  /* Initialize maemo application
-
-     The initalization name will be of the form "Vendor.Name".
-     If a Vendor isn't given, then we will just use "Name".
-
-     Note that this value must match your X-Osso-Service name
-     defined in your desktop file.  If it doesn't, the OSSO
-     system will happily kill your process.
-  */
-  nsAutoCString applicationName;
-  if (gAppData->vendor) {
-      applicationName.Append(gAppData->vendor);
-      applicationName.Append(".");
-  }
-  applicationName.Append(gAppData->name);
-  ToLowerCase(applicationName);
-
-  m_osso_context = osso_initialize(applicationName.get(),
-                                   gAppData->version ? gAppData->version : "1.0",
-                                   true,
-                                   nullptr);
-
-  /* Check that initilialization was ok */
-  if (m_osso_context == nullptr) {
-      return NS_ERROR_FAILURE;
-  }
-#endif
-
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsNativeAppSupportQt::Stop(bool* aResult)
 {
   NS_ENSURE_ARG(aResult);
   *aResult = true;
 
-#if (MOZ_PLATFORM_MAEMO == 5)
-  if (m_osso_context) {
-    osso_deinitialize(m_osso_context);
-    m_osso_context = nullptr;
-  }
-#endif
-
   return NS_OK;
 }
 
 nsresult
 NS_CreateNativeAppSupport(nsINativeAppSupport** aResult)
 {
   nsNativeAppSupportBase* native = new nsNativeAppSupportQt();
   if (!native)
--- a/toolkit/xre/nsNativeAppSupportQt.h
+++ b/toolkit/xre/nsNativeAppSupportQt.h
@@ -9,34 +9,23 @@
 #ifdef MOZ_ENABLE_QMSYSTEM2
 #include "qmdevicemode.h"
 #include "qmdisplaystate.h"
 #include "qmactivity.h"
 #endif
 #include "nsNativeAppSupportBase.h"
 #include "nsString.h"
 
-#ifdef MOZ_ENABLE_LIBCONIC
-#include <glib-object.h>
-#endif
-
-#if (MOZ_PLATFORM_MAEMO == 5)
-#include <libosso.h>
-#endif
-
 class nsNativeAppSupportQt : public QObject, public nsNativeAppSupportBase
 {
   Q_OBJECT
 public:
   NS_IMETHOD Start(bool* aRetVal);
   NS_IMETHOD Stop(bool* aResult);
-#if (MOZ_PLATFORM_MAEMO == 5)
-  // Osso context must be initialized for maemo5 otherwise we will be killed in ~20 seconds
-  osso_context_t *m_osso_context;
-#endif
+
 #ifdef MOZ_ENABLE_QMSYSTEM2
 public Q_SLOTS:
   void activityChanged(MeeGo::QmActivity::Activity activity);
   void deviceModeChanged(MeeGo::QmDeviceMode::DeviceMode mode);
   void displayStateChanged(MeeGo::QmDisplayState::DisplayState state);
   void RefreshStates();
 
 private:
--- a/toolkit/xre/nsNativeAppSupportUnix.cpp
+++ b/toolkit/xre/nsNativeAppSupportUnix.cpp
@@ -35,35 +35,16 @@
 #include <gdk/gdkx.h>
 #include <X11/Xatom.h>
 #endif
 
 #ifdef MOZ_ENABLE_DBUS
 #include <dbus/dbus.h>
 #endif
 
-#if (MOZ_PLATFORM_MAEMO == 5)
-struct DBusMessage;  /* libosso.h references internals of dbus */
-
-#ifndef MOZ_ENABLE_DBUS
-#include <dbus/dbus.h>
-#endif
-
-#include <dbus/dbus-protocol.h>
-#include <libosso.h>
-
-// These come from <mce/dbus-names.h> (maemo sdk 5+)
-#define MCE_SERVICE "com.nokia.mce"
-#define MCE_REQUEST_IF "com.nokia.mce.request"
-#define MCE_REQUEST_PATH "/com/nokia/mce/request"
-#define MCE_SIGNAL_IF "com.nokia.mce.signal"
-#define MCE_DEVICE_ORIENTATION_SIG "sig_device_orientation_ind"
-#define MCE_MATCH_RULE "type='signal',interface='" MCE_SIGNAL_IF "',member='" MCE_DEVICE_ORIENTATION_SIG "'"
-#endif
-
 #define MIN_GTK_MAJOR_VERSION 2
 #define MIN_GTK_MINOR_VERSION 10
 #define UNSUPPORTED_GTK_MSG "We're sorry, this application requires a version of the GTK+ library that is not installed on your computer.\n\n\
 You have GTK+ %d.%d.\nThis application requires GTK+ %d.%d or newer.\n\n\
 Please upgrade your GTK+ library if you wish to use this application."
 
 typedef struct _GnomeProgram GnomeProgram;
 typedef struct _GnomeModuleInfo GnomeModuleInfo;
@@ -145,267 +126,18 @@ void die_cb(GnomeClient *client, gpointe
 class nsNativeAppSupportUnix : public nsNativeAppSupportBase
 {
 public:
   NS_IMETHOD Start(bool* aRetVal);
   NS_IMETHOD Stop(bool *aResult);
   NS_IMETHOD Enable();
 
 private:
-#if (MOZ_PLATFORM_MAEMO == 5)
-  osso_context_t *m_osso_context;    
-  /* A note about why we need to have m_hw_state:
-     the osso hardware callback does not tell us what changed, just
-     that something has changed.  We need to keep track of state so
-     that we can determine what has changed.
-  */  
-  osso_hw_state_t m_hw_state;
-#endif
 };
 
-#if (MOZ_PLATFORM_MAEMO == 5)
-static nsresult
-GetMostRecentWindow(const PRUnichar* aType, nsIDOMWindow** aWindow)
-{
-  nsCOMPtr<nsIWindowMediator> wm = do_GetService("@mozilla.org/appshell/window-mediator;1");
-  if (wm)
-    return wm->GetMostRecentWindow(aType, aWindow);
-  return NS_ERROR_FAILURE;
-}
-
-static GtkWidget*
-WidgetForDOMWindow(nsISupports *aWindow)
-{
-  nsCOMPtr<nsPIDOMWindow> domWindow(do_QueryInterface(aWindow));
-  if (!domWindow)
-    return NULL;
-
-  nsCOMPtr<nsIBaseWindow> baseWindow = do_QueryInterface(domWindow->GetDocShell());
-  if (!baseWindow)
-    return NULL;
-
-  nsCOMPtr<nsIWidget> widget;
-  baseWindow->GetMainWidget(getter_AddRefs(widget));
-  if (!widget)
-    return NULL;
-
-  return (GtkWidget*)(widget->GetNativeData(NS_NATIVE_SHELLWIDGET));
-}
-
-static void
-OssoSetWindowOrientation(bool aPortrait)
-{
-  // If we locked the screen, ignore any orientation changes
-  bool lockScreen = false;
-  nsCOMPtr<nsIPrefBranch> prefs = do_GetService(NS_PREFSERVICE_CONTRACTID);
-  if (prefs)
-    prefs->GetBoolPref("toolkit.screen.lock", &lockScreen);
-
-  if (lockScreen)
-    return;
-
-  // Tell Hildon desktop to force our window to be either portrait or landscape,
-  // depending on the current rotation
-  // NOTE: We only update the most recent top-level window so this is only
-  //       suitable for apps with only one window.
-  nsCOMPtr<nsIDOMWindow> window;
-  GetMostRecentWindow(EmptyString().get(), getter_AddRefs(window));
-  GtkWidget* widget = WidgetForDOMWindow(window);
-  if (widget && widget->window) {
-    GdkWindow *gdk = widget->window;
-    GdkAtom request = gdk_atom_intern("_HILDON_PORTRAIT_MODE_REQUEST", FALSE);
-
-    if (aPortrait) {
-      gulong portrait_set = 1;
-      gdk_property_change(gdk, request, gdk_x11_xatom_to_atom(XA_CARDINAL),
-                          32, GDK_PROP_MODE_REPLACE, (const guchar *) &portrait_set, 1);
-    }
-    else {
-      gdk_property_delete(gdk, request);
-    }
-  }
-
-  // Update the system info property
-  nsCOMPtr<nsIWritablePropertyBag2> info = do_GetService("@mozilla.org/system-info;1");
-  if (info) {
-    info->SetPropertyAsAString(NS_LITERAL_STRING("screen-orientation"),
-                               aPortrait ? NS_LITERAL_STRING("portrait") : NS_LITERAL_STRING("landscape"));
-  }
-}
-
-static bool OssoIsScreenOn(osso_context_t* ctx)
-{
-  osso_return_t rv;
-  osso_rpc_t ret;
-  bool result = false;
-
-  rv = osso_rpc_run_system(ctx, MCE_SERVICE, MCE_REQUEST_PATH, MCE_REQUEST_IF,
-                           "get_display_status", &ret, DBUS_TYPE_INVALID);
-  if (rv == OSSO_OK) {
-      if (strcmp(ret.value.s, "on") == 0)
-          result = true;
-
-      osso_rpc_free_val(&ret);
-  }
-  return result;
-}
-
-static void OssoRequestAccelerometer(osso_context_t *ctx, bool aEnabled)
-{
-  osso_return_t rv;
-  osso_rpc_t ret;
-
-  rv = osso_rpc_run_system(ctx, 
-                           MCE_SERVICE,
-                           MCE_REQUEST_PATH, MCE_REQUEST_IF,
-                           aEnabled ? "req_accelerometer_enable" : "req_accelerometer_disable",
-                           aEnabled ? &ret : NULL,
-                           DBUS_TYPE_INVALID);
-
-  // Orientation might changed while the accelerometer was off, so let's update
-  // the window's orientation
-  if (rv == OSSO_OK && aEnabled) {    
-      OssoSetWindowOrientation(strcmp(ret.value.s, "portrait") == 0);
-      osso_rpc_free_val(&ret);
-  }
-}
-
-static void OssoDisplayCallback(osso_display_state_t state, gpointer data)
-{
-  nsCOMPtr<nsIObserverService> os = mozilla::services::GetObserverService();
-  if (!os)
-      return;
-
-  osso_context_t* context = (osso_context_t*) data;
-
-  if (state == OSSO_DISPLAY_ON) {
-      os->NotifyObservers(nullptr, "system-display-on", nullptr);
-      OssoRequestAccelerometer(context, true);
-  } else {
-      os->NotifyObservers(nullptr, "system-display-dimmed-or-off", nullptr);
-      OssoRequestAccelerometer(context, false);
-  }
-}
-
-static void OssoHardwareCallback(osso_hw_state_t *state, gpointer data)
-{
-  NS_ASSERTION(state, "osso_hw_state_t must not be null.");
-  NS_ASSERTION(data, "data must not be null.");
-
-  osso_hw_state_t* ourState = (osso_hw_state_t*) data;
-
-  if (state->shutdown_ind) {
-    nsCOMPtr<nsIAppStartup> appService = do_GetService("@mozilla.org/toolkit/app-startup;1");
-    if (appService)
-      appService->Quit(nsIAppStartup::eForceQuit);
-    return;
-  }
-
-  if (state->memory_low_ind && !ourState->memory_low_ind) {
-    nsCOMPtr<nsIObserverService> os = mozilla::services::GetObserverService();
-    if (os)
-      os->NotifyObservers(nullptr, "memory-pressure", NS_LITERAL_STRING("low-memory").get());
-  }
-  
-  if (state->system_inactivity_ind != ourState->system_inactivity_ind) {
-      nsCOMPtr<nsIObserverService> os = mozilla::services::GetObserverService();
-      if (!os)
-        return;
- 
-      if (state->system_inactivity_ind)
-          os->NotifyObservers(nullptr, "system-idle", nullptr);
-      else
-          os->NotifyObservers(nullptr, "system-active", nullptr);
-  }
-
-  memcpy(ourState, state, sizeof(osso_hw_state_t));
-}
-
-static gint
-OssoDbusCallback(const gchar *interface, const gchar *method,
-                 GArray *arguments, gpointer data, osso_rpc_t *retval)
-{
-  retval->type = DBUS_TYPE_INVALID;
-
-  // The "top_application" method just wants us to focus the top-most window.
-  if (!strcmp("top_application", method)) {
-    nsCOMPtr<nsIDOMWindow> window;
-    GetMostRecentWindow(NS_LITERAL_STRING("").get(), getter_AddRefs(window));
-    if (window)
-      window->Focus();
-
-    return OSSO_OK;
-  }
-
-  if (!strcmp("quit", method)) {
-    nsCOMPtr<nsIAppStartup> appService = do_GetService("@mozilla.org/toolkit/app-startup;1");
-    if (appService)
-      appService->Quit(nsIAppStartup::eForceQuit);
-
-    return OSSO_OK;
-  }
-
-  // Other methods can have arguments, which we convert and send to commandline
-  // handlers.
-  nsCOMPtr<nsICommandLineRunner> cmdLine
-    (do_CreateInstance("@mozilla.org/toolkit/command-line;1"));
-
-  nsCOMPtr<nsIFile> workingDir;
-  NS_GetSpecialDirectory(NS_XPCOM_CURRENT_PROCESS_DIR,
-                         getter_AddRefs(workingDir));
-
-  char** argv = 0;
-  int argc = 0;
-
-  // Not all DBus methods pass arguments
-  if (arguments && arguments->len > 0) {
-    // Create argument list with a dummy argv[0]
-    argc = arguments->len + 1;
-    argv = (char**)calloc(1, argc * sizeof(*argv));
-
-    // Start at 1 to skip the dummy argv[0]
-    for (int i = 1; i < argc; i++) {
-      osso_rpc_t* entry = (osso_rpc_t*)&g_array_index(arguments, osso_rpc_t, i - 1);
-      if (entry->type != DBUS_TYPE_STRING)
-        continue;
-
-      argv[i] = strdup(entry->value.s);
-    }
-  }
-
-  cmdLine->Init(argc, argv, workingDir, nsICommandLine::STATE_REMOTE_AUTO);
-
-  // Cleanup argument list
-  while (argc) {
-    free(argv[--argc]);
-  }
-  free(argv);
-
-  cmdLine->Run();
-
-  return OSSO_OK;
-}
-
-static DBusHandlerResult
-OssoModeControlCallback(DBusConnection *con, DBusMessage *msg, gpointer data)
-{
-  if (dbus_message_is_signal(msg, MCE_SIGNAL_IF, MCE_DEVICE_ORIENTATION_SIG)) {
-    DBusMessageIter iter;
-    if (dbus_message_iter_init(msg, &iter)) {
-      const gchar *mode = NULL;
-      dbus_message_iter_get_basic(&iter, &mode);
-
-      OssoSetWindowOrientation(strcmp(mode, "portrait") == 0);
-    }
-  }
-  return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
-}
-
-#endif
-
 NS_IMETHODIMP
 nsNativeAppSupportUnix::Start(bool *aRetVal)
 {
   NS_ASSERTION(gAppData, "gAppData must not be null.");
 
 // The dbus library is used by both nsWifiScannerDBus and BluetoothDBusService,
 // from diffrent threads. This could lead to race conditions if the dbus is not
 // initialized before making any other library calls.
@@ -427,57 +159,16 @@ nsNativeAppSupportUnix::Start(bool *aRet
                      MIN_GTK_MAJOR_VERSION,
                      MIN_GTK_MINOR_VERSION);
     gtk_dialog_run(GTK_DIALOG(versionErrDialog));
     gtk_widget_destroy(versionErrDialog);
     exit(0);
   }
 #endif
 
-#if (MOZ_PLATFORM_MAEMO == 5)
-  /* zero state out. */
-  memset(&m_hw_state, 0, sizeof(osso_hw_state_t));
-
-  /* Initialize maemo application
-     
-     The initalization name will be of the form "Vendor.Name".
-     If a Vendor isn't given, then we will just use "Name".
-     
-     Note that this value must match your X-Osso-Service name
-     defined in your desktop file.  If it doesn't, the OSSO
-     system will happily kill your process.
-  */
-  nsAutoCString applicationName;
-  if (gAppData->vendor) {
-      applicationName.Append(gAppData->vendor);
-      applicationName.Append(".");
-  }
-  applicationName.Append(gAppData->name);
-  ToLowerCase(applicationName);
-
-  m_osso_context = osso_initialize(applicationName.get(), 
-                                   gAppData->version ? gAppData->version : "1.0",
-                                   true,
-                                   nullptr);
-
-  /* Check that initilialization was ok */
-  if (m_osso_context == nullptr) {
-      return NS_ERROR_FAILURE;
-  }
-
-  osso_hw_set_event_cb(m_osso_context, nullptr, OssoHardwareCallback, &m_hw_state);
-  osso_hw_set_display_event_cb(m_osso_context, OssoDisplayCallback, m_osso_context);
-  osso_rpc_set_default_cb_f(m_osso_context, OssoDbusCallback, nullptr);
-
-  // Setup an MCE callback to monitor orientation
-  DBusConnection *connnection = (DBusConnection*)osso_get_sys_dbus_connection(m_osso_context);
-  dbus_bus_add_match(connnection, MCE_MATCH_RULE, nullptr);
-  dbus_connection_add_filter(connnection, OssoModeControlCallback, nullptr, nullptr);
-#endif
-
   *aRetVal = true;
 
 #if defined(MOZ_X11) && (MOZ_WIDGET_GTK == 2)
 
   PRLibrary *gnomeuiLib = PR_LoadLibrary("libgnomeui-2.so.0");
   if (!gnomeuiLib)
     return NS_OK;
 
@@ -576,43 +267,22 @@ nsNativeAppSupportUnix::Start(bool *aRet
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsNativeAppSupportUnix::Stop(bool *aResult)
 {
   NS_ENSURE_ARG(aResult);
   *aResult = true;
-
-#if (MOZ_PLATFORM_MAEMO == 5)
-  if (m_osso_context) {
-    // Disable the accelerometer when closing
-    OssoRequestAccelerometer(m_osso_context, false);
-
-    // Remove the MCE callback filter
-    DBusConnection *connnection = (DBusConnection*)osso_get_sys_dbus_connection(m_osso_context);
-    dbus_connection_remove_filter(connnection, OssoModeControlCallback, nullptr);
-
-    osso_hw_unset_event_cb(m_osso_context, nullptr);
-    osso_rpc_unset_default_cb_f(m_osso_context, OssoDbusCallback, nullptr);
-    osso_deinitialize(m_osso_context);
-    m_osso_context = nullptr;
-  }
-#endif
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsNativeAppSupportUnix::Enable()
 {
-#if (MOZ_PLATFORM_MAEMO == 5)
-  // Enable the accelerometer for orientation support
-  if (OssoIsScreenOn(m_osso_context))
-      OssoRequestAccelerometer(m_osso_context, true);
-#endif
   return NS_OK;
 }
 
 nsresult
 NS_CreateNativeAppSupport(nsINativeAppSupport **aResult)
 {
   nsNativeAppSupportBase* native = new nsNativeAppSupportUnix();
   if (!native)
--- a/toolkit/xre/nsQAppInstance.cpp
+++ b/toolkit/xre/nsQAppInstance.cpp
@@ -24,42 +24,17 @@ void nsQAppInstance::AddRef(int& aArgc, 
     return;
   if (!sQAppInstance) {
 #if (QT_VERSION < QT_VERSION_CHECK(5,0,0))
     const char *graphicsSystem = getenv("MOZ_QT_GRAPHICSSYSTEM");
     if (graphicsSystem) {
       QApplication::setGraphicsSystem(QString(graphicsSystem));
     }
 #endif
-#if (MOZ_PLATFORM_MAEMO == 6)
-    // Should create simple windows style for non chrome process
-    // otherwise meegotouch style initialize and crash happen
-    // because we don't initialize MComponent for child process
-    if (!aDefaultProcess) {
-      QApplication::setStyle(QLatin1String("windows"));
-    }
-    if (!aArgc) {
-      aArgv[aArgc] = strdup("nsQAppInstance");
-      aArgc++;
-    }
-#endif
     sQAppInstance = new QApplication(aArgc, aArgv);
-#ifdef MOZ_ENABLE_MEEGOTOUCH
-    if (aDefaultProcess) {
-      // GLContext created by meegotouch will be under meego graphics
-      // system control, and will drop GL context automatically in background mode
-      // In order to use that GLContext we need to implement
-      // LayerManager switch in runtime from SW<->HW
-      // That not yet implemented so we need to control GL context,
-      // force software mode for, and create our own QGLWidget
-      gArgv[gArgc] = strdup("-software");
-      gArgc++;
-      sMComponentData = new MComponentData(aArgc, aArgv, "", new MApplicationService(""));
-    }
-#endif
   }
   sQAppRefCount++;
 }
 
 void nsQAppInstance::Release(void) {
   if (sQAppInstance && !--sQAppRefCount) {
 #ifdef MOZ_ENABLE_MEEGOTOUCH
     delete sMComponentData;
--- a/uriloader/exthandler/Makefile.in
+++ b/uriloader/exthandler/Makefile.in
@@ -53,27 +53,14 @@ LOCAL_INCLUDES += -I$(topsrcdir)/dom/bas
 ifeq ($(MOZ_WIDGET_TOOLKIT),windows)
 LOCAL_INCLUDES += -I$(srcdir)/win
 endif
 
 ifdef MOZ_ENABLE_DBUS
 LOCAL_INCLUDES   += $(TK_CFLAGS) $(MOZ_DBUS_CFLAGS)
 endif
 
-ifdef MOZ_ENABLE_MEEGOTOUCHSHARE
-LOCAL_INCLUDES   += $(MOZ_PLATFORM_MAEMO_CFLAGS)
-endif
-
-ifeq ($(MOZ_PLATFORM_MAEMO),5)
-ifdef MOZ_ENABLE_GNOMEVFS
-LOCAL_INCLUDES   += $(MOZ_GNOMEVFS_CFLAGS)
-endif
-ifdef MOZ_ENABLE_GIO
-LOCAL_INCLUDES   += $(MOZ_GIO_CFLAGS)
-endif
-endif
-
 include $(topsrcdir)/config/rules.mk
 include $(topsrcdir)/ipc/chromium/chromium-config.mk
 
 ifneq (,$(filter qt gtk2 gtk3, $(MOZ_WIDGET_TOOLKIT)))
 CXXFLAGS += $(TK_CFLAGS) $(MOZ_DBUS_GLIB_CFLAGS)
 endif
--- a/uriloader/exthandler/nsDBusHandlerApp.cpp
+++ b/uriloader/exthandler/nsDBusHandlerApp.cpp
@@ -6,24 +6,16 @@
 
 #include  <dbus/dbus.h>
 #include "nsDBusHandlerApp.h"
 #include "nsIURI.h"
 #include "nsIClassInfoImpl.h"
 #include "nsCOMPtr.h"
 #include "nsCExternalHandlerService.h"
 
-#if (MOZ_PLATFORM_MAEMO == 5)
-#define APP_LAUNCH_BANNER_SERVICE           "com.nokia.hildon-desktop"
-#define APP_LAUNCH_BANNER_METHOD_INTERFACE  "com.nokia.hildon.hdwm.startupnotification"
-#define APP_LAUNCH_BANNER_METHOD_PATH       "/com/nokia/hildon/hdwm"
-#define APP_LAUNCH_BANNER_METHOD            "starting"
-#endif
-
-
 // XXX why does nsMIMEInfoImpl have a threadsafe nsISupports?  do we need one 
 // here too?
 NS_IMPL_CLASSINFO(nsDBusHandlerApp, NULL, 0, NS_DBUSHANDLERAPP_CID)
 NS_IMPL_ISUPPORTS2_CI(nsDBusHandlerApp, nsIDBusHandlerApp, nsIHandlerApp)
 
 ////////////////////////////////////////////////////////////////////////////////
 //// nsIHandlerApp
 
@@ -118,35 +110,16 @@ nsDBusHandlerApp::LaunchWithURI(nsIURI *
   
   DBusMessageIter iter;
   dbus_message_iter_init_append(msg, &iter);
   dbus_message_iter_append_basic(&iter, DBUS_TYPE_STRING, &uri);
   
   if (dbus_connection_send(connection, msg, NULL)) {
     dbus_connection_flush(connection);
     dbus_message_unref(msg);
-#if (MOZ_PLATFORM_MAEMO == 5)
-    msg = dbus_message_new_method_call (APP_LAUNCH_BANNER_SERVICE,
-                                        APP_LAUNCH_BANNER_METHOD_PATH,
-                                        APP_LAUNCH_BANNER_METHOD_INTERFACE,
-                                        APP_LAUNCH_BANNER_METHOD);
-    
-    if (msg) {
-      const char* service = mService.get();
-      if (dbus_message_append_args(msg,
-                                   DBUS_TYPE_STRING, 
-                                   &service,
-                                   DBUS_TYPE_INVALID)) {
-        if (dbus_connection_send(connection, msg, NULL)) {
-          dbus_connection_flush(connection);
-        }
-        dbus_message_unref(msg);
-      }
-    }
-#endif
   } else {
     dbus_message_unref(msg);
     return NS_ERROR_FAILURE;		    
   }
   return NS_OK;
   
 }
 
--- a/uriloader/exthandler/nsExternalHelperAppService.cpp
+++ b/uriloader/exthandler/nsExternalHelperAppService.cpp
@@ -342,19 +342,16 @@ static nsresult GetDownloadDirectory(nsI
     rv = NS_NewNativeLocalFile(nsDependentCString(downloadDir),
                                true, getter_AddRefs(ldir));
     NS_ENSURE_SUCCESS(rv, rv);
     dir = do_QueryInterface(ldir);
   }
   else {
     return NS_ERROR_FAILURE;
   }
-#elif defined(MOZ_PLATFORM_MAEMO)
-  nsresult rv = NS_GetSpecialDirectory(NS_UNIX_XDG_DOCUMENTS_DIR, getter_AddRefs(dir));
-  NS_ENSURE_SUCCESS(rv, rv);
 #elif defined(XP_WIN)
   // On metro we want to be able to search opened files and the temp directory
   // is exlcuded in searches.
   nsresult rv;
   if (IsRunningInWindowsMetro()) {
     rv = NS_GetSpecialDirectory(NS_WIN_DEFAULT_DOWNLOAD_DIR, getter_AddRefs(dir));
   } else {
     rv = NS_GetSpecialDirectory(NS_OS_TEMP_DIR, getter_AddRefs(dir));
--- a/uriloader/exthandler/unix/nsGNOMERegistry.cpp
+++ b/uriloader/exthandler/unix/nsGNOMERegistry.cpp
@@ -13,20 +13,16 @@
 #include "nsIGnomeVFSService.h"
 #include "nsIGIOService.h"
 
 #ifdef MOZ_WIDGET_GTK
 #include <glib.h>
 #include <glib-object.h>
 #endif
 
-#ifdef MOZ_PLATFORM_MAEMO
-#include <libintl.h>
-#endif
-
 /* static */ bool
 nsGNOMERegistry::HandlerExists(const char *aProtocolScheme)
 {
   nsCOMPtr<nsIGIOService> giovfs = do_GetService(NS_GIOSERVICE_CONTRACTID);
   nsCOMPtr<nsIGConfService> gconf = do_GetService(NS_GCONFSERVICE_CONTRACTID);
   if (giovfs) {
     nsCOMPtr<nsIGIOMimeApp> app;
     if (NS_FAILED(giovfs->GetAppForURIScheme(nsDependentCString(aProtocolScheme),
@@ -166,25 +162,14 @@ nsGNOMERegistry::GetFromType(const nsACS
     if (NS_FAILED(gnomevfs->GetAppForMimeType(aMIMEType, getter_AddRefs(gnomeHandlerApp))) ||
         !gnomeHandlerApp) {
       return nullptr;
     }
     gnomeHandlerApp->GetName(name);
     gnomevfs->GetDescriptionForMimeType(aMIMEType, description);
   }
 
-#ifdef MOZ_PLATFORM_MAEMO
-  // On Maemo/Hildon, GetName ends up calling gnome_vfs_mime_application_get_name,
-  // which happens to return a non-localized message-id for the application. To
-  // get the localized name for the application, we have to call dgettext with 
-  // the default maemo domain-name to try and translate the string into the operating 
-  // system's native language.
-  const char kDefaultTextDomain [] = "maemo-af-desktop";
-  nsAutoCString realName (dgettext(kDefaultTextDomain, PromiseFlatCString(name).get()));
-  mimeInfo->SetDefaultDescription(NS_ConvertUTF8toUTF16(realName));
-#else
   mimeInfo->SetDefaultDescription(NS_ConvertUTF8toUTF16(name));
-#endif
   mimeInfo->SetPreferredAction(nsIMIMEInfo::useSystemDefault);
   mimeInfo->SetDescription(NS_ConvertUTF8toUTF16(description));
 
   return mimeInfo.forget();
 }
--- a/uriloader/exthandler/unix/nsMIMEInfoUnix.cpp
+++ b/uriloader/exthandler/unix/nsMIMEInfoUnix.cpp
@@ -1,20 +1,14 @@
 /* -*- Mode: C++; tab-width: 3; indent-tabs-mode: nil; c-basic-offset: 2 -*-
  *
  * This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-#if (MOZ_PLATFORM_MAEMO == 5) && defined (MOZ_ENABLE_GNOMEVFS)
-#include <glib.h>
-#include <hildon-uri.h>
-#include <hildon-mime.h>
-#include <libosso.h>
-#endif
 #ifdef MOZ_WIDGET_QT
 #include <QDesktopServices>
 #include <QUrl>
 #include <QString>
 #if (MOZ_ENABLE_CONTENTACTION)
 #include <contentaction/contentaction.h>
 #include "nsContentHandlerApp.h"
 #endif
@@ -31,29 +25,16 @@
 #include "nsDBusHandlerApp.h"
 #endif
 
 nsresult
 nsMIMEInfoUnix::LoadUriInternal(nsIURI * aURI)
 {
   nsresult rv = nsGNOMERegistry::LoadURL(aURI);
 
-#if (MOZ_PLATFORM_MAEMO == 5) && defined (MOZ_ENABLE_GNOMEVFS)
-  if (NS_FAILED(rv)){
-    HildonURIAction *action = hildon_uri_get_default_action(mSchemeOrType.get(), nullptr);
-    if (action) {
-      nsAutoCString spec;
-      aURI->GetAsciiSpec(spec);
-      if (hildon_uri_open(spec.get(), action, nullptr))
-        rv = NS_OK;
-      hildon_uri_action_unref(action);
-    }
-  }
-#endif
-
 #ifdef MOZ_WIDGET_QT
   if (NS_FAILED(rv)) {
     nsAutoCString spec;
     aURI->GetAsciiSpec(spec);
     if (QDesktopServices::openUrl(QUrl(spec.get()))) {
       rv = NS_OK;
     }
   }
@@ -81,25 +62,16 @@ nsMIMEInfoUnix::GetHasDefaultHandler(boo
     }
   }
   if (mimeInfo)
     *_retval = true;
 
   if (*_retval)
     return NS_OK;
 
-#if (MOZ_PLATFORM_MAEMO == 5) && defined (MOZ_ENABLE_GNOMEVFS)
-  HildonURIAction *action = hildon_uri_get_default_action(mSchemeOrType.get(), nullptr);
-  if (action) {
-    *_retval = true;
-    hildon_uri_action_unref(action);
-    return NS_OK;
-  }
-#endif
-
 #if defined(MOZ_ENABLE_CONTENTACTION)
   ContentAction::Action action = 
     ContentAction::Action::defaultActionForFile(QUrl(), QString(mSchemeOrType.get()));
   if (action.isValid()) {
     *_retval = true;
     return NS_OK;
   }
 #endif
@@ -114,21 +86,16 @@ nsMIMEInfoUnix::LaunchDefaultWithFile(ns
   // either /etc/mailcap or ${HOME}/.mailcap, in which case we don't want to
   // give the GNOME answer.
   if (mDefaultApplication)
     return nsMIMEInfoImpl::LaunchDefaultWithFile(aFile);
 
   nsAutoCString nativePath;
   aFile->GetNativePath(nativePath);
 
-#if (MOZ_PLATFORM_MAEMO == 5) && defined (MOZ_ENABLE_GNOMEVFS)
-  if(NS_SUCCEEDED(LaunchDefaultWithDBus(PromiseFlatCString(nativePath).get())))
-    return NS_OK;
-#endif
-
 #if defined(MOZ_ENABLE_CONTENTACTION)
   QUrl uri = QUrl::fromLocalFile(QString::fromUtf8(nativePath.get()));
   ContentAction::Action action =
     ContentAction::Action::defaultActionForFile(uri, QString(mSchemeOrType.get()));
   if (action.isValid()) {
     action.trigger();
     return NS_OK;
   }
@@ -178,113 +145,16 @@ nsMIMEInfoUnix::LaunchDefaultWithFile(ns
   }
 
   if (!mDefaultApplication)
     return NS_ERROR_FILE_NOT_FOUND;
 
   return LaunchWithIProcess(mDefaultApplication, nativePath);
 }
 
-#if (MOZ_PLATFORM_MAEMO == 5) && defined (MOZ_ENABLE_GNOMEVFS)
-
-/* This method tries to launch the associated default handler for the given 
- * mime/file via hildon specific APIs (in this case hildon_mime_open_file* 
- * which are essetially wrappers to the DBUS mime_open method). 
- */
-
-nsresult
-nsMIMEInfoUnix::LaunchDefaultWithDBus(const char *aFilePath)
-{
-  const int32_t kHILDON_SUCCESS = 1;
-  int32_t result = 0;
-  DBusError err;
-  dbus_error_init(&err);
-  
-  DBusConnection *connection = dbus_bus_get(DBUS_BUS_SESSION, &err);
-  if (dbus_error_is_set(&err)) {
-    dbus_error_free(&err);
-    return NS_ERROR_FAILURE;
-  }
-
-  if (nullptr == connection)
-    return NS_ERROR_FAILURE;
-
-  result = hildon_mime_open_file_with_mime_type(connection,
-                                                aFilePath,
-                                                mSchemeOrType.get());
-  if (result != kHILDON_SUCCESS)
-    if (hildon_mime_open_file(connection, aFilePath) != kHILDON_SUCCESS)
-      return NS_ERROR_FAILURE;
-
-  return NS_OK;
-}
-
-/* static */ bool
-nsMIMEInfoUnix::HandlerExists(const char *aProtocolScheme)
-{
-  bool isEnabled = false;
-  HildonURIAction *action = hildon_uri_get_default_action(aProtocolScheme, nullptr);
-  if (action) {
-    isEnabled = true;
-    hildon_uri_action_unref(action);
-  }
-  return isEnabled;
-}
-
-NS_IMETHODIMP
-nsMIMEInfoUnix::GetPossibleApplicationHandlers(nsIMutableArray ** aPossibleAppHandlers)
-{
-  if (!mPossibleApplications) {
-    mPossibleApplications = do_CreateInstance(NS_ARRAY_CONTRACTID);
-
-    if (!mPossibleApplications)
-      return NS_ERROR_OUT_OF_MEMORY;
-
-    GSList *actions = hildon_uri_get_actions(mSchemeOrType.get(), nullptr);
-    GSList *actionsPtr = actions;
-    while (actionsPtr) {
-      HildonURIAction *action = (HildonURIAction*)actionsPtr->data;
-      actionsPtr = actionsPtr->next;
-      nsDBusHandlerApp* app = new nsDBusHandlerApp();
-      if (!app){
-        hildon_uri_free_actions(actions);
-        return NS_ERROR_OUT_OF_MEMORY;
-      }
-      nsDependentCString method(hildon_uri_action_get_method(action));
-      nsDependentCString key(hildon_uri_action_get_service(action));
-      nsCString service, objpath, interface;
-      app->SetMethod(method);
-      app->SetName(NS_ConvertUTF8toUTF16(key));
-
-      if (key.FindChar('.', 0) > 0) {
-        service.Assign(key);
-        objpath.Assign(NS_LITERAL_CSTRING("/")+ key);
-        objpath.ReplaceChar('.', '/');
-        interface.Assign(key);
-      } else {
-        service.Assign(NS_LITERAL_CSTRING("com.nokia.")+ key);
-        objpath.Assign(NS_LITERAL_CSTRING("/com/nokia/")+ key);
-        interface.Assign(NS_LITERAL_CSTRING("com.nokia.")+ key);
-      }
-
-      app->SetService(service);
-      app->SetObjectPath(objpath);
-      app->SetDBusInterface(interface);
-
-      mPossibleApplications->AppendElement(app, false);
-    }
-    hildon_uri_free_actions(actions);
-  }
-
-  *aPossibleAppHandlers = mPossibleApplications;
-  NS_ADDREF(*aPossibleAppHandlers);
-  return NS_OK;
-}
-#endif
-
 #if defined(MOZ_ENABLE_CONTENTACTION)
 NS_IMETHODIMP
 nsMIMEInfoUnix::GetPossibleApplicationHandlers(nsIMutableArray ** aPossibleAppHandlers)
 {
   if (!mPossibleApplications) {
     mPossibleApplications = do_CreateInstance(NS_ARRAY_CONTRACTID);
 
     if (!mPossibleApplications)
--- a/uriloader/exthandler/unix/nsMIMEInfoUnix.h
+++ b/uriloader/exthandler/unix/nsMIMEInfoUnix.h
@@ -19,18 +19,14 @@ public:
   static bool HandlerExists(const char *aProtocolScheme);
 
 protected:
   NS_IMETHOD GetHasDefaultHandler(bool *_retval);
 
   virtual NS_HIDDEN_(nsresult) LoadUriInternal(nsIURI *aURI);
 
   virtual NS_HIDDEN_(nsresult) LaunchDefaultWithFile(nsIFile *aFile);
-#if (MOZ_PLATFORM_MAEMO == 5) && defined (MOZ_ENABLE_GNOMEVFS)
-  nsresult LaunchDefaultWithDBus(const char *aFilePath);
-  NS_IMETHOD GetPossibleApplicationHandlers(nsIMutableArray * *aPossibleAppHandlers);
-#endif
 #if defined(MOZ_ENABLE_CONTENTACTION)
   NS_IMETHOD GetPossibleApplicationHandlers(nsIMutableArray * *aPossibleAppHandlers);
 #endif
 };
 
 #endif // nsMIMEInfoUnix_h_
--- a/uriloader/exthandler/unix/nsOSHelperAppService.cpp
+++ b/uriloader/exthandler/unix/nsOSHelperAppService.cpp
@@ -1158,19 +1158,16 @@ nsresult nsOSHelperAppService::OSProtoco
 
   if (action.isValid())
     *aHandlerExists = true;
 #endif
 
 #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_GTK
--- a/widget/LookAndFeel.h
+++ b/widget/LookAndFeel.h
@@ -287,25 +287,16 @@ public:
      *
      * The value of this metric is not used on non-Mac platforms. These
      * platforms should return NS_ERROR_NOT_IMPLEMENTED when queried for this
      * metric.
      */
     eIntID_MacLionTheme,
 
     /*
-     * A Boolean value to determine whether Mameo is using the new Fremantle
-     * theme.
-     *
-     * The value of this metric is not used on other platforms. These platforms
-     * should return NS_ERROR_NOT_IMPLEMENTED when queried for this metric.
-     */
-    eIntID_MaemoClassic,
-
-    /*
      * eIntID_AlertNotificationOrigin indicates from which corner of the
      * screen alerts slide in, and from which direction (horizontal/vertical).
      * 0, the default, represents bottom right, sliding vertically.
      * Use any bitwise combination of the following constants:
      * NS_ALERT_HORIZONTAL (1), NS_ALERT_LEFT (2), NS_ALERT_TOP (4).
      *
      *       6       4
      *     +-----------+
--- a/widget/android/nsLookAndFeel.cpp
+++ b/widget/android/nsLookAndFeel.cpp
@@ -391,17 +391,16 @@ nsLookAndFeel::GetIntImpl(IntID aID, int
             aResult = eScrollThumbStyle_Proportional;
             break;
 
         case eIntID_TouchEnabled:
             aResult = 1;
             break;
 
         case eIntID_WindowsDefaultTheme:
-        case eIntID_MaemoClassic:
         case eIntID_WindowsThemeIdentifier:
         case eIntID_OperatingSystemVersionIdentifier:
             aResult = 0;
             rv = NS_ERROR_NOT_IMPLEMENTED;
             break;
 
         case eIntID_SpellCheckerUnderlineStyle:
             aResult = NS_STYLE_TEXT_DECORATION_STYLE_WAVY;
--- a/widget/cocoa/nsLookAndFeel.mm
+++ b/widget/cocoa/nsLookAndFeel.mm
@@ -381,17 +381,16 @@ nsLookAndFeel::GetIntImpl(IntID aID, int
       break;
     case eIntID_TreeScrollLinesMax:
       aResult = 3;
       break;
     case eIntID_DWMCompositor:
     case eIntID_WindowsClassic:
     case eIntID_WindowsDefaultTheme:
     case eIntID_TouchEnabled:
-    case eIntID_MaemoClassic:
     case eIntID_WindowsThemeIdentifier:
     case eIntID_OperatingSystemVersionIdentifier:
       aResult = 0;
       res = NS_ERROR_NOT_IMPLEMENTED;
       break;
     case eIntID_MacGraphiteTheme:
       aResult = [NSColor currentControlTint] == NSGraphiteControlTint;
       break;
--- a/widget/gonk/nsLookAndFeel.cpp
+++ b/widget/gonk/nsLookAndFeel.cpp
@@ -348,17 +348,16 @@ nsLookAndFeel::GetIntImpl(IntID aID, int
             aResult = eScrollThumbStyle_Proportional;
             break;
 
         case eIntID_TouchEnabled:
             aResult = 1;
             break;
 
         case eIntID_WindowsDefaultTheme:
-        case eIntID_MaemoClassic:
         case eIntID_WindowsThemeIdentifier:
         case eIntID_OperatingSystemVersionIdentifier:
             aResult = 0;
             rv = NS_ERROR_NOT_IMPLEMENTED;
             break;
 
         case eIntID_SpellCheckerUnderlineStyle:
             aResult = NS_STYLE_TEXT_DECORATION_STYLE_WAVY;
--- a/widget/gtk2/Makefile.in
+++ b/widget/gtk2/Makefile.in
@@ -36,22 +36,16 @@ include $(topsrcdir)/ipc/chromium/chromi
 
 CFLAGS          += $(MOZ_STARTUP_NOTIFICATION_CFLAGS)
 CXXFLAGS        += $(MOZ_CAIRO_CFLAGS) $(MOZ_PIXMAN_CFLAGS) \
 		               $(MOZ_STARTUP_NOTIFICATION_CFLAGS)
 
 CFLAGS          += $(TK_CFLAGS)
 CXXFLAGS        += $(TK_CFLAGS)
 
-ifdef MOZ_PLATFORM_MAEMO
-ifdef MOZ_ENABLE_GCONF
-CXXFLAGS += $(MOZ_GCONF_CFLAGS)
-endif
-endif
-
 DEFINES		+= -DCAIRO_GFX -DMOZ_APP_NAME='"$(MOZ_APP_NAME)"'
 
 INCLUDES	+= \
 		-I$(srcdir)/../xpwidgets \
 		-I$(srcdir)/../shared \
 		-I$(topsrcdir)/layout/generic \
 		-I$(topsrcdir)/layout/xul/base/src \
 		-I$(topsrcdir)/other-licenses/atk-1.0 \
--- a/widget/gtk2/nsFilePicker.cpp
+++ b/widget/gtk2/nsFilePicker.cpp
@@ -18,20 +18,16 @@
 #include "nsMemory.h"
 #include "nsEnumeratorUtils.h"
 #include "nsNetUtil.h"
 #include "nsReadableUtils.h"
 #include "mozcontainer.h"
 
 #include "nsFilePicker.h"
 
-#if (MOZ_PLATFORM_MAEMO == 5)
-#include <hildon-fm-2/hildon/hildon-file-chooser-dialog.h>
-#endif
-
 using namespace mozilla;
 
 #define MAX_PREVIEW_SIZE 180
 
 nsIFile *nsFilePicker::mPrevDisplayDirectory = nullptr;
 
 void
 nsFilePicker::Shutdown()
@@ -362,37 +358,28 @@ nsFilePicker::Open(nsIFilePickerShownCal
   title.Adopt(ToNewUTF8String(mTitle));
 
   GtkWindow *parent_widget =
     GTK_WINDOW(mParentWidget->GetNativeData(NS_NATIVE_SHELLWIDGET));
 
   GtkFileChooserAction action = GetGtkFileChooserAction(mMode);
   const gchar *accept_button = (action == GTK_FILE_CHOOSER_ACTION_SAVE)
                                ? GTK_STOCK_SAVE : GTK_STOCK_OPEN;
-#if (MOZ_PLATFORM_MAEMO == 5)
-  GtkWidget *file_chooser =
-    hildon_file_chooser_dialog_new_with_properties(parent_widget,
-                                                   "action", action,
-                                                   "open-button-text", accept_button,
-                                                   NULL);
-  gtk_window_set_title(GTK_WINDOW(file_chooser), title);
-#else
   GtkWidget *file_chooser =
       gtk_file_chooser_dialog_new(title, parent_widget, action,
                                   GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
                                   accept_button, GTK_RESPONSE_ACCEPT,
                                   NULL);
   gtk_dialog_set_alternative_button_order(GTK_DIALOG(file_chooser),
                                           GTK_RESPONSE_ACCEPT,
                                           GTK_RESPONSE_CANCEL,
                                           -1);
   if (mAllowURLs) {
     gtk_file_chooser_set_local_only(GTK_FILE_CHOOSER(file_chooser), FALSE);
   }
-#endif
 
   if (action == GTK_FILE_CHOOSER_ACTION_OPEN || action == GTK_FILE_CHOOSER_ACTION_SAVE) {
     GtkWidget *img_preview = gtk_image_new();
     gtk_file_chooser_set_preview_widget(GTK_FILE_CHOOSER(file_chooser), img_preview);
     g_signal_connect(file_chooser, "update-preview", G_CALLBACK(UpdateFilePreviewWidget), img_preview);
   }
 
   GtkWindow *window = GTK_WINDOW(file_chooser);
--- a/widget/gtk2/nsGtkIMModule.cpp
+++ b/widget/gtk2/nsGtkIMModule.cpp
@@ -1,34 +1,24 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
 /* vim: set ts=4 et sw=4 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-#ifdef MOZ_PLATFORM_MAEMO
-#define MAEMO_CHANGES
-#endif
-
 #ifdef MOZ_LOGGING
 #define FORCE_PR_LOG /* Allow logging in the release build */
 #endif // MOZ_LOGGING
 #include "prlog.h"
 
 #include "nsGtkIMModule.h"
 #include "nsWindow.h"
 #include "mozilla/Preferences.h"
 #include "mozilla/Likely.h"
 
-#ifdef MOZ_PLATFORM_MAEMO
-#include "nsServiceManagerUtils.h"
-#include "nsIObserverService.h"
-#include "mozilla/Services.h"
-#endif
-
 using namespace mozilla;
 using namespace mozilla::widget;
 
 #ifdef PR_LOGGING
 PRLogModuleInfo* gGtkIMLog = nullptr;
 
 static const char*
 GetRangeTypeName(uint32_t aRangeType)
@@ -64,26 +54,19 @@ GetEnabledStateName(uint32_t aState)
         default:
             return "UNKNOWN ENABLED STATUS!!";
     }
 }
 #endif
 
 nsGtkIMModule* nsGtkIMModule::sLastFocusedModule = nullptr;
 
-#ifdef MOZ_PLATFORM_MAEMO
-static bool gIsVirtualKeyboardOpened = false;
-#endif
-
 nsGtkIMModule::nsGtkIMModule(nsWindow* aOwnerWindow) :
     mOwnerWindow(aOwnerWindow), mLastFocusedWindow(nullptr),
     mContext(nullptr),
-#ifndef NS_IME_ENABLED_ON_PASSWORD_FIELD
-    mSimpleContext(nullptr),
-#endif
     mDummyContext(nullptr),
     mCompositionStart(UINT32_MAX), mProcessingKeyEvent(nullptr),
     mCompositionState(eCompositionState_NotComposing),
     mIsIMFocused(false), mIgnoreNativeCompositionEvent(false)
 {
 #ifdef PR_LOGGING
     if (!gGtkIMLog) {
         gGtkIMLog = PR_NewLogModule("nsGtkIMModuleWidgets");
@@ -123,40 +106,16 @@ nsGtkIMModule::Init()
                      this);
     g_signal_connect(mContext, "preedit_start",
                      G_CALLBACK(nsGtkIMModule::OnStartCompositionCallback),
                      this);
     g_signal_connect(mContext, "preedit_end",
                      G_CALLBACK(nsGtkIMModule::OnEndCompositionCallback),
                      this);
 
-#ifndef NS_IME_ENABLED_ON_PASSWORD_FIELD
-    // Simple context
-    mSimpleContext = gtk_im_context_simple_new();
-    gtk_im_context_set_client_window(mSimpleContext, gdkWindow);
-    g_signal_connect(mSimpleContext, "preedit_changed",
-                     G_CALLBACK(&nsGtkIMModule::OnChangeCompositionCallback),
-                     this);
-    g_signal_connect(mSimpleContext, "retrieve_surrounding",
-                     G_CALLBACK(&nsGtkIMModule::OnRetrieveSurroundingCallback),
-                     this);
-    g_signal_connect(mSimpleContext, "delete_surrounding",
-                     G_CALLBACK(&nsGtkIMModule::OnDeleteSurroundingCallback),
-                     this);
-    g_signal_connect(mSimpleContext, "commit",
-                     G_CALLBACK(&nsGtkIMModule::OnCommitCompositionCallback),
-                     this);
-    g_signal_connect(mSimpleContext, "preedit_start",
-                     G_CALLBACK(nsGtkIMModule::OnStartCompositionCallback),
-                     this);
-    g_signal_connect(mSimpleContext, "preedit_end",
-                     G_CALLBACK(nsGtkIMModule::OnEndCompositionCallback),
-                     this);
-#endif // NS_IME_ENABLED_ON_PASSWORD_FIELD
-
     // Dummy context
     mDummyContext = gtk_im_multicontext_new();
     gtk_im_context_set_client_window(mDummyContext, gdkWindow);
 }
 
 nsGtkIMModule::~nsGtkIMModule()
 {
     if (this == sLastFocusedModule) {
@@ -201,24 +160,16 @@ nsGtkIMModule::OnDestroyWindow(nsWindow*
      */
     if (mContext) {
         PrepareToDestroyContext(mContext);
         gtk_im_context_set_client_window(mContext, nullptr);
         g_object_unref(mContext);
         mContext = nullptr;
     }
 
-#ifndef NS_IME_ENABLED_ON_PASSWORD_FIELD
-    if (mSimpleContext) {
-        gtk_im_context_set_client_window(mSimpleContext, nullptr);
-        g_object_unref(mSimpleContext);
-        mSimpleContext = nullptr;
-    }
-#endif // NS_IME_ENABLED_ON_PASSWORD_FIELD
-
     if (mDummyContext) {
         // mContext and mDummyContext have the same slaveType and signal_data
         // so no need for another workaround_gtk_im_display_closed.
         gtk_im_context_set_client_window(mDummyContext, nullptr);
         g_object_unref(mDummyContext);
         mDummyContext = nullptr;
     }
 
@@ -567,123 +518,47 @@ nsGtkIMModule::SetInputContext(nsWindow*
 
     // Even when aState is not enabled state, we need to set IME focus.
     // Because some IMs are updating the status bar of them at this time.
     // Be aware, don't use aWindow here because this method shouldn't move
     // focus actually.
     if (changingEnabledState) {
         Focus();
     }
-
-#if (MOZ_PLATFORM_MAEMO == 5)
-    GtkIMContext *im = GetContext();
-    if (im) {
-        if (IsEnabled()) {
-            // Ensure that opening the virtual keyboard is allowed for this specific
-            // InputContext depending on the content.ime.strict.policy pref
-            if (mInputContext.mIMEState.mEnabled != IMEState::DISABLED && 
-                mInputContext.mIMEState.mEnabled != IMEState::PLUGIN &&
-                Preferences::GetBool("content.ime.strict_policy", false) &&
-                !aAction->ContentGotFocusByTrustedCause() &&
-                !aAction->UserMightRequestOpenVKB()) {
-                return;
-            }
-
-            // It is not desired that the hildon's autocomplete mechanism displays
-            // user previous entered passwds, so lets make completions invisible
-            // in these cases.
-            int mode;
-            g_object_get(im, "hildon-input-mode", &mode, NULL);
-
-            if (mInputContext.mIMEState.mEnabled == IMEState::ENABLED ||
-                mInputContext.mIMEState.mEnabled == IMEState::PLUGIN) {
-                mode &= ~HILDON_GTK_INPUT_MODE_INVISIBLE;
-            } else if (mInputContext.mIMEState.mEnabled == IMEState::PASSWORD) {
-               mode |= HILDON_GTK_INPUT_MODE_INVISIBLE;
-            }
-
-            // Turn off auto-capitalization for editboxes
-            mode &= ~HILDON_GTK_INPUT_MODE_AUTOCAP;
-
-            // Turn off predictive dictionaries for editboxes
-            mode &= ~HILDON_GTK_INPUT_MODE_DICTIONARY;
-
-            g_object_set(im, "hildon-input-mode",
-                         (HildonGtkInputMode)mode, NULL);
-            gIsVirtualKeyboardOpened = true;
-            hildon_gtk_im_context_show(im);
-        } else {
-            gIsVirtualKeyboardOpened = false;
-            hildon_gtk_im_context_hide(im);
-        }
-    }
-
-    nsCOMPtr<nsIObserverService> observerService =
-        mozilla::services::GetObserverService();
-    if (observerService) {
-        nsAutoString rectBuf;
-        int32_t x, y, w, h;
-        gdk_window_get_position(aCaller->GetGdkWindow(), &x, &y);
-        gdk_window_get_size(aCaller->GetGdkWindow(), &w, &h);
-        rectBuf.Assign(NS_LITERAL_STRING("{\"left\": "));
-        rectBuf.AppendInt(x);
-        rectBuf.Append(NS_LITERAL_STRING(", \"top\": "));
-        rectBuf.AppendInt(y);
-        rectBuf.Append(NS_LITERAL_STRING(", \"right\": "));
-        rectBuf.AppendInt(w);
-        rectBuf.Append(NS_LITERAL_STRING(", \"bottom\": "));
-        rectBuf.AppendInt(h);
-        rectBuf.Append(NS_LITERAL_STRING("}"));
-        observerService->NotifyObservers(nullptr, "softkb-change",
-                                         rectBuf.get());
-    }
-#endif
 }
 
 InputContext
 nsGtkIMModule::GetInputContext()
 {
     mInputContext.mIMEState.mOpen = IMEState::OPEN_STATE_NOT_SUPPORTED;
     return mInputContext;
 }
 
 /* static */
 bool
 nsGtkIMModule::IsVirtualKeyboardOpened()
 {
-#ifdef MOZ_PLATFORM_MAEMO
-    return gIsVirtualKeyboardOpened;
-#else
     return false;
-#endif
 }
 
 GtkIMContext*
 nsGtkIMModule::GetContext()
 {
     if (IsEnabled()) {
         return mContext;
     }
 
-#ifndef NS_IME_ENABLED_ON_PASSWORD_FIELD
-    if (mInputContext.mIMEState.mEnabled == IMEState::PASSWORD) {
-        return mSimpleContext;
-    }
-#endif // NS_IME_ENABLED_ON_PASSWORD_FIELD
-
     return mDummyContext;
 }
 
 bool
 nsGtkIMModule::IsEnabled()
 {
     return mInputContext.mIMEState.mEnabled == IMEState::ENABLED ||
-#ifdef NS_IME_ENABLED_ON_PASSWORD_FIELD
            mInputContext.mIMEState.mEnabled == IMEState::PASSWORD ||
-#endif // NS_IME_ENABLED_ON_PASSWORD_FIELD
            mInputContext.mIMEState.mEnabled == IMEState::PLUGIN;
 }
 
 bool
 nsGtkIMModule::IsEditable()
 {
     return mInputContext.mIMEState.mEnabled == IMEState::ENABLED ||
            mInputContext.mIMEState.mEnabled == IMEState::PLUGIN ||
--- a/widget/gtk2/nsGtkIMModule.h
+++ b/widget/gtk2/nsGtkIMModule.h
@@ -12,22 +12,16 @@
 #include <gtk/gtk.h>
 
 #include "nsString.h"
 #include "nsAutoPtr.h"
 #include "nsTArray.h"
 #include "nsGUIEvent.h"
 #include "nsIWidget.h"
 
-// If software keyboard is needed in password field and uses GTK2 IM module
-// for inputting characters, we need to enable IME in password field too.
-#ifdef MOZ_PLATFORM_MAEMO
-#define NS_IME_ENABLED_ON_PASSWORD_FIELD 1
-#endif
-
 class nsWindow;
 
 class nsGtkIMModule
 {
 protected:
     typedef mozilla::widget::InputContext InputContext;
     typedef mozilla::widget::InputContextAction InputContextAction;
 
@@ -105,23 +99,21 @@ protected:
     nsWindow* mOwnerWindow;
 
     // A last focused window in this class's context.
     nsWindow* mLastFocusedWindow;
 
     // Actual context. This is used for handling the user's input.
     GtkIMContext       *mContext;
 
-#ifndef NS_IME_ENABLED_ON_PASSWORD_FIELD
     // mSimpleContext is used for the password field and
     // the |ime-mode: disabled;| editors.  These editors disable IME.
     // But dead keys should work.  Fortunately, the simple IM context of
     // GTK2 support only them.
     GtkIMContext       *mSimpleContext;
-#endif // NS_IME_ENABLED_ON_PASSWORD_FIELD
 
     // mDummyContext is a dummy context and will be used in Focus()
     // when the state of mEnabled means disabled.  This context's IME state is
     // always "closed", so it closes IME forcedly.
     GtkIMContext       *mDummyContext;
 
     // IME enabled state and other things defined in InputContext.
     // Use following helper methods if you don't need the detail of the status.
--- a/widget/gtk2/nsGtkKeyUtils.cpp
+++ b/widget/gtk2/nsGtkKeyUtils.cpp
@@ -732,19 +732,16 @@ KeymapWrapper::InitKeyEvent(nsKeyEvent& 
             keymapWrapper->GetModifierKey(aGdkKeyEvent->hardware_keycode);
         if (modifierKey) {
             // If new modifier key is pressed, add the pressed mod mask.
             modifierState |= modifierKey->mMask;
         }
     }
     InitInputEvent(aKeyEvent, modifierState);
 
-#ifdef MOZ_PLATFORM_MAEMO
-    aKeyEvent.location = nsIDOMKeyEvent::DOM_KEY_LOCATION_MOBILE;
-#else // #ifdef MOZ_PLATFORM_MAEMO
     switch (aGdkKeyEvent->keyval) {
         case GDK_Shift_L:
         case GDK_Control_L:
         case GDK_Alt_L:
         case GDK_Super_L:
         case GDK_Hyper_L:
         case GDK_Meta_L:
             aKeyEvent.location = nsIDOMKeyEvent::DOM_KEY_LOCATION_LEFT;
@@ -796,17 +793,16 @@ KeymapWrapper::InitKeyEvent(nsKeyEvent& 
         case GDK_KP_Divide:
             aKeyEvent.location = nsIDOMKeyEvent::DOM_KEY_LOCATION_NUMPAD;
             break;
 
         default:
             aKeyEvent.location = nsIDOMKeyEvent::DOM_KEY_LOCATION_STANDARD;
             break;
     }
-#endif // #ifdef MOZ_PLATFORM_MAEMO #else
 
     PR_LOG(gKeymapWrapperLog, PR_LOG_ALWAYS,
         ("KeymapWrapper(%p): InitKeyEvent, modifierState=0x%08X "
          "aGdkKeyEvent={ type=%s, keyval=%s(0x%X), state=0x%08X, "
          "hardware_keycode=0x%08X, is_modifier=%s } "
          "aKeyEvent={ message=%s, isShift=%s, isControl=%s, "
          "isAlt=%s, isMeta=%s }",
          keymapWrapper, modifierState,
--- a/widget/gtk2/nsIdleServiceGTK.cpp
+++ b/widget/gtk2/nsIdleServiceGTK.cpp
@@ -88,19 +88,17 @@ nsIdleServiceGTK::~nsIdleServiceGTK()
     }
 #endif
 }
 
 bool
 nsIdleServiceGTK::PollIdleTime(uint32_t *aIdleTime)
 {
     if (!sInitialized) {
-        // For some reason, we could not find xscreensaver.  This this might be
-        // because we are on a mobile platforms (e.g. Maemo/OSSO).  In this
-        // case, let the base class handle it
+        // For some reason, we could not find xscreensaver.
         return false;
     }
 
     // Ask xscreensaver about idle time:
     *aIdleTime = 0;
 
     // We might not have a display (cf. in xpcshell)
     Display *dplay = GDK_DISPLAY_XDISPLAY(gdk_display_get_default());
--- a/widget/gtk2/nsLookAndFeel.cpp
+++ b/widget/gtk2/nsLookAndFeel.cpp
@@ -19,22 +19,16 @@
 #endif
 
 #include <fontconfig/fontconfig.h>
 #include "gfxPlatformGtk.h"
 
 #include "gtkdrawing.h"
 #include "nsStyleConsts.h"
 
-#ifdef MOZ_PLATFORM_MAEMO
-#include "nsIServiceManager.h"
-#include "nsIPropertyBag2.h"
-#include "nsLiteralString.h"
-#endif
-
 using mozilla::LookAndFeel;
 
 #define GDK_COLOR_TO_NS_RGB(c) \
     ((nscolor) NS_RGB(c.red>>8, c.green>>8, c.blue>>8))
 #define GDK_RGBA_TO_NS_RGBA(c) \
     ((nscolor) NS_RGBA((int)((c).red*255), (int)((c).green*255), \
                        (int)((c).blue*255), (int)((c).alpha*255)))
 
@@ -625,43 +619,18 @@ nsLookAndFeel::GetIntImpl(IntID aID, int
     case eIntID_WindowsClassic:
     case eIntID_WindowsDefaultTheme:
     case eIntID_WindowsThemeIdentifier:
     case eIntID_OperatingSystemVersionIdentifier:
         aResult = 0;
         res = NS_ERROR_NOT_IMPLEMENTED;
         break;
     case eIntID_TouchEnabled:
-#ifdef MOZ_PLATFORM_MAEMO
-        // All Hildon devices are touch-enabled
-        aResult = 1;
-#else
         aResult = 0;
         res = NS_ERROR_NOT_IMPLEMENTED;
-#endif
-        break;
-    case eIntID_MaemoClassic:
-#ifdef MOZ_PLATFORM_MAEMO
-        {
-            aResult = 0;
-            nsCOMPtr<nsIPropertyBag2> infoService(do_GetService("@mozilla.org/system-info;1"));
-            if (infoService) {
-                nsCString deviceType;
-                nsresult rv = infoService->GetPropertyAsACString(NS_LITERAL_STRING("device"),
-                                                                 deviceType);
-                if (NS_SUCCEEDED(rv)) {
-                    if (deviceType.EqualsLiteral("Nokia N8xx"))
-                        aResult = 1;
-                }
-            }
-        }
-#else
-        aResult = 0;
-        res = NS_ERROR_NOT_IMPLEMENTED;
-#endif
         break;
     case eIntID_MacGraphiteTheme:
     case eIntID_MacLionTheme:
         aResult = 0;
         res = NS_ERROR_NOT_IMPLEMENTED;
         break;
     case eIntID_AlertNotificationOrigin:
         aResult = NS_ALERT_TOP;
@@ -1279,14 +1248,10 @@ nsLookAndFeel::RefreshImpl()
     mButtonStyle = nullptr;
 #endif
 
     Init();
 }
 
 bool
 nsLookAndFeel::GetEchoPasswordImpl() {
-#ifdef MOZ_PLATFORM_MAEMO
-    return true;
-#else
     return false;
-#endif
 }
--- a/widget/gtk2/nsWindow.cpp
+++ b/widget/gtk2/nsWindow.cpp
@@ -3,21 +3,16 @@
  */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "mozilla/Util.h"
 #include <algorithm>
 
-#ifdef MOZ_PLATFORM_MAEMO
-// needed to include hildon parts in gtk.h
-#define MAEMO_CHANGES
-#endif
-
 #include "prlink.h"
 #include "nsGTKToolkit.h"
 #include "nsIRollupListener.h"
 #include "nsIDOMNode.h"
 
 #include "nsWidgetsCID.h"
 #include "nsDragService.h"
 #include "nsIWidgetListener.h"
@@ -133,19 +128,16 @@ using mozilla::layers::LayerManagerOGL;
 // out to the bounding-box if there are more
 #define MAX_RECTS_IN_REGION 100
 
 const gint kEvents = GDK_EXPOSURE_MASK | GDK_STRUCTURE_MASK |
                      GDK_VISIBILITY_NOTIFY_MASK |
                      GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK |
                      GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK |
                      GDK_SCROLL_MASK |
-#ifdef MOZ_PLATFORM_MAEMO
-                     GDK_POINTER_MOTION_HINT_MASK |
-#endif
                      GDK_POINTER_MOTION_MASK;
 
 /* utility functions */
 static bool       is_mouse_in_window(GdkWindow* aWindow,
                                      gdouble aMouseX, gdouble aMouseY);
 static nsWindow  *get_window_for_gtk_widget(GtkWidget *widget);
 static nsWindow  *get_window_for_gdk_window(GdkWindow *window);
 static GtkWidget *get_gtk_widget_for_gdk_window(GdkWindow *window);
@@ -716,48 +708,24 @@ nsIWidget *
 nsWindow::GetParent(void)
 {
     return mParent;
 }
 
 float
 nsWindow::GetDPI()
 {
-
-#ifdef MOZ_PLATFORM_MAEMO
-    static float sDPI = 0;
-
-    if (!sDPI) {
-        // X on Maemo does not report true DPI: https://bugs.maemo.org/show_bug.cgi?id=4825
-        nsCOMPtr<nsIPropertyBag2> infoService = do_GetService("@mozilla.org/system-info;1");
-        NS_ASSERTION(infoService, "Could not find a system info service");
-
-        nsCString deviceType;
-        infoService->GetPropertyAsACString(NS_LITERAL_STRING("device"), deviceType);
-        if (deviceType.EqualsLiteral("Nokia N900")) {
-            sDPI = 265.0f;
-        } else if (deviceType.EqualsLiteral("Nokia N8xx")) {
-            sDPI = 225.0f;
-        } else {
-            // Fall back to something sane.
-            NS_WARNING("Unknown device - using default DPI");
-            sDPI = 96.0f;
-        }
-    }
-    return sDPI;
-#else
     Display *dpy = GDK_DISPLAY_XDISPLAY(gdk_display_get_default());
     int defaultScreen = DefaultScreen(dpy);
     double heightInches = DisplayHeightMM(dpy, defaultScreen)/MM_PER_INCH_FLOAT;
     if (heightInches < 0.25) {
         // Something's broken, but we'd better not crash.
         return 96.0f;
     }
     return float(DisplayHeight(dpy, defaultScreen)/heightInches);
-#endif
 }
 
 NS_IMETHODIMP
 nsWindow::SetParent(nsIWidget *aNewParent)
 {
     if (mContainer || !mGdkWindow) {
         NS_NOTREACHED("nsWindow::SetParent called illegally");
         return NS_ERROR_NOT_IMPLEMENTED;
@@ -3124,22 +3092,16 @@ nsWindow::OnVisibilityNotifyEvent(GdkEve
         if (mIsFullyObscured && mHasMappedToplevel) {
             // GDK_EXPOSE events have been ignored, so make sure GDK
             // doesn't think that the window has already been painted.
             gdk_window_invalidate_rect(mGdkWindow, NULL, FALSE);
         }
 
         mIsFullyObscured = false;
 
-        // In Hildon/Maemo, a browser window will get into 'patially visible' state wheneven an
-        // autocomplete feature is dropped down (from urlbar or from an entry form completion),
-        // and there are no much further ways for that to happen in the plaftorm. In such cases, if hildon
-        // virtual keyboard is up, we can not grab focus to any dropdown list. Reason: nsWindow::EnsureGrabs()
-        // calls gdk_pointer_grab() which grabs the pointer (usually a mouse) so that all events are passed
-        // to this it until the pointer is ungrabbed.
         if (!nsGtkIMModule::IsVirtualKeyboardOpened()) {
             // if we have to retry the grab, retry it.
             EnsureGrabs();
         }
         break;
     default: // includes GDK_VISIBILITY_FULLY_OBSCURED
         mIsFullyObscured = true;
         break;
@@ -3608,35 +3570,16 @@ nsWindow::Create(nsIWidget        *aPare
 
         GtkSettings* default_settings = gtk_settings_get_default();
         g_signal_connect_after(default_settings,
                                "notify::gtk-theme-name",
                                G_CALLBACK(theme_changed_cb), this);
         g_signal_connect_after(default_settings,
                                "notify::gtk-font-name",
                                G_CALLBACK(theme_changed_cb), this);
-
-#ifdef MOZ_PLATFORM_MAEMO
-        if (mWindowType == eWindowType_toplevel) {
-            GdkWindow *gdkwin = gtk_widget_get_window(mShell);
-
-            // Tell the Hildon desktop that we support being rotated
-            gulong portrait_set = 1;
-            GdkAtom support = gdk_atom_intern("_HILDON_PORTRAIT_MODE_SUPPORT", FALSE);
-            gdk_property_change(gdkwin, support, gdk_x11_xatom_to_atom(XA_CARDINAL),
-                                32, GDK_PROP_MODE_REPLACE,
-                                (const guchar *) &portrait_set, 1);
-
-            // Tell maemo-status-volume daemon to ungrab keys
-            gulong volume_set = 1;
-            GdkAtom keys = gdk_atom_intern("_HILDON_ZOOM_KEY_ATOM", FALSE);
-            gdk_property_change(gdkwin, keys, gdk_x11_xatom_to_atom(XA_INTEGER),
-                                32, GDK_PROP_MODE_REPLACE, (const guchar *) &volume_set, 1);
-        }
-#endif
     }
 
     if (mContainer) {
         // Widget signals
         g_signal_connect(mContainer, "unrealize",
                          G_CALLBACK(container_unrealize_cb), NULL);
         g_signal_connect_after(mContainer, "size_allocate",
                                G_CALLBACK(size_allocate_cb), NULL);
@@ -4397,19 +4340,16 @@ nsWindow::GrabPointer(guint32 aTime)
         return;
 
     gint retval;
     retval = gdk_pointer_grab(mGdkWindow, TRUE,
                               (GdkEventMask)(GDK_BUTTON_PRESS_MASK |
                                              GDK_BUTTON_RELEASE_MASK |
                                              GDK_ENTER_NOTIFY_MASK |
                                              GDK_LEAVE_NOTIFY_MASK |
-#ifdef MOZ_PLATFORM_MAEMO
-                                             GDK_POINTER_MOTION_HINT_MASK |
-#endif
                                              GDK_POINTER_MOTION_MASK),
                               (GdkWindow *)NULL, NULL, aTime);
 
     if (retval == GDK_GRAB_NOT_VIEWABLE) {
         LOG(("GrabPointer: window not viewable; will retry\n"));
         mRetryPointerGrab = true;
     } else if (retval != GDK_GRAB_SUCCESS) {
         LOG(("GrabPointer: pointer grab failed: %i\n", retval));
@@ -5192,19 +5132,16 @@ motion_notify_event_cb(GtkWidget *widget
     UpdateLastInputEventTime(event);
 
     nsWindow *window = GetFirstNSWindowForGDKWindow(event->window);
     if (!window)
         return FALSE;
 
     window->OnMotionNotifyEvent(event);
 
-#ifdef MOZ_PLATFORM_MAEMO
-    gdk_event_request_motions(event);
-#endif
     return TRUE;
 }
 
 static gboolean
 button_press_event_cb(GtkWidget *widget, GdkEventButton *event)
 {
     UpdateLastInputEventTime(event);
 
--- a/widget/os2/nsLookAndFeel.cpp
+++ b/widget/os2/nsLookAndFeel.cpp
@@ -307,17 +307,16 @@ nsLookAndFeel::GetIntImpl(IntID aID, int
     case eIntID_TouchEnabled:
     case eIntID_WindowsThemeIdentifier:
     case eIntID_OperatingSystemVersionIdentifier:
         aResult = 0;
         res = NS_ERROR_NOT_IMPLEMENTED;
         break;
     case eIntID_MacGraphiteTheme:
     case eIntID_MacLionTheme:
-    case eIntID_MaemoClassic:
         aResult = 0;
         res = NS_ERROR_NOT_IMPLEMENTED;
         break;
     case eIntID_IMERawInputUnderlineStyle:
     case eIntID_IMEConvertedTextUnderlineStyle:
         aResult = NS_STYLE_TEXT_DECORATION_STYLE_SOLID;
         break;
     case eIntID_IMESelectedRawTextUnderlineStyle:
--- a/widget/qt/Makefile.in
+++ b/widget/qt/Makefile.in
@@ -12,19 +12,19 @@ include $(DEPTH)/config/autoconf.mk
 
 EXPORT_LIBRARY = 1
 SHARED_LIBRARY_LIBS = ../xpwidgets/libxpwidgets_s.a
 
 include $(topsrcdir)/config/rules.mk
 include $(topsrcdir)/ipc/chromium/chromium-config.mk
 
 CXXFLAGS	+= $(MOZ_QT_CFLAGS) $(GLIB_CFLAGS) $(MOZ_CAIRO_CFLAGS) \
-		$(MOZ_PIXMAN_CFLAGS) $(MOZ_PLATFORM_MAEMO_CFLAGS)
+		$(MOZ_PIXMAN_CFLAGS)
 CFLAGS		+= $(MOZ_QT_CFLAGS) $(GLIB_CFLAGS) $(MOZ_CAIRO_CFLAGS) \
-		$(MOZ_PIXMAN_CFLAGS) $(MOZ_PLATFORM_MAEMO_CFLAGS)
+		$(MOZ_PIXMAN_CFLAGS)
 
 #DEFINES		+= -DDEBUG_WIDGETS
 
 ifeq ($(OS_ARCH), Linux)
 DEFINES         += -D_BSD_SOURCE
 endif
 ifeq ($(OS_ARCH), SunOS) 
 ifndef GNU_CC
--- a/widget/qt/faststartupqt/Makefile.in
+++ b/widget/qt/faststartupqt/Makefile.in
@@ -32,15 +32,14 @@ EXPORT_SOURCES = \
 	$(topsrcdir)/widget/qt/mozqglwidgetwrapper.cpp
 
 GARBAGE += $(EXPORT_SOURCES)
 export:: $(EXPORT_SOURCES)
 	$(INSTALL) $^ .
 
 LOCAL_INCLUDES += \
 	$(MOZ_QT_CFLAGS) \
-	$(MOZ_PLATFORM_MAEMO_CFLAGS) \
 	$(NULL)
 
 DEFINES += -DLIBRARY_FILENAME="$(SHARED_LIBRARY)" -DMOZ_NO_MOZALLOC -DXPCOM_GLUE
 
 include $(topsrcdir)/config/rules.mk
 
--- a/widget/qt/faststartupqt/nsFastStartupQt.cpp
+++ b/widget/qt/faststartupqt/nsFastStartupQt.cpp
@@ -48,19 +48,16 @@ nsFastStartup::GetStartupGraphicsView(QW
 {
   MozGraphicsView* view = NULL;
   if (sFastStartup && sFastStartup->mGraphicsView) {
     view = sFastStartup->mGraphicsView;
   } else {
     view = new MozGraphicsView(parentWidget);
     Qt::WindowFlags flags = Qt::Widget;
     view->setWindowFlags(flags);
-#if MOZ_PLATFORM_MAEMO == 6
-    view->setViewport(new QGLWidget());
-#endif
   }
   view->SetTopLevel(aTopChild, parentWidget);
 
   return view;
 }
 
 nsFastStartup*
 nsFastStartup::GetSingleton()
@@ -113,21 +110,17 @@ nsFastStartup::CreateFastStartup(int& ar
           this, SLOT(symbolsLoadingFinished(bool)));
   mThread->SetLoader(aFunc, execPath);
   // Create Static UI widget and view
   IMozQWidget* fakeWidget = new MozQWidgetFast(NULL, NULL);
   mGraphicsView = GetStartupGraphicsView(NULL, fakeWidget);
   mFakeWidget = fakeWidget;
 
   mThread->start();
-#ifdef MOZ_PLATFORM_MAEMO
-  mGraphicsView->showFullScreen();
-#else
   mGraphicsView->showNormal();
-#endif
 
   // Start native loop in order to get view opened and painted once
   // Will block CreateFastStartup function and
   // exit when symbols are loaded and Static UI shown
   mLoop.exec();
 
   return true;
 }
--- a/widget/qt/mozqwidget.cpp
+++ b/widget/qt/mozqwidget.cpp
@@ -193,48 +193,21 @@ void MozQWidget::hoverLeaveEvent(QGraphi
 
 void MozQWidget::hoverMoveEvent(QGraphicsSceneHoverEvent* aEvent)
 {
     mReceiver->OnMotionNotifyEvent(aEvent->pos(), aEvent->modifiers());
 }
 
 void MozQWidget::keyPressEvent(QKeyEvent* aEvent)
 {
-#if (MOZ_PLATFORM_MAEMO == 6)
-    if (!gKeyboardOpen ||
-       //those might get sended as KeyEvents, even in 'NormalMode'
-       aEvent->key() == Qt::Key_Space ||
-       aEvent->key() == Qt::Key_Return ||
-       aEvent->key() == Qt::Key_Backspace) {
-        mReceiver->OnKeyPressEvent(aEvent);
-    }
-#elif (MOZ_PLATFORM_MAEMO == 5)
-    // Below removed to prevent invertion of upper and lower case
-    // See bug 561234
-    // mReceiver->OnKeyPressEvent(aEvent);
-#else
     mReceiver->OnKeyPressEvent(aEvent);
-#endif
 }
 
 void MozQWidget::keyReleaseEvent(QKeyEvent* aEvent)
 {
-#if (MOZ_PLATFORM_MAEMO == 6)
-    if (!gKeyboardOpen ||
-       //those might get sended as KeyEvents, even in 'NormalMode'
-       aEvent->key() == Qt::Key_Space ||
-       aEvent->key() == Qt::Key_Return ||
-       aEvent->key() == Qt::Key_Backspace) {
-        mReceiver->OnKeyReleaseEvent(aEvent);
-    }
-    return;
-#elif (MOZ_PLATFORM_MAEMO == 5)
-    // Below line should be removed when bug 561234 is fixed
-    mReceiver->OnKeyPressEvent(aEvent);
-#endif
     mReceiver->OnKeyReleaseEvent(aEvent);
 }
 
 void MozQWidget::inputMethodEvent(QInputMethodEvent* aEvent)
 {
     QString currentPreeditString = aEvent->preeditString();
     QString currentCommitString = aEvent->commitString();
 
--- a/widget/qt/nsIdleServiceQt.cpp
+++ b/widget/qt/nsIdleServiceQt.cpp
@@ -8,17 +8,17 @@
 #ifdef MOZ_X11
 #include "mozilla/X11Util.h"
 #endif
 #include "nsIdleServiceQt.h"
 #include "nsIServiceManager.h"
 #include "nsDebug.h"
 #include "prlink.h"
 
-#if !defined(MOZ_PLATFORM_MAEMO) && defined(MOZ_X11)
+#if defined(MOZ_X11)
 typedef bool (*_XScreenSaverQueryExtension_fn)(Display* dpy, int* event_base,
                                                  int* error_base);
 
 typedef XScreenSaverInfo* (*_XScreenSaverAllocInfo_fn)(void);
 
 typedef void (*_XScreenSaverQueryInfo_fn)(Display* dpy, Drawable drw,
                                           XScreenSaverInfo *info);
 
@@ -27,27 +27,27 @@ static _XScreenSaverAllocInfo_fn _XSSAll
 static _XScreenSaverQueryInfo_fn _XSSQueryInfo = nullptr;
 #endif
 
 static bool sInitialized = false;
 
 NS_IMPL_ISUPPORTS_INHERITED0(nsIdleServiceQt, nsIdleService)
 
 nsIdleServiceQt::nsIdleServiceQt()
-#if !defined(MOZ_PLATFORM_MAEMO) && defined(MOZ_X11)
+#if defined(MOZ_X11)
     : mXssInfo(nullptr)
 #endif
 {
 }
 
 static void Initialize()
 {
     sInitialized = true;
 
-#if !defined(MOZ_PLATFORM_MAEMO) && defined(MOZ_X11)
+#if defined(MOZ_X11)
     // This will leak - See comments in ~nsIdleServiceQt().
     PRLibrary* xsslib = PR_LoadLibrary("libXss.so.1");
     if (!xsslib) {
         return;
     }
 
     _XSSQueryExtension = (_XScreenSaverQueryExtension_fn)
         PR_FindFunctionSymbol(xsslib, "XScreenSaverQueryExtension");
@@ -55,17 +55,17 @@ static void Initialize()
         PR_FindFunctionSymbol(xsslib, "XScreenSaverAllocInfo");
     _XSSQueryInfo = (_XScreenSaverQueryInfo_fn)
         PR_FindFunctionSymbol(xsslib, "XScreenSaverQueryInfo");
 #endif
 }
 
 nsIdleServiceQt::~nsIdleServiceQt()
 {
-#if !defined(MOZ_PLATFORM_MAEMO) && defined(MOZ_X11)
+#if defined(MOZ_X11)
     if (mXssInfo)
         XFree(mXssInfo);
 
 // It is not safe to unload libXScrnSaver until each display is closed because
 // the library registers callbacks through XESetCloseDisplay (Bug 397607).
 // (Also the library and its functions are scoped for the file not the object.)
 #if 0
     if (xsslib) {
@@ -74,17 +74,17 @@ nsIdleServiceQt::~nsIdleServiceQt()
     }
 #endif
 #endif
 }
 
 bool
 nsIdleServiceQt::PollIdleTime(uint32_t *aIdleTime)
 {
-#if !defined(MOZ_PLATFORM_MAEMO) && defined(MOZ_X11)
+#if defined(MOZ_X11)
     // Ask xscreensaver about idle time:
     *aIdleTime = 0;
 
     // We might not have a display (cf. in xpcshell)
     Display *dplay = mozilla::DefaultXDisplay();
     if (!dplay) {
         return false;
     }
@@ -110,14 +110,14 @@ nsIdleServiceQt::PollIdleTime(uint32_t *
 #endif
 
     return false;
 }
 
 bool
 nsIdleServiceQt::UsePollMode()
 {
-#if !defined(MOZ_PLATFORM_MAEMO) && defined(MOZ_X11)
+#if defined(MOZ_X11)
     return false;
 #endif
     return true;
 }
 
--- a/widget/qt/nsIdleServiceQt.h
+++ b/widget/qt/nsIdleServiceQt.h
@@ -5,17 +5,17 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef nsIdleServiceQt_h__
 #define nsIdleServiceQt_h__
 
 #include "nsIdleService.h"
 
-#if !defined(MOZ_PLATFORM_MAEMO) && defined(MOZ_X11)
+#if defined(MOZ_X11)
 #include <X11/Xlib.h>
 #include <X11/Xutil.h>
 
 typedef struct {
     Window window;              // Screen saver window
     int state;                  // ScreenSaver(Off,On,Disabled)
     int kind;                   // ScreenSaver(Blanked,Internal,External)
     unsigned long til_or_since; // milliseconds since/til screensaver kicks in
@@ -38,17 +38,17 @@ public:
         if (!idleService) {
             idleService = new nsIdleServiceQt();
         }
         
         return idleService.forget();
     }
 
 private:
-#if !defined(MOZ_PLATFORM_MAEMO) && defined(MOZ_X11)
+#if defined(MOZ_X11)
     XScreenSaverInfo* mXssInfo;
 #endif
 
 protected:
     nsIdleServiceQt();
     virtual ~nsIdleServiceQt();
     bool UsePollMode();
 };
--- a/widget/qt/nsLookAndFeel.cpp
+++ b/widget/qt/nsLookAndFeel.cpp
@@ -359,27 +359,21 @@ nsLookAndFeel::GetIntImpl(IntID aID, int
       aResult = eScrollArrowStyle_Single;
       break;
 
     case eIntID_ScrollSliderStyle:
       aResult = eScrollThumbStyle_Proportional;
       break;
 
     case eIntID_TouchEnabled:
-#ifdef MOZ_PLATFORM_MAEMO
-      // All known Maemo devices are touch enabled.
-      aResult = 1;
-#else
       aResult = 0;
       res = NS_ERROR_NOT_IMPLEMENTED;
-#endif
       break;
 
     case eIntID_WindowsDefaultTheme:
-    case eIntID_MaemoClassic:
       aResult = 0;
       res = NS_ERROR_NOT_IMPLEMENTED;
       break;
 
     case eIntID_SpellCheckerUnderlineStyle:
       aResult = NS_STYLE_TEXT_DECORATION_STYLE_WAVY;
       break;
 
--- a/widget/qt/nsWindow.cpp
+++ b/widget/qt/nsWindow.cpp
@@ -83,31 +83,19 @@ using namespace QtMobility;
 #endif
 #include "gfxQPainterSurface.h"
 #include "gfxContext.h"
 #include "gfxImageSurface.h"
 
 #include "nsIDOMSimpleGestureEvent.h" //Gesture support
 #include "nsIDOMWheelEvent.h"
 
-#if MOZ_PLATFORM_MAEMO > 5
-#include "nsIDOMWindow.h"
-#include "nsIDOMElement.h"
-#include "nsIFocusManager.h"
-#endif
-
 #ifdef MOZ_X11
 #include "keysym2ucs.h"
-#if MOZ_PLATFORM_MAEMO == 6
-#include <X11/Xatom.h>
-static Atom sPluginIMEAtom = nullptr;
-#define PLUGIN_VKB_REQUEST_PROP "_NPAPI_PLUGIN_REQUEST_VKB"
-#include <QThread>
 #endif
-#endif //MOZ_X11
 
 #include "gfxUtils.h"
 #include "Layers.h"
 #include "GLContextProvider.h"
 #include "BasicLayers.h"
 #include "LayerManagerOGL.h"
 #include "nsFastStartupQt.h"
 
@@ -173,22 +161,17 @@ isContextMenuKeyEvent(const QKeyEvent *q
 
 static void
 InitKeyEvent(nsKeyEvent &aEvent, QKeyEvent *aQEvent)
 {
     aEvent.InitBasicModifiers(aQEvent->modifiers() & Qt::ControlModifier,
                               aQEvent->modifiers() & Qt::AltModifier,
                               aQEvent->modifiers() & Qt::ShiftModifier,
                               aQEvent->modifiers() & Qt::MetaModifier);
-
-    // TODO: Needs to set .location for desktop Qt build.
-#ifdef MOZ_PLATFORM_MAEMO
-    aEvent.location  = nsIDOMKeyEvent::DOM_KEY_LOCATION_MOBILE;
-#endif
-    aEvent.time      = 0;
+    aEvent.time = 0;
 
     if (sAltGrModifier) {
         aEvent.modifiers |= (widget::MODIFIER_CONTROL | widget::MODIFIER_ALT);
     }
 
     // The transformations above and in qt for the keyval are not invertible
     // so link to the QKeyEvent (which will vanish soon after return from the
     // event callback) to give plugins access to hardware_keycode and state.
@@ -220,22 +203,16 @@ nsWindow::nsWindow()
     mTimerStarted        = false;
     mPinchEvent.needDispatch = false;
     mMoveEvent.needDispatch = false;
     
     if (!gGlobalsInitialized) {
         gfxPlatform::GetPlatform();
         gGlobalsInitialized = true;
 
-#if defined(MOZ_X11) && (MOZ_PLATFORM_MAEMO == 6)
-        // This cannot be called on non-main thread
-        if (QThread::currentThread() == qApp->thread()) {
-            sPluginIMEAtom = XInternAtom(mozilla::DefaultXDisplay(), PLUGIN_VKB_REQUEST_PROP, False);
-        }
-#endif
         // It's OK if either of these fail, but it may not be one day.
         initialize_prefs();
     }
 
     memset(mKeyDownFlags, 0, sizeof(mKeyDownFlags));
 
     mIsTransparent = false;
 
@@ -1459,32 +1436,16 @@ nsWindow::OnFocusInEvent(QEvent *aEvent)
 nsEventStatus
 nsWindow::OnFocusOutEvent(QEvent *aEvent)
 {
     LOGFOCUS(("OnFocusOutEvent [%p]\n", (void *)this));
 
     if (!mWidget)
         return nsEventStatus_eIgnore;
 
-#if MOZ_PLATFORM_MAEMO > 5
-    if (((QFocusEvent*)aEvent)->reason() == Qt::OtherFocusReason
-         && mWidget->isVKBOpen()) {
-        // We assume that the VKB was open in this case, because of the focus
-        // reason and clear the focus in the active window.
-        nsCOMPtr<nsIFocusManager> fm = do_GetService("@mozilla.org/focus-manager;1");
-        if (fm) {
-            nsCOMPtr<nsIDOMWindow> domWindow;
-            fm->GetActiveWindow(getter_AddRefs(domWindow));
-            fm->ClearFocus(domWindow);
-        }
-
-        return nsEventStatus_eIgnore;
-    }
-#endif
-
     DispatchDeactivateEventOnTopLevelWindow();
 
     LOGFOCUS(("Done with container focus out [%p]\n", (void *)this));
     return nsEventStatus_eIgnore;
 }
 
 inline bool
 is_latin_shortcut_key(quint32 aKeyval)
@@ -2676,28 +2637,16 @@ nsWindow::createQWidget(MozQWidget *pare
     if (mIsTopLevel) {
         QGraphicsView* newView =
             nsFastStartup::GetStartupGraphicsView(parentWidget, widget);
 
         if (mWindowType == eWindowType_dialog) {
             newView->setWindowModality(Qt::WindowModal);
         }
 
-#if defined(MOZ_PLATFORM_MAEMO) || defined(MOZ_GL_PROVIDER)
-        if (ComputeShouldAccelerate(mUseLayersAcceleration)) {
-            // Only create new OGL widget if it is not yet installed
-            if (!HasGLContext()) {
-                MozQGraphicsView *qview = qobject_cast<MozQGraphicsView*>(newView);
-                if (qview) {
-                    qview->setGLWidgetEnabled(true);
-                }
-            }
-        }
-#endif
-
         if (gfxQtPlatform::GetPlatform()->GetRenderMode() == gfxQtPlatform::RENDER_DIRECT) {
             // Disable double buffer and system background rendering
 #if defined(MOZ_X11) && (QT_VERSION < QT_VERSION_CHECK(5,0,0))
             newView->viewport()->setAttribute(Qt::WA_PaintOnScreen, true);
 #endif
             newView->viewport()->setAttribute(Qt::WA_NoSystemBackground, true);
         }
         // Enable gestures:
@@ -3121,126 +3070,26 @@ bool
 nsWindow::AreBoundsSane(void)
 {
     if (mBounds.width > 0 && mBounds.height > 0)
         return true;
 
     return false;
 }
 
-#if defined(MOZ_X11) && (MOZ_PLATFORM_MAEMO == 6)
-typedef enum {
-    VKBUndefined,
-    VKBOpen,
-    VKBClose
-} PluginVKBState;
-
-static QCoreApplication::EventFilter previousEventFilter = NULL;
-
-static PluginVKBState
-GetPluginVKBState(Window aWinId)
-{
-    // Set default value as unexpected error
-    PluginVKBState imeState = VKBUndefined;
-    Display *display = mozilla::DefaultXDisplay();
-
-    Atom actualType;
-    int actualFormat;
-    unsigned long nitems;
-    unsigned long bytes;
-    union {
-        unsigned char* asUChar;
-        unsigned long* asLong;
-    } data = {0};
-    int status = XGetWindowProperty(display, aWinId, sPluginIMEAtom,
-                                    0, 1, False, AnyPropertyType,
-                                    &actualType, &actualFormat, &nitems,
-                                    &bytes, &data.asUChar);
-
-    if (status == Success && actualType == XA_CARDINAL && actualFormat == 32 && nitems == 1) {
-        // Assume that plugin set value false - close VKB, true - open VKB
-        imeState = data.asLong[0] ? VKBOpen : VKBClose;
-    }
-
-    if (status == Success) {
-        XFree(data.asUChar);
-    }
-
-    return imeState;
-}
-
-static void
-SetVKBState(Window aWinId, PluginVKBState aState)
-{
-    Display *display = mozilla::DefaultXDisplay();
-    if (aState != VKBUndefined) {
-        unsigned long isOpen = aState == VKBOpen ? 1 : 0;
-        XChangeProperty(display, aWinId, sPluginIMEAtom, XA_CARDINAL, 32,
-                        PropModeReplace, (unsigned char *) &isOpen, 1);
-    } else {
-        XDeleteProperty(display, aWinId, sPluginIMEAtom);
-    }
-    XSync(display, False);
-}
-
-static bool
-x11EventFilter(void* message, long* result)
-{
-    XEvent* event = static_cast<XEvent*>(message);
-    if (event->type == PropertyNotify) {
-        if (event->xproperty.atom == sPluginIMEAtom) {
-            PluginVKBState state = GetPluginVKBState(event->xproperty.window);
-            if (state == VKBOpen) {
-                MozQWidget::requestVKB();
-            } else if (state == VKBClose) {
-                MozQWidget::hideVKB();
-            }
-            return true;
-        }
-    }
-    if (previousEventFilter) {
-        return previousEventFilter(message, result);
-    }
-
-    return false;
-}
-#endif
-
 NS_IMETHODIMP_(void)
 nsWindow::SetInputContext(const InputContext& aContext,
                           const InputContextAction& aAction)
 {
     NS_ENSURE_TRUE_VOID(mWidget);
 
     // SetSoftwareKeyboardState uses mInputContext,
     // so, before calling that, record aContext in mInputContext.
     mInputContext = aContext;
 
-#if defined(MOZ_X11) && (MOZ_PLATFORM_MAEMO == 6)
-    if (sPluginIMEAtom) {
-        static QCoreApplication::EventFilter currentEventFilter = NULL;
-        if (mInputContext.mIMEState.mEnabled == IMEState::PLUGIN &&
-            currentEventFilter != x11EventFilter) {
-            // Install event filter for listening Plugin IME state changes
-            previousEventFilter = QCoreApplication::instance()->setEventFilter(x11EventFilter);
-            currentEventFilter = x11EventFilter;
-        } else if (mInputContext.mIMEState.mEnabled != IMEState::PLUGIN &&
-                   currentEventFilter == x11EventFilter) {
-            // Remove event filter
-            QCoreApplication::instance()->setEventFilter(previousEventFilter);
-            currentEventFilter = previousEventFilter;
-            previousEventFilter = NULL;
-            QWidget* view = GetViewWidget();
-            if (view) {
-                SetVKBState(view->winId(), VKBUndefined);
-            }
-        }
-    }
-#endif
-
     switch (mInputContext.mIMEState.mEnabled) {
         case IMEState::ENABLED:
         case IMEState::PASSWORD:
         case IMEState::PLUGIN:
             SetSoftwareKeyboardState(true, aAction);
             break;
         default:
             SetSoftwareKeyboardState(false, aAction);
@@ -3273,25 +3122,16 @@ nsWindow::SetSoftwareKeyboardState(bool 
         // Ensure that opening the virtual keyboard is allowed for this specific
         // InputContext depending on the content.ime.strict.policy pref
         if (mInputContext.mIMEState.mEnabled != IMEState::PLUGIN &&
             Preferences::GetBool("content.ime.strict_policy", false) &&
             !aAction.ContentGotFocusByTrustedCause() &&
             !aAction.UserMightRequestOpenVKB()) {
             return;
         }
-#if defined(MOZ_X11) && (MOZ_PLATFORM_MAEMO == 6)
-        // doen't open VKB if plugin did set closed state
-        else if (sPluginIMEAtom) {
-            QWidget* view = GetViewWidget();
-            if (view && GetPluginVKBState(view->winId()) == VKBClose) {
-                return;
-            }
-        }
-#endif
     }
 
     if (aOpen) {
         // VKB open need to be delayed in order to give
         // to plugins chance prevent VKB from opening
         int32_t openDelay =
             Preferences::GetInt("ui.vkb.open.delay", 200);
         MozQWidget::requestVKB(openDelay, mWidget);
--- a/widget/windows/nsLookAndFeel.cpp
+++ b/widget/windows/nsLookAndFeel.cpp
@@ -409,17 +409,16 @@ nsLookAndFeel::GetIntImpl(IntID aID, int
                 aResult = LookAndFeel::eOperatingSystemVersion_Unknown;
                 break;
         }
         break;
     }
 
     case eIntID_MacGraphiteTheme:
     case eIntID_MacLionTheme:
-    case eIntID_MaemoClassic:
         aResult = 0;
         res = NS_ERROR_NOT_IMPLEMENTED;
         break;
     case eIntID_DWMCompositor:
         aResult = nsUXThemeData::CheckForCompositor();
         break;
     case eIntID_WindowsGlass:
         // Aero Glass is only available prior to Windows 8 when DWM is used.
--- a/widget/xpwidgets/GfxInfoX11.cpp
+++ b/widget/xpwidgets/GfxInfoX11.cpp
@@ -290,22 +290,16 @@ GfxInfo::GetFeatureStatusImpl(int32_t aF
   if (mGLMajorVersion == 1) {
     // We're on OpenGL 1. In most cases that indicates really old hardware.
     // We better block them, rather than rely on them to fail gracefully, because they don't!
     // see bug 696636
     *aStatus = nsIGfxInfo::FEATURE_BLOCKED_DEVICE;
     return NS_OK;
   }
 
-#ifdef MOZ_PLATFORM_MAEMO
-  *aStatus = nsIGfxInfo::FEATURE_NO_INFO;
-  // on Maemo, the glxtest probe doesn't build, and we don't really need GfxInfo anyway
-  return NS_OK;
-#endif
-
   // Don't evaluate any special cases if we're checking the downloaded blocklist.
   if (!aDriverInfo.Length()) {
     // Only check features relevant to Linux.
     if (aFeature == nsIGfxInfo::FEATURE_OPENGL_LAYERS ||
         aFeature == nsIGfxInfo::FEATURE_WEBGL_OPENGL ||
         aFeature == nsIGfxInfo::FEATURE_WEBGL_MSAA) {
 
       // Disable OpenGL layers when we don't have texture_from_pixmap because it regresses performance. 
--- a/widget/xpwidgets/nsBaseWidget.cpp
+++ b/widget/xpwidgets/nsBaseWidget.cpp
@@ -817,17 +817,17 @@ nsBaseWidget::AutoUseBasicLayerManager::
 {
   mWidget->mTemporarilyUseBasicLayerManager =
     mPreviousTemporarilyUseBasicLayerManager;
 }
 
 bool
 nsBaseWidget::ComputeShouldAccelerate(bool aDefault)
 {
-#if defined(XP_WIN) || defined(ANDROID) || (MOZ_PLATFORM_MAEMO > 5) || \
+#if defined(XP_WIN) || defined(ANDROID) || \
     defined(MOZ_GL_PROVIDER) || defined(XP_MACOSX)
   bool accelerateByDefault = true;
 #else
   bool accelerateByDefault = false;
 #endif
 
 #ifdef XP_MACOSX
   // 10.6.2 and lower have a bug involving textures and pixel buffer objects
--- a/xpcom/base/nsSystemInfo.cpp
+++ b/xpcom/base/nsSystemInfo.cpp
@@ -122,69 +122,16 @@ nsSystemInfo::Init()
     if (gtkver) {
       rv = SetPropertyAsACString(NS_LITERAL_STRING("secondaryLibrary"),
                                  nsDependentCString(gtkver));
       PR_smprintf_free(gtkver);
       NS_ENSURE_SUCCESS(rv, rv);
     }
 #endif
 
-
-#ifdef MOZ_PLATFORM_MAEMO
-    char *  line = nullptr;
-    size_t  len = 0;
-    ssize_t read;
-#if MOZ_PLATFORM_MAEMO > 5
-    FILE *fp = popen("/usr/bin/sysinfoclient --get /component/product", "r");
-#else
-    FILE *fp = fopen("/proc/component_version", "r");
-#endif
-    if (fp) {
-      while ((read = getline(&line, &len, fp)) != -1) {
-        if (line) {
-          if (strstr(line, "RX-51")) {
-            SetPropertyAsACString(NS_LITERAL_STRING("device"), NS_LITERAL_CSTRING("Nokia N900"));
-            SetPropertyAsACString(NS_LITERAL_STRING("manufacturer"), NS_LITERAL_CSTRING("Nokia"));
-            SetPropertyAsACString(NS_LITERAL_STRING("hardware"), NS_LITERAL_CSTRING("RX-51"));
-            SetPropertyAsBool(NS_LITERAL_STRING("tablet"), false);
-            break;
-          } else if (strstr(line, "RX-44") ||
-                     strstr(line, "RX-48") ||
-                     strstr(line, "RX-32") ) {
-            /* not as accurate as we can be, but these devices are deprecated */
-            SetPropertyAsACString(NS_LITERAL_STRING("device"), NS_LITERAL_CSTRING("Nokia N8xx"));
-            SetPropertyAsACString(NS_LITERAL_STRING("manufacturer"), NS_LITERAL_CSTRING("Nokia"));
-            SetPropertyAsACString(NS_LITERAL_STRING("hardware"), NS_LITERAL_CSTRING("N8xx"));
-            SetPropertyAsBool(NS_LITERAL_STRING("tablet"), false);
-            break;
-          } else if (strstr(line, "RM-680")) {
-            SetPropertyAsACString(NS_LITERAL_STRING("device"), NS_LITERAL_CSTRING("Nokia N950"));
-            SetPropertyAsACString(NS_LITERAL_STRING("manufacturer"), NS_LITERAL_CSTRING("Nokia"));
-            SetPropertyAsACString(NS_LITERAL_STRING("hardware"), NS_LITERAL_CSTRING("N9xx"));
-            SetPropertyAsBool(NS_LITERAL_STRING("tablet"), false);
-            break;
-          } else if (strstr(line, "RM-696")) {
-            SetPropertyAsACString(NS_LITERAL_STRING("device"), NS_LITERAL_CSTRING("Nokia N9"));
-            SetPropertyAsACString(NS_LITERAL_STRING("manufacturer"), NS_LITERAL_CSTRING("Nokia"));
-            SetPropertyAsACString(NS_LITERAL_STRING("hardware"), NS_LITERAL_CSTRING("N9xx"));
-            SetPropertyAsBool(NS_LITERAL_STRING("tablet"), false);
-            break;
-          }
-        }
-      }
-      if (line)
-        free(line);
-#if MOZ_PLATFORM_MAEMO > 5
-      pclose(fp);
-#else
-      fclose(fp);
-#endif
-    }
-#endif
-
 #ifdef MOZ_WIDGET_ANDROID
     if (mozilla::AndroidBridge::Bridge()) {
         nsAutoString str;
         if (mozilla::AndroidBridge::Bridge()->GetStaticStringField("android/os/Build", "MODEL", str))
             SetPropertyAsAString(NS_LITERAL_STRING("device"), str);
         if (mozilla::AndroidBridge::Bridge()->GetStaticStringField("android/os/Build", "MANUFACTURER", str))
             SetPropertyAsAString(NS_LITERAL_STRING("manufacturer"), str);
         if (mozilla::AndroidBridge::Bridge()->GetStaticStringField("android/os/Build$VERSION", "RELEASE", str))
--- a/xpcom/io/Makefile.in
+++ b/xpcom/io/Makefile.in
@@ -16,18 +16,8 @@ include $(topsrcdir)/ipc/chromium/chromi
 ifeq ($(OS_ARCH),Linux)
 ifneq (,$(findstring lib64,$(libdir)))
 DEFINES     += -DHAVE_USR_LIB64_DIR
 endif
 endif
 
 LOCAL_INCLUDES	+= -I..
 
-ifeq ($(MOZ_PLATFORM_MAEMO),5)
-CFLAGS          += $(MOZ_DBUS_CFLAGS)
-CXXFLAGS        += $(MOZ_DBUS_CFLAGS)
-endif
-
-ifdef MOZ_PLATFORM_MAEMO
-CFLAGS          += $(MOZ_PLATFORM_MAEMO_CFLAGS) $(MOZ_QT_CFLAGS)
-CXXFLAGS        += $(MOZ_PLATFORM_MAEMO_CFLAGS) $(MOZ_QT_CFLAGS)
-endif
-
--- a/xpcom/io/SpecialSystemDirectory.cpp
+++ b/xpcom/io/SpecialSystemDirectory.cpp
@@ -436,32 +436,16 @@ GetUnixXDGUserDirectory(SystemDirectorie
         // for the XDG desktop dir, fall back to HOME/Desktop
         // (for historical compatibility)
         rv = GetUnixHomeDir(getter_AddRefs(file));
         if (NS_FAILED(rv))
             return rv;
 
         rv = file->AppendNative(NS_LITERAL_CSTRING("Desktop"));
     }
-#if defined(MOZ_PLATFORM_MAEMO)
-    // "MYDOCSDIR" is exported to point to "/home/user/MyDocs" in maemo.
-    else if (Unix_XDG_Documents == aSystemDirectory) {
-
-        char *myDocs = PR_GetEnv("MYDOCSDIR");
-        if (!myDocs || !*myDocs)
-            return NS_ERROR_FAILURE;
-
-        rv = NS_NewNativeLocalFile(nsDependentCString(myDocs), true,
-                                   getter_AddRefs(file));
-        if (NS_FAILED(rv))
-            return rv;
-
-        rv = file->AppendNative(NS_LITERAL_CSTRING(".documents"));
-    }
-#endif
     else {
       // no fallback for the other XDG dirs
       rv = NS_ERROR_FAILURE;
     }
 
     if (NS_FAILED(rv))
         return rv;
 
--- a/xpcom/io/nsLocalFileUnix.cpp
+++ b/xpcom/io/nsLocalFileUnix.cpp
@@ -23,24 +23,16 @@
     #include <fabdef.h>
 #endif
 
 #if defined(HAVE_SYS_QUOTA_H) && defined(HAVE_LINUX_QUOTA_H)
 #define USE_LINUX_QUOTACTL
 #include <sys/quota.h>
 #endif
 
-#if (MOZ_PLATFORM_MAEMO == 6)
-#include <QUrl>
-#include <QString>
-#if (MOZ_ENABLE_CONTENTACTION)
-#include <contentaction/contentaction.h>
-#endif
-#endif
-
 #include "xpcom-private.h"
 #include "nsDirectoryServiceDefs.h"
 #include "nsCRT.h"
 #include "nsCOMPtr.h"
 #include "nsMemory.h"
 #include "nsIFile.h"
 #include "nsString.h"
 #include "nsReadableUtils.h"
@@ -61,29 +53,26 @@
 #include <Carbon/Carbon.h>
 #include "CocoaFileUtils.h"
 #include "prmem.h"
 #include "plbase64.h"
 
 static nsresult MacErrorMapper(OSErr inErr);
 #endif
 
-#if (MOZ_PLATFORM_MAEMO == 5)
-#include <glib.h>
-#include <hildon-uri.h>
-#include <hildon-mime.h>
-#include <libosso.h>
-#endif
-
 #ifdef MOZ_WIDGET_ANDROID
 #include "AndroidBridge.h"
 #include "nsIMIMEService.h"
 #include <linux/magic.h>
 #endif
 
+#ifdef MOZ_ENABLE_CONTENTACTION
+#include <contentaction/contentaction.h>
+#endif
+
 #include "nsNativeCharsetUtils.h"
 #include "nsTraceRefcntImpl.h"
 #include "nsHashKeys.h"
 
 using namespace mozilla;
 
 #define ENSURE_STAT_CACHE()                     \
     PR_BEGIN_MACRO                              \
@@ -1783,49 +1772,30 @@ nsLocalFile::Reveal()
     return NS_ERROR_FAILURE;
 #endif
 }
 
 NS_IMETHODIMP
 nsLocalFile::Launch()
 {
 #ifdef MOZ_WIDGET_GTK
-#if (MOZ_PLATFORM_MAEMO==5)
-    const int32_t kHILDON_SUCCESS = 1;
-    DBusError err;
-    dbus_error_init(&err);
-
-    DBusConnection *connection = dbus_bus_get(DBUS_BUS_SESSION, &err);
-    if (dbus_error_is_set(&err)) {
-      dbus_error_free(&err);
-      return NS_ERROR_FAILURE;
-    }
-
-    if (nullptr == connection)
-      return NS_ERROR_FAILURE;
-
-    if (hildon_mime_open_file(connection, mPath.get()) != kHILDON_SUCCESS)
-      return NS_ERROR_FAILURE;
-    return NS_OK;
-#else
     nsCOMPtr<nsIGIOService> giovfs = do_GetService(NS_GIOSERVICE_CONTRACTID);
     nsCOMPtr<nsIGnomeVFSService> gnomevfs = do_GetService(NS_GNOMEVFSSERVICE_CONTRACTID);
     if (giovfs) {
       return giovfs->ShowURIForInput(mPath);
     } else if (gnomevfs) {
       /* GnomeVFS fallback */
       return gnomevfs->ShowURIForInput(mPath);
     }
     
     return NS_ERROR_FAILURE;
-#endif
 #elif defined(MOZ_ENABLE_CONTENTACTION)
     QUrl uri = QUrl::fromLocalFile(QString::fromUtf8(mPath.get()));
     ContentAction::Action action =
-      ContentAction::Action::defaultActionForFile(uri);
+        ContentAction::Action::defaultActionForFile(uri);
 
     if (action.isValid()) {
       action.trigger();
       return NS_OK;
     }
 
     return NS_ERROR_FAILURE;
 #elif defined(MOZ_WIDGET_ANDROID)
--- a/xulrunner/installer/Makefile.in
+++ b/xulrunner/installer/Makefile.in
@@ -32,19 +32,16 @@ ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
 MOZ_PKG_FORMAT = BZ2
 _APPNAME = XUL.framework
 _BINPATH = /$(_APPNAME)/Versions/Current
 endif
 
 include $(topsrcdir)/config/rules.mk
 
 INSTALL_SDK = 1
-ifndef MOZ_PLATFORM_MAEMO
-GENERATE_CACHE = 1
-endif
 
 include $(topsrcdir)/toolkit/mozapps/installer/signing.mk
 include $(topsrcdir)/toolkit/mozapps/installer/packager.mk
 
 # Add pkg-config files to the install:: target
 
 pkg_config_files = \
 	libxul.pc \