mozilla-kde.patch
changeset 985 038d048a3940
parent 982 53443ffb496a
child 994 9fc447b00040
equal deleted inserted replaced
984:98c4a3711f11 985:038d048a3940
     1 # HG changeset patch
     1 # HG changeset patch
     2 # Parent  a15b45ae85ab486503a1a09252734b80fe782998
     2 # Parent  172cd661ceed38b3161c6246f6729f4d8370dce3
     3 Description: Add KDE integration to Firefox (toolkit parts)
     3 Description: Add KDE integration to Firefox (toolkit parts)
     4 Author: Wolfgang Rosenauer <wolfgang@rosenauer.org>
     4 Author: Wolfgang Rosenauer <wolfgang@rosenauer.org>
     5 Author: Lubos Lunak <lunak@suse.com>
     5 Author: Lubos Lunak <lunak@suse.com>
     6 Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=140751
     6 Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=140751
     7      https://bugzilla.novell.com/show_bug.cgi?id=170055
     7      https://bugzilla.novell.com/show_bug.cgi?id=170055
     8 
     8 
     9 diff --git a/modules/libpref/Preferences.cpp b/modules/libpref/Preferences.cpp
     9 diff --git a/modules/libpref/Preferences.cpp b/modules/libpref/Preferences.cpp
    10 --- a/modules/libpref/Preferences.cpp
    10 --- a/modules/libpref/Preferences.cpp
    11 +++ b/modules/libpref/Preferences.cpp
    11 +++ b/modules/libpref/Preferences.cpp
    12 @@ -31,16 +31,17 @@
    12 @@ -32,16 +32,17 @@
    13  #include "nsIZipReader.h"
    13  #include "nsIZipReader.h"
    14  #include "nsPrefBranch.h"
    14  #include "nsPrefBranch.h"
    15  #include "nsXPIDLString.h"
    15  #include "nsXPIDLString.h"
    16  #include "nsCRT.h"
    16  #include "nsCRT.h"
    17  #include "nsCOMArray.h"
    17  #include "nsCOMArray.h"
    25  
    25  
    26  #include "prefapi.h"
    26  #include "prefapi.h"
    27  #include "prefread.h"
    27  #include "prefread.h"
    28  #include "prefapi_private_data.h"
    28  #include "prefapi_private_data.h"
    29  
    29  
    30 @@ -1199,16 +1200,34 @@ pref_LoadPrefsInDir(nsIFile* aDir, char 
    30 @@ -1219,16 +1220,34 @@ pref_LoadPrefsInDir(nsIFile* aDir, char 
    31  
    31  
    32  static nsresult pref_LoadPrefsInDirList(const char *listId)
    32  static nsresult pref_LoadPrefsInDirList(const char *listId)
    33  {
    33  {
    34    nsresult rv;
    34    nsresult rv;
    35    nsCOMPtr<nsIProperties> dirSvc(do_GetService(NS_DIRECTORY_SERVICE_CONTRACTID, &rv));
    35    nsCOMPtr<nsIProperties> dirSvc(do_GetService(NS_DIRECTORY_SERVICE_CONTRACTID, &rv));
    60                getter_AddRefs(list));
    60                getter_AddRefs(list));
    61    if (!list)
    61    if (!list)
    62      return NS_OK;
    62      return NS_OK;
    63  
    63  
    64    bool hasMore;
    64    bool hasMore;
    65 @@ -1224,17 +1243,17 @@ static nsresult pref_LoadPrefsInDirList(
    65 @@ -1244,17 +1263,17 @@ static nsresult pref_LoadPrefsInDirList(
    66  
    66  
    67      nsAutoCString leaf;
    67      nsAutoCString leaf;
    68      path->GetNativeLeafName(leaf);
    68      path->GetNativeLeafName(leaf);
    69  
    69  
    70      // Do we care if a file provided by this process fails to load?
    70      // Do we care if a file provided by this process fails to load?
    79  
    79  
    80  static nsresult pref_ReadPrefFromJar(nsZipArchive* jarReader, const char *name)
    80  static nsresult pref_ReadPrefFromJar(nsZipArchive* jarReader, const char *name)
    81  {
    81  {
    82    nsZipItemPtr<char> manifest(jarReader, name, true);
    82    nsZipItemPtr<char> manifest(jarReader, name, true);
    83    NS_ENSURE_TRUE(manifest.Buffer(), NS_ERROR_NOT_AVAILABLE);
    83    NS_ENSURE_TRUE(manifest.Buffer(), NS_ERROR_NOT_AVAILABLE);
    84 @@ -1328,24 +1347,36 @@ static nsresult pref_InitInitialObjects(
    84 @@ -1348,24 +1367,36 @@ static nsresult pref_InitInitialObjects(
    85    /* these pref file names should not be used: we process them after all other application pref files for backwards compatibility */
    85    /* these pref file names should not be used: we process them after all other application pref files for backwards compatibility */
    86    static const char* specialFiles[] = {
    86    static const char* specialFiles[] = {
    87  #if defined(XP_MACOSX)
    87  #if defined(XP_MACOSX)
    88      "macprefs.js"
    88      "macprefs.js"
    89  #elif defined(XP_WIN)
    89  #elif defined(XP_WIN)
   119    RefPtr<nsZipArchive> appJarReader = mozilla::Omnijar::GetReader(mozilla::Omnijar::APP);
   119    RefPtr<nsZipArchive> appJarReader = mozilla::Omnijar::GetReader(mozilla::Omnijar::APP);
   120    // GetReader(mozilla::Omnijar::APP) returns null when $app == $gre, in which
   120    // GetReader(mozilla::Omnijar::APP) returns null when $app == $gre, in which
   121 diff --git a/modules/libpref/moz.build b/modules/libpref/moz.build
   121 diff --git a/modules/libpref/moz.build b/modules/libpref/moz.build
   122 --- a/modules/libpref/moz.build
   122 --- a/modules/libpref/moz.build
   123 +++ b/modules/libpref/moz.build
   123 +++ b/modules/libpref/moz.build
   124 @@ -31,16 +31,20 @@ UNIFIED_SOURCES += [
   124 @@ -33,16 +33,20 @@ EXPORTS.mozilla += [
       
   125  UNIFIED_SOURCES += [
       
   126      'nsPrefBranch.cpp',
       
   127      'nsPrefsFactory.cpp',
       
   128      'prefapi.cpp',
       
   129      'Preferences.cpp',
   125      'prefread.cpp',
   130      'prefread.cpp',
   126  ]
   131  ]
   127  
   132  
   128  # prefapi.cpp cannot be built in unified mode because it uses plarena.h
       
   129  SOURCES += [
       
   130      'prefapi.cpp',
       
   131  ]
       
   132  
       
   133 +LOCAL_INCLUDES += [
   133 +LOCAL_INCLUDES += [
   134 +    '/toolkit/xre'
   134 +     '/toolkit/xre'
   135 +]
   135 +]
   136 +
   136 +
   137  include('/ipc/chromium/chromium-config.mozbuild')
   137  include('/ipc/chromium/chromium-config.mozbuild')
   138  
   138  
   139  FINAL_LIBRARY = 'xul'
   139  FINAL_LIBRARY = 'xul'
   140  
   140  
   141  DEFINES['OS_ARCH'] = CONFIG['OS_ARCH']
   141  DEFINES['OS_ARCH'] = CONFIG['OS_ARCH']
   142  DEFINES['MOZ_WIDGET_TOOLKIT'] = CONFIG['MOZ_WIDGET_TOOLKIT']
   142  DEFINES['MOZ_WIDGET_TOOLKIT'] = CONFIG['MOZ_WIDGET_TOOLKIT']
   143  
   143  if CONFIG['MOZ_ENABLE_WEBRENDER']:
   144  FINAL_TARGET_PP_FILES += [
   144      DEFINES['MOZ_ENABLE_WEBRENDER'] = True
   145 diff --git a/python/mozbuild/mozpack/chrome/flags.py b/python/mozbuild/mozpack/chrome/flags.py
   145 diff --git a/python/mozbuild/mozpack/chrome/flags.py b/python/mozbuild/mozpack/chrome/flags.py
   146 --- a/python/mozbuild/mozpack/chrome/flags.py
   146 --- a/python/mozbuild/mozpack/chrome/flags.py
   147 +++ b/python/mozbuild/mozpack/chrome/flags.py
   147 +++ b/python/mozbuild/mozpack/chrome/flags.py
   148 @@ -211,16 +211,17 @@ class Flags(OrderedDict):
   148 @@ -220,16 +220,17 @@ class Flags(OrderedDict):
   149          'contentaccessible': Flag,
   149          'contentaccessible': Flag,
   150          'os': StringFlag,
   150          'os': StringFlag,
   151          'osversion': VersionFlag,
   151          'osversion': VersionFlag,
   152          'abi': StringFlag,
   152          'abi': StringFlag,
   153          'platform': Flag,
   153          'platform': Flag,
   185          self.base = base
   185          self.base = base
   186          self.flags = Flags(*flags)
   186          self.flags = Flags(*flags)
   187 diff --git a/toolkit/components/downloads/moz.build b/toolkit/components/downloads/moz.build
   187 diff --git a/toolkit/components/downloads/moz.build b/toolkit/components/downloads/moz.build
   188 --- a/toolkit/components/downloads/moz.build
   188 --- a/toolkit/components/downloads/moz.build
   189 +++ b/toolkit/components/downloads/moz.build
   189 +++ b/toolkit/components/downloads/moz.build
   190 @@ -49,16 +49,17 @@ if CONFIG['OS_ARCH'] == 'WINNT':
   190 @@ -37,16 +37,17 @@ UNIFIED_SOURCES += [
   191          'nsDownloadScanner.cpp',
   191      'nsDownloadManager.cpp'
   192      ]
   192  ]
   193  
   193  
   194  FINAL_LIBRARY = 'xul'
   194  FINAL_LIBRARY = 'xul'
   195  
   195  
   196  LOCAL_INCLUDES += [
   196  LOCAL_INCLUDES += [
   197      '../protobuf',
   197      '../protobuf',
   203  DEFINES['GOOGLE_PROTOBUF_NO_RTTI'] = True
   203  DEFINES['GOOGLE_PROTOBUF_NO_RTTI'] = True
   204  DEFINES['GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER'] = True
   204  DEFINES['GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER'] = True
   205  
   205  
   206  CXXFLAGS += CONFIG['TK_CFLAGS']
   206  CXXFLAGS += CONFIG['TK_CFLAGS']
   207  
   207  
   208 diff --git a/toolkit/components/downloads/nsDownloadManager.cpp b/toolkit/components/downloads/nsDownloadManager.cpp
       
   209 --- a/toolkit/components/downloads/nsDownloadManager.cpp
       
   210 +++ b/toolkit/components/downloads/nsDownloadManager.cpp
       
   211 @@ -52,16 +52,20 @@
       
   212  #ifdef XP_WIN
       
   213  #include <shlobj.h>
       
   214  #include "nsWindowsHelpers.h"
       
   215  #ifdef DOWNLOAD_SCANNER
       
   216  #include "nsDownloadScanner.h"
       
   217  #endif
       
   218  #endif
       
   219  
       
   220 +#if defined(XP_UNIX) && !defined(XP_MACOSX)
       
   221 +#include "nsKDEUtils.h"
       
   222 +#endif
       
   223 +
       
   224  #ifdef XP_MACOSX
       
   225  #include <CoreFoundation/CoreFoundation.h>
       
   226  #endif
       
   227  
       
   228  #ifdef MOZ_WIDGET_ANDROID
       
   229  #include "FennecJNIWrappers.h"
       
   230  #endif
       
   231  
       
   232 @@ -2724,16 +2728,25 @@ nsDownload::SetState(DownloadState aStat
       
   233        nsCOMPtr<nsIPrefBranch> pref(do_GetService(NS_PREFSERVICE_CONTRACTID));
       
   234  
       
   235        // Master pref to control this function.
       
   236        bool showTaskbarAlert = true;
       
   237        if (pref)
       
   238          pref->GetBoolPref(PREF_BDM_SHOWALERTONCOMPLETE, &showTaskbarAlert);
       
   239  
       
   240        if (showTaskbarAlert) {
       
   241 +        if( nsKDEUtils::kdeSupport()) {
       
   242 +          nsTArray<nsCString> command;
       
   243 +          command.AppendElement( NS_LITERAL_CSTRING( "DOWNLOADFINISHED" ));
       
   244 +          nsAutoString displayName;
       
   245 +          GetDisplayName( displayName );
       
   246 +          command.AppendElement( nsAutoCString( ToNewUTF8String( displayName )));
       
   247 +          nsKDEUtils::command( command );
       
   248 +        } else {
       
   249 +        // begin non-KDE block
       
   250          int32_t alertInterval = 2000;
       
   251          if (pref)
       
   252            pref->GetIntPref(PREF_BDM_SHOWALERTINTERVAL, &alertInterval);
       
   253  
       
   254          int64_t alertIntervalUSec = alertInterval * PR_USEC_PER_MSEC;
       
   255          int64_t goat = PR_Now() - mStartTime;
       
   256          showTaskbarAlert = goat > alertIntervalUSec;
       
   257  
       
   258 @@ -2765,16 +2778,17 @@ nsDownload::SetState(DownloadState aStat
       
   259                    message, !removeWhenDone,
       
   260                    mPrivate ? NS_LITERAL_STRING("private") : NS_LITERAL_STRING("non-private"),
       
   261                    mDownloadManager, EmptyString(), NS_LITERAL_STRING("auto"),
       
   262                    EmptyString(), EmptyString(), nullptr, mPrivate,
       
   263                    false /* requireInteraction */);
       
   264              }
       
   265          }
       
   266        }
       
   267 +      }
       
   268  
       
   269  #if defined(XP_WIN) || defined(XP_MACOSX) || defined(MOZ_WIDGET_ANDROID) || defined(MOZ_WIDGET_GTK)
       
   270        nsCOMPtr<nsIFileURL> fileURL = do_QueryInterface(mTarget);
       
   271        nsCOMPtr<nsIFile> file;
       
   272        nsAutoString path;
       
   273  
       
   274        if (fileURL &&
       
   275            NS_SUCCEEDED(fileURL->GetFile(getter_AddRefs(file))) &&
       
   276 diff --git a/toolkit/content/jar.mn b/toolkit/content/jar.mn
   208 diff --git a/toolkit/content/jar.mn b/toolkit/content/jar.mn
   277 --- a/toolkit/content/jar.mn
   209 --- a/toolkit/content/jar.mn
   278 +++ b/toolkit/content/jar.mn
   210 +++ b/toolkit/content/jar.mn
   279 @@ -73,29 +73,33 @@ toolkit.jar:
   211 @@ -75,29 +75,33 @@ toolkit.jar:
   280     content/global/bindings/colorpicker.xml     (widgets/colorpicker.xml)
   212     content/global/bindings/colorpicker.xml     (widgets/colorpicker.xml)
   281     content/global/bindings/datekeeper.js       (widgets/datekeeper.js)
   213     content/global/bindings/datekeeper.js       (widgets/datekeeper.js)
   282     content/global/bindings/datepicker.js       (widgets/datepicker.js)
   214     content/global/bindings/datepicker.js       (widgets/datepicker.js)
   283     content/global/bindings/datetimepicker.xml  (widgets/datetimepicker.xml)
   215     content/global/bindings/datetimepicker.xml  (widgets/datetimepicker.xml)
   284     content/global/bindings/datetimepopup.xml   (widgets/datetimepopup.xml)
   216     content/global/bindings/datetimepopup.xml   (widgets/datetimepopup.xml)
   772 +</bindings>
   704 +</bindings>
   773 diff --git a/toolkit/content/widgets/preferences-kde.xml b/toolkit/content/widgets/preferences-kde.xml
   705 diff --git a/toolkit/content/widgets/preferences-kde.xml b/toolkit/content/widgets/preferences-kde.xml
   774 new file mode 100644
   706 new file mode 100644
   775 --- /dev/null
   707 --- /dev/null
   776 +++ b/toolkit/content/widgets/preferences-kde.xml
   708 +++ b/toolkit/content/widgets/preferences-kde.xml
   777 @@ -0,0 +1,1391 @@
   709 @@ -0,0 +1,1380 @@
   778 +<?xml version="1.0"?>
   710 +<?xml version="1.0"?>
   779 +
   711 +
   780 +<!DOCTYPE bindings [
   712 +<!DOCTYPE bindings [
   781 +  <!ENTITY % preferencesDTD SYSTEM "chrome://global/locale/preferences.dtd">
   713 +  <!ENTITY % preferencesDTD SYSTEM "chrome://global/locale/preferences.dtd">
   782 +  %preferencesDTD;
   714 +  %preferencesDTD;
   902 +        // we have nothing to do here
   834 +        // we have nothing to do here
   903 +        if (!this.name)
   835 +        if (!this.name)
   904 +          return;
   836 +          return;
   905 +
   837 +
   906 +        this.preferences.rootBranchInternal
   838 +        this.preferences.rootBranchInternal
   907 +            .addObserver(this.name, this.preferences, false);
   839 +            .addObserver(this.name, this.preferences);
   908 +        // In non-instant apply mode, we must try and use the last saved state
   840 +        // In non-instant apply mode, we must try and use the last saved state
   909 +        // from any previous opens of a child dialog instead of the value from
   841 +        // from any previous opens of a child dialog instead of the value from
   910 +        // preferences, to pick up any edits a user may have made.
   842 +        // preferences, to pick up any edits a user may have made.
   911 +
   843 +
   912 +        var secMan = Components.classes["@mozilla.org/scriptsecuritymanager;1"]
   844 +        var secMan = Components.classes["@mozilla.org/scriptsecuritymanager;1"]
   956 +
   888 +
   957 +          this.preferences.rootBranchInternal
   889 +          this.preferences.rootBranchInternal
   958 +              .removeObserver(this.name, this.preferences);
   890 +              .removeObserver(this.name, this.preferences);
   959 +          this.setAttribute("name", val);
   891 +          this.setAttribute("name", val);
   960 +          this.preferences.rootBranchInternal
   892 +          this.preferences.rootBranchInternal
   961 +              .addObserver(val, this.preferences, false);
   893 +              .addObserver(val, this.preferences);
   962 +
   894 +
   963 +          return val;
   895 +          return val;
   964 +        </setter>
   896 +        </setter>
   965 +      </property>
   897 +      </property>
   966 +      <property name="type" onget="return this.getAttribute('type');"
   898 +      <property name="type" onget="return this.getAttribute('type');"
  1112 +              return this._branch
  1044 +              return this._branch
  1113 +                         .getComplexValue(this.name, Components.interfaces.nsIPrefLocalizedString)
  1045 +                         .getComplexValue(this.name, Components.interfaces.nsIPrefLocalizedString)
  1114 +                         .data;
  1046 +                         .data;
  1115 +            case "string":
  1047 +            case "string":
  1116 +            case "unichar":
  1048 +            case "unichar":
  1117 +              return this._branch
  1049 +              return this._branch.getStringPref(this.name);
  1118 +                         .getComplexValue(this.name, Components.interfaces.nsISupportsString)
       
  1119 +                         .data;
       
  1120 +            case "fontname":
  1050 +            case "fontname":
  1121 +              var family = this._branch
  1051 +              var family = this._branch.getStringPref(this.name);
  1122 +                               .getComplexValue(this.name, Components.interfaces.nsISupportsString)
       
  1123 +                               .data;
       
  1124 +              var fontEnumerator = Components.classes["@mozilla.org/gfx/fontenumerator;1"]
  1052 +              var fontEnumerator = Components.classes["@mozilla.org/gfx/fontenumerator;1"]
  1125 +                                             .createInstance(Components.interfaces.nsIFontEnumerator);
  1053 +                                             .createInstance(Components.interfaces.nsIFontEnumerator);
  1126 +              return fontEnumerator.getStandardFamilyName(family);
  1054 +              return fontEnumerator.getStandardFamilyName(family);
  1127 +            case "file":
  1055 +            case "file":
  1128 +              var f = this._branch
  1056 +              var f = this._branch
  1163 +                .setComplexValue(this.name, Components.interfaces.nsIPrefLocalizedString, pls);
  1091 +                .setComplexValue(this.name, Components.interfaces.nsIPrefLocalizedString, pls);
  1164 +            break;
  1092 +            break;
  1165 +          case "string":
  1093 +          case "string":
  1166 +          case "unichar":
  1094 +          case "unichar":
  1167 +          case "fontname":
  1095 +          case "fontname":
  1168 +            var iss = Components.classes["@mozilla.org/supports-string;1"]
  1096 +            this.preferences.rootBranch.setStringPref(this.name, val);
  1169 +                                .createInstance(Components.interfaces.nsISupportsString);
       
  1170 +            iss.data = val;
       
  1171 +            this.preferences.rootBranch
       
  1172 +                .setComplexValue(this.name, Components.interfaces.nsISupportsString, iss);
       
  1173 +            break;
  1097 +            break;
  1174 +          case "file":
  1098 +          case "file":
  1175 +            var lf;
  1099 +            var lf;
  1176 +            if (typeof(val) == "string") {
  1100 +            if (typeof(val) == "string") {
  1177 +              lf = Components.classes["@mozilla.org/file/local;1"]
  1101 +              lf = Components.classes["@mozilla.org/file/local;1"]
  1655 +      <property name="_shouldAnimate">
  1579 +      <property name="_shouldAnimate">
  1656 +        <getter>
  1580 +        <getter>
  1657 +        <![CDATA[
  1581 +        <![CDATA[
  1658 +          var psvc = Components.classes["@mozilla.org/preferences-service;1"]
  1582 +          var psvc = Components.classes["@mozilla.org/preferences-service;1"]
  1659 +                               .getService(Components.interfaces.nsIPrefBranch);
  1583 +                               .getService(Components.interfaces.nsIPrefBranch);
  1660 +          var animate = /Mac/.test(navigator.platform);
  1584 +          return psvc.getBoolPref("browser.preferences.animateFadeIn",
  1661 +          try {
  1585 +                                  /Mac/.test(navigator.platform));
  1662 +            animate = psvc.getBoolPref("browser.preferences.animateFadeIn");
       
  1663 +          } catch (e) { }
       
  1664 +          return animate;
       
  1665 +        ]]>
  1586 +        ]]>
  1666 +        </getter>
  1587 +        </getter>
  1667 +      </property>
  1588 +      </property>
  1668 +
  1589 +
  1669 +      <method name="animate">
  1590 +      <method name="animate">
  2167 +#    PrefWindow I   (June 4, 1999)
  2088 +#    PrefWindow I   (June 4, 1999)
  2168 +#
  2089 +#
  2169 diff --git a/toolkit/mozapps/downloads/nsHelperAppDlg.js b/toolkit/mozapps/downloads/nsHelperAppDlg.js
  2090 diff --git a/toolkit/mozapps/downloads/nsHelperAppDlg.js b/toolkit/mozapps/downloads/nsHelperAppDlg.js
  2170 --- a/toolkit/mozapps/downloads/nsHelperAppDlg.js
  2091 --- a/toolkit/mozapps/downloads/nsHelperAppDlg.js
  2171 +++ b/toolkit/mozapps/downloads/nsHelperAppDlg.js
  2092 +++ b/toolkit/mozapps/downloads/nsHelperAppDlg.js
  2172 @@ -629,17 +629,17 @@ nsUnknownContentTypeDialog.prototype = {
  2093 @@ -625,17 +625,17 @@ nsUnknownContentTypeDialog.prototype = {
  2173        else
  2094        else
  2174          typeString = mimeInfo.MIMEType;
  2095          typeString = mimeInfo.MIMEType;
  2175      }
  2096      }
  2176      // When the length is unknown, contentLength would be -1
  2097      // When the length is unknown, contentLength would be -1
  2177      if (this.mLauncher.contentLength >= 0) {
  2098      if (this.mLauncher.contentLength >= 0) {
  2186        type.value = typeString;
  2107        type.value = typeString;
  2187      }
  2108      }
  2188    },
  2109    },
  2189  
  2110  
  2190    // Returns true if opening the default application makes sense.
  2111    // Returns true if opening the default application makes sense.
  2191 @@ -803,17 +803,17 @@ nsUnknownContentTypeDialog.prototype = {
  2112 @@ -799,17 +799,17 @@ nsUnknownContentTypeDialog.prototype = {
  2192        switch (this.dialogElement("openHandler").selectedIndex) {
  2113        switch (this.dialogElement("openHandler").selectedIndex) {
  2193        case 0:
  2114        case 0:
  2194          // No app need be specified in this case.
  2115          // No app need be specified in this case.
  2195          ok = true;
  2116          ok = true;
  2196          break;
  2117          break;
  2205  
  2126  
  2206      // Enable Ok button if ok to press.
  2127      // Enable Ok button if ok to press.
  2207      this.mDialog.document.documentElement.getButton("accept").disabled = !ok;
  2128      this.mDialog.document.documentElement.getButton("accept").disabled = !ok;
  2208    },
  2129    },
  2209  
  2130  
  2210 @@ -1070,30 +1070,56 @@ nsUnknownContentTypeDialog.prototype = {
  2131 @@ -1066,30 +1066,56 @@ nsUnknownContentTypeDialog.prototype = {
  2211            params.handlerApp.executable &&
  2132            params.handlerApp.executable &&
  2212            params.handlerApp.executable.isFile()) {
  2133            params.handlerApp.executable.isFile()) {
  2213          // Remember the file they chose to run.
  2134          // Remember the file they chose to run.
  2214          this.chosenApp = params.handlerApp;
  2135          this.chosenApp = params.handlerApp;
  2215        }
  2136        }
  2372 +}
  2293 +}
  2373 +
  2294 +
  2374 diff --git a/toolkit/xre/moz.build b/toolkit/xre/moz.build
  2295 diff --git a/toolkit/xre/moz.build b/toolkit/xre/moz.build
  2375 --- a/toolkit/xre/moz.build
  2296 --- a/toolkit/xre/moz.build
  2376 +++ b/toolkit/xre/moz.build
  2297 +++ b/toolkit/xre/moz.build
  2377 @@ -53,17 +53,19 @@ elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'co
  2298 @@ -61,17 +61,19 @@ elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'co
  2378          '../components/printingui/mac',
  2299          '../components/printingui/mac',
  2379      ]
  2300      ]
  2380  elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'uikit':
  2301  elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'uikit':
  2381      UNIFIED_SOURCES += [
  2302      UNIFIED_SOURCES += [
  2382          'nsNativeAppSupportDefault.cpp',
  2303          'nsNativeAppSupportDefault.cpp',
  2817      UNIFIED_SOURCES += [
  2738      UNIFIED_SOURCES += [
  2818          'android/nsAndroidHandlerApp.cpp',
  2739          'android/nsAndroidHandlerApp.cpp',
  2819          'android/nsExternalSharingAppService.cpp',
  2740          'android/nsExternalSharingAppService.cpp',
  2820          'android/nsExternalURLHandlerService.cpp',
  2741          'android/nsExternalURLHandlerService.cpp',
  2821          'android/nsMIMEInfoAndroid.cpp',
  2742          'android/nsMIMEInfoAndroid.cpp',
  2822 @@ -123,16 +125,17 @@ include('/ipc/chromium/chromium-config.m
  2743 @@ -125,16 +127,17 @@ include('/ipc/chromium/chromium-config.m
  2823  
  2744  
  2824  FINAL_LIBRARY = 'xul'
  2745  FINAL_LIBRARY = 'xul'
  2825  
  2746  
  2826  LOCAL_INCLUDES += [
  2747  LOCAL_INCLUDES += [
  2827      '/dom/base',
  2748      '/dom/base',
  3176  #include "nsReadableUtils.h"
  3097  #include "nsReadableUtils.h"
  3177  #include "nsUnicharUtils.h"
  3098  #include "nsUnicharUtils.h"
  3178  #include "nsXPIDLString.h"
  3099  #include "nsXPIDLString.h"
  3179  #include "nsIURL.h"
  3100  #include "nsIURL.h"
  3180  #include "nsIFileStreams.h"
  3101  #include "nsIFileStreams.h"
  3181 @@ -1147,26 +1147,26 @@ nsresult nsOSHelperAppService::OSProtoco
  3102 @@ -1143,26 +1143,26 @@ nsresult nsOSHelperAppService::OSProtoco
  3182      ContentAction::Action::defaultActionForScheme(QString(aProtocolScheme) + ':');
  3103      ContentAction::Action::defaultActionForScheme(QString(aProtocolScheme) + ':');
  3183  
  3104  
  3184    if (action.isValid())
  3105    if (action.isValid())
  3185      *aHandlerExists = true;
  3106      *aHandlerExists = true;
  3186  #endif
  3107  #endif
  3205  #endif
  3126  #endif
  3206  }
  3127  }
  3207  
  3128  
  3208  nsresult nsOSHelperAppService::GetFileTokenForPath(const char16_t * platformAppPath, nsIFile ** aFile)
  3129  nsresult nsOSHelperAppService::GetFileTokenForPath(const char16_t * platformAppPath, nsIFile ** aFile)
  3209  {
  3130  {
  3210 @@ -1253,17 +1253,17 @@ nsOSHelperAppService::GetFromExtension(c
  3131 @@ -1249,17 +1249,17 @@ nsOSHelperAppService::GetFromExtension(c
  3211                                           mime_types_description,
  3132                                           mime_types_description,
  3212                                           true);
  3133                                           true);
  3213  
  3134  
  3214    if (NS_FAILED(rv) || majorType.IsEmpty()) {
  3135    if (NS_FAILED(rv) || majorType.IsEmpty()) {
  3215  
  3136  
  3224      }
  3145      }
  3225  #endif
  3146  #endif
  3226  
  3147  
  3227      rv = LookUpTypeAndDescription(NS_ConvertUTF8toUTF16(aFileExt),
  3148      rv = LookUpTypeAndDescription(NS_ConvertUTF8toUTF16(aFileExt),
  3228                                    majorType,
  3149                                    majorType,
  3229 @@ -1374,17 +1374,17 @@ nsOSHelperAppService::GetFromType(const 
  3150 @@ -1370,17 +1370,17 @@ nsOSHelperAppService::GetFromType(const 
  3230    nsAutoString extensions, mime_types_description;
  3151    nsAutoString extensions, mime_types_description;
  3231    LookUpExtensionsAndDescription(majorType,
  3152    LookUpExtensionsAndDescription(majorType,
  3232                                   minorType,
  3153                                   minorType,
  3233                                   extensions,
  3154                                   extensions,
  3234                                   mime_types_description);
  3155                                   mime_types_description);
  3246        return gnomeInfo.forget();
  3167        return gnomeInfo.forget();
  3247      }
  3168      }
  3248 diff --git a/widget/gtk/moz.build b/widget/gtk/moz.build
  3169 diff --git a/widget/gtk/moz.build b/widget/gtk/moz.build
  3249 --- a/widget/gtk/moz.build
  3170 --- a/widget/gtk/moz.build
  3250 +++ b/widget/gtk/moz.build
  3171 +++ b/widget/gtk/moz.build
  3251 @@ -101,16 +101,17 @@ else:
  3172 @@ -109,16 +109,17 @@ else:
  3252  include('/ipc/chromium/chromium-config.mozbuild')
  3173  include('/ipc/chromium/chromium-config.mozbuild')
  3253  
  3174  
  3254  FINAL_LIBRARY = 'xul'
  3175  FINAL_LIBRARY = 'xul'
  3255  
  3176  
  3256  LOCAL_INCLUDES += [
  3177  LOCAL_INCLUDES += [
  3257      '/layout/generic',
  3178      '/layout/generic',
  3258      '/layout/xul',
  3179      '/layout/xul',
  3259      '/other-licenses/atk-1.0',
  3180      '/other-licenses/atk-1.0',
  3260 +    '/toolkit/xre',
  3181 +    '/toolkit/xre',
  3261      '/widget',
  3182      '/widget',
       
  3183      '/widget/headless',
  3262  ]
  3184  ]
  3263  
  3185  
  3264  if CONFIG['MOZ_X11']:
  3186  if CONFIG['MOZ_X11']:
  3265      LOCAL_INCLUDES += [
  3187      LOCAL_INCLUDES += [
  3266          '/widget/x11',
  3188          '/widget/x11',
  3267      ]
  3189      ]
  3268  
       
  3269 diff --git a/widget/gtk/nsFilePicker.cpp b/widget/gtk/nsFilePicker.cpp
  3190 diff --git a/widget/gtk/nsFilePicker.cpp b/widget/gtk/nsFilePicker.cpp
  3270 --- a/widget/gtk/nsFilePicker.cpp
  3191 --- a/widget/gtk/nsFilePicker.cpp
  3271 +++ b/widget/gtk/nsFilePicker.cpp
  3192 +++ b/widget/gtk/nsFilePicker.cpp
  3272 @@ -4,32 +4,34 @@
  3193 @@ -4,32 +4,34 @@
  3273   * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
  3194   * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
  3724             ok) {
  3645             ok) {
  3725        ToLowerCase(token);
  3646        ToLowerCase(token);
  3726        NS_ConvertASCIItoUTF16 wtoken(token);
  3647        NS_ConvertASCIItoUTF16 wtoken(token);
  3727  
  3648  
  3728        if (CheckStringFlag(kApplication, wtoken, appID, stApp) ||
  3649        if (CheckStringFlag(kApplication, wtoken, appID, stApp) ||
  3729            CheckStringFlag(kOs, wtoken, osTarget, stOs) ||
  3650            CheckOsFlag(kOs, wtoken, osTarget, stOs) ||
  3730            CheckStringFlag(kABI, wtoken, abi, stABI) ||
  3651            CheckStringFlag(kABI, wtoken, abi, stABI) ||
  3731 +          CheckStringFlag(kDesktop, wtoken, desktop, stDesktop) ||
  3652 +          CheckStringFlag(kDesktop, wtoken, desktop, stDesktop) ||
  3732            CheckStringFlag(kProcess, wtoken, process, stProcess) ||
  3653            CheckStringFlag(kProcess, wtoken, process, stProcess) ||
  3733            CheckVersionFlag(kOsVersion, wtoken, osVersion, stOsVersion) ||
  3654            CheckVersionFlag(kOsVersion, wtoken, osVersion, stOsVersion) ||
  3734            CheckVersionFlag(kAppVersion, wtoken, appVersion, stAppVersion) ||
  3655            CheckVersionFlag(kAppVersion, wtoken, appVersion, stAppVersion) ||
  3735            CheckVersionFlag(kGeckoVersion, wtoken, geckoVersion, stGeckoVersion)) {
  3656            CheckVersionFlag(kGeckoVersion, wtoken, geckoVersion, stGeckoVersion)) {
  3736          continue;
  3657          continue;
  3737        }
  3658        }
  3738  
  3659  
  3739  #if defined(MOZ_WIDGET_ANDROID)
  3660  #if defined(MOZ_WIDGET_ANDROID)
  3740 @@ -734,16 +743,17 @@ ParseManifest(NSLocationType aType, File
  3661 @@ -729,16 +738,17 @@ ParseManifest(NSLocationType aType, File
  3741      }
  3662      }
  3742  
  3663  
  3743      if (!ok ||
  3664      if (!ok ||
  3744          stApp == eBad ||
  3665          stApp == eBad ||
  3745          stAppVersion == eBad ||
  3666          stAppVersion == eBad ||
  3756      }
  3677      }
  3757  
  3678  
  3758 diff --git a/xpcom/components/moz.build b/xpcom/components/moz.build
  3679 diff --git a/xpcom/components/moz.build b/xpcom/components/moz.build
  3759 --- a/xpcom/components/moz.build
  3680 --- a/xpcom/components/moz.build
  3760 +++ b/xpcom/components/moz.build
  3681 +++ b/xpcom/components/moz.build
  3761 @@ -50,12 +50,13 @@ FINAL_LIBRARY = 'xul'
  3682 @@ -44,12 +44,13 @@ FINAL_LIBRARY = 'xul'
  3762  LOCAL_INCLUDES += [
  3683  LOCAL_INCLUDES += [
  3763      '!..',
  3684      '!..',
  3764      '../base',
  3685      '../base',
  3765      '../build',
  3686      '../build',
  3766      '../ds',
  3687      '../ds',
  3791  #include <Carbon/Carbon.h>
  3712  #include <Carbon/Carbon.h>
  3792  #include "CocoaFileUtils.h"
  3713  #include "CocoaFileUtils.h"
  3793  #include "prmem.h"
  3714  #include "prmem.h"
  3794  #include "plbase64.h"
  3715  #include "plbase64.h"
  3795  
  3716  
  3796 @@ -1948,59 +1949,74 @@ nsLocalFile::SetPersistentDescriptor(con
  3717 @@ -1941,59 +1942,74 @@ nsLocalFile::SetPersistentDescriptor(con
  3797    return InitWithNativePath(aPersistentDescriptor);
  3718    return InitWithNativePath(aPersistentDescriptor);
  3798  #endif
  3719  #endif
  3799  }
  3720  }
  3800  
  3721  
  3801  NS_IMETHODIMP
  3722  NS_IMETHODIMP