Merge pull request #12 from import/firefox:rosa2016.1

Updated to 51.0
This commit is contained in:
alzim 2017-01-25 15:27:26 +03:00
commit 89eeecf5d8
5 changed files with 274 additions and 352 deletions

View file

@ -1,2 +1,2 @@
sources:
firefox-50.1.0.source.tar.xz: 6024dc49a566ed6296ad6cd707a199d41f090176
firefox-51.0.source.tar.xz: e7219a81b16d34d92872b4604051ce5ddb818126

View file

@ -0,0 +1,12 @@
--- firefox-50.1.0.old/build/autoconf/icu.m4 2016-11-01 04:15:27.000000000 +0800
+++ firefox-50.1.0/build/autoconf/icu.m4 2017-01-13 16:09:33.690488542 +0800
@@ -69,7 +69,7 @@
fi
fi
- version=`sed -n 's/^[[:space:]]*#[[:space:]]*define[[:space:]][[:space:]]*U_ICU_VERSION_MAJOR_NUM[[:space:]][[:space:]]*\([0-9][0-9]*\)[[:space:]]*$/\1/p' "$icudir/common/unicode/uvernum.h"`
+ version=`sed -n 's/^[[[:space:]]]*#[[:space:]]*define[[:space:]][[:space:]]*U_ICU_VERSION_MAJOR_NUM[[:space:]][[:space:]]*\([0-9][0-9]*\)[[:space:]]*$/\1/p' "$icudir/common/unicode/uvernum.h"`
if test x"$version" = x; then
AC_MSG_ERROR([cannot determine icu version number from uvernum.h header file $lineno])
fi

View file

@ -1,11 +1,11 @@
# HG changeset patch
# Parent 2cb2f829aabd7e3efaa973a0a8cf99aca9605bdc
# Parent 2cae514c05c8836ca5b69884d3a07998a5d53e8b
diff --git a/browser/base/content/browser-kde.xul b/browser/base/content/browser-kde.xul
new file mode 100644
--- /dev/null
+++ b/browser/base/content/browser-kde.xul
@@ -0,0 +1,1200 @@
@@ -0,0 +1,1119 @@
+#filter substitution
+<?xml version="1.0"?>
+# -*- Mode: HTML -*-
@ -160,14 +160,7 @@ new file mode 100644
+ noautofocus="true"
+ hidden="true"
+ flip="none"
+ level="parent">
+#ifdef NIGHTLY_BUILD
+ <hbox id="urlbar-search-footer" flex="1" align="stretch" pack="end">
+ <button id="urlbar-search-settings" label="&changeSearchSettings.button;"
+ oncommand="BrowserUITelemetry.countSearchSettingsEvent('urlbar'); openPreferences('paneSearch')"/>
+ </hbox>
+#endif
+ </panel>
+ level="parent"/>
+
+ <!-- for select dropdowns. The menupopup is what shows the list of options,
+ and the popuponly menulist makes things like the menuactive attributes
@ -175,7 +168,7 @@ new file mode 100644
+ popuponly menulist to be its immediate parent. -->
+ <menulist popuponly="true" id="ContentSelectDropdown" hidden="true">
+ <menupopup rolluponmousewheel="true"
+ activateontab="true"
+ activateontab="true" position="after_start"
+#ifdef XP_WIN
+ consumeoutsideclicks="false" ignorekeys="handled"
+#endif
@ -192,6 +185,7 @@ new file mode 100644
+ orient="vertical"
+ ignorekeys="true"
+ hidden="true"
+ tabspecific="true"
+ onpopupshown="StarUI.panelShown(event);"
+ aria-labelledby="editBookmarkPanelTitle">
+ <row id="editBookmarkPanelHeader" align="center" hidden="true">
@ -286,23 +280,6 @@ new file mode 100644
+ <hbox id="share-container" flex="1"/>
+ </panel>
+
+ <panel id="social-notification-panel"
+ class="social-panel"
+ type="arrow"
+ hidden="true"
+ noautofocus="true"/>
+ <panel id="social-flyout-panel"
+ class="social-panel"
+ onpopupshown="SocialFlyout.onShown()"
+ onpopuphidden="SocialFlyout.onHidden()"
+ side="right"
+ type="arrow"
+ hidden="true"
+ flip="slide"
+ rolluponmousewheel="true"
+ noautofocus="true"
+ position="topcenter topright"/>
+
+ <menupopup id="toolbar-context-menu"
+ onpopupshowing="onViewToolbarsPopupShowing(event, document.getElementById('viewToolbarsMenuSeparator'));">
+ <menuitem oncommand="gCustomizeMode.addToPanel(document.popupNode)"
@ -718,66 +695,54 @@ new file mode 100644
+ <image id="identity-icon"
+ consumeanchor="identity-box"
+ onclick="PageProxyClickHandler(event);"/>
+ <box id="blocked-permissions-container" align="center" tooltiptext="">
+ <image data-permission-id="geo" class="notification-anchor-icon geo-icon blocked" role="button"
+ aria-label="&urlbar.geolocationNotificationAnchor.label;"/>
+ <image data-permission-id="desktop-notification" class="notification-anchor-icon desktop-notification-icon blocked" role="button"
+ aria-label="&urlbar.webNotsNotificationAnchor3.label;"/>
+ <image data-permission-id="camera" class="notification-anchor-icon camera-icon blocked" role="button"
+ aria-label="&urlbar.webRTCShareDevicesNotificationAnchor.label;"/>
+ <image data-permission-id="indexedDB" class="notification-anchor-icon indexedDB-icon blocked" role="button"
+ aria-label="&urlbar.indexedDBNotificationAnchor.label;"/>
+ <image data-permission-id="microphone" class="notification-anchor-icon microphone-icon blocked" role="button"
+ aria-label="&urlbar.webRTCShareMicrophoneNotificationAnchor.label;"/>
+ <image data-permission-id="screen" class="notification-anchor-icon screen-icon blocked" role="button"
+ aria-label="&urlbar.webRTCShareScreenNotificationAnchor.label;"/>
+ <image data-permission-id="pointerLock" class="notification-anchor-icon pointerLock-icon blocked" role="button"
+ aria-label="&urlbar.pointerLockNotificationAnchor.label;"/>
+ <image id="sharing-icon" mousethrough="always"/>
+ <box id="blocked-permissions-container" align="center">
+ <image data-permission-id="geo" class="blocked-permission-icon geo-icon" role="button"
+ tooltiptext="&urlbar.geolocationBlocked.tooltip;"/>
+ <image data-permission-id="desktop-notification" class="blocked-permission-icon desktop-notification-icon" role="button"
+ tooltiptext="&urlbar.webNotificationsBlocked.tooltip;"/>
+ <image data-permission-id="camera" class="blocked-permission-icon camera-icon" role="button"
+ tooltiptext="&urlbar.cameraBlocked.tooltip;"/>
+ <image data-permission-id="indexedDB" class="blocked-permission-icon indexedDB-icon" role="button"
+ tooltiptext="&urlbar.indexedDBBlocked.tooltip;"/>
+ <image data-permission-id="microphone" class="blocked-permission-icon microphone-icon" role="button"
+ tooltiptext="&urlbar.microphoneBlocked.tooltip;"/>
+ <image data-permission-id="screen" class="blocked-permission-icon screen-icon" role="button"
+ tooltiptext="&urlbar.screenBlocked.tooltip;"/>
+ </box>
+ <box id="notification-popup-box"
+ hidden="true"
+ tooltiptext=""
+ onmouseover="document.getElementById('identity-icon').classList.add('no-hover');"
+ onmouseout="document.getElementById('identity-icon').classList.remove('no-hover');"
+ align="center">
+ <image id="default-notification-icon" class="notification-anchor-icon" role="button"
+ aria-label="&urlbar.defaultNotificationAnchor.label;"/>
+ tooltiptext="&urlbar.defaultNotificationAnchor.tooltip;"/>
+ <image id="geo-notification-icon" class="notification-anchor-icon geo-icon" role="button"
+ aria-label="&urlbar.geolocationNotificationAnchor.label;"/>
+ tooltiptext="&urlbar.geolocationNotificationAnchor.tooltip;"/>
+ <image id="addons-notification-icon" class="notification-anchor-icon install-icon" role="button"
+ aria-label="&urlbar.addonsNotificationAnchor.label;"/>
+ tooltiptext="&urlbar.addonsNotificationAnchor.tooltip;"/>
+ <image id="indexedDB-notification-icon" class="notification-anchor-icon indexedDB-icon" role="button"
+ aria-label="&urlbar.indexedDBNotificationAnchor.label;"/>
+ <image id="login-fill-notification-icon" class="notification-anchor-icon login-icon" role="button"
+ aria-label="&urlbar.loginFillNotificationAnchor.label;"/>
+ tooltiptext="&urlbar.indexedDBNotificationAnchor.tooltip;"/>
+ <image id="password-notification-icon" class="notification-anchor-icon login-icon" role="button"
+ aria-label="&urlbar.passwordNotificationAnchor.label;"/>
+ tooltiptext="&urlbar.passwordNotificationAnchor.tooltip;"/>
+ <image id="plugins-notification-icon" class="notification-anchor-icon plugin-icon" role="button"
+ aria-label="&urlbar.pluginsNotificationAnchor.label;"/>
+ tooltiptext="&urlbar.pluginsNotificationAnchor.tooltip;"/>
+ <image id="web-notifications-notification-icon" class="notification-anchor-icon desktop-notification-icon" role="button"
+ aria-label="&urlbar.webNotsNotificationAnchor3.label;"/>
+ tooltiptext="&urlbar.webNotificationAnchor.tooltip;"/>
+ <image id="webRTC-shareDevices-notification-icon" class="notification-anchor-icon camera-icon" role="button"
+ aria-label="&urlbar.webRTCShareDevicesNotificationAnchor.label;"/>
+ <image id="webRTC-sharingDevices-notification-icon" class="notification-anchor-icon camera-icon in-use" role="button"
+ aria-label="&urlbar.webRTCSharingDevicesNotificationAnchor.label;"/>
+ tooltiptext="&urlbar.webRTCShareDevicesNotificationAnchor.tooltip;"/>
+ <image id="webRTC-shareMicrophone-notification-icon" class="notification-anchor-icon microphone-icon" role="button"
+ aria-label="&urlbar.webRTCShareMicrophoneNotificationAnchor.label;"/>
+ <image id="webRTC-sharingMicrophone-notification-icon" class="notification-anchor-icon microphone-icon in-use" role="button"
+ aria-label="&urlbar.webRTCSharingMicrophoneNotificationAnchor.label;"/>
+ tooltiptext="&urlbar.webRTCShareMicrophoneNotificationAnchor.tooltip;"/>
+ <image id="webRTC-shareScreen-notification-icon" class="notification-anchor-icon screen-icon" role="button"
+ aria-label="&urlbar.webRTCShareScreenNotificationAnchor.label;"/>
+ <image id="webRTC-sharingScreen-notification-icon" class="notification-anchor-icon screen-icon in-use" role="button"
+ aria-label="&urlbar.webRTCSharingScreenNotificationAnchor.label;"/>
+ <image id="pointerLock-notification-icon" class="notification-anchor-icon pointerLock-icon" role="button"
+ aria-label="&urlbar.pointerLockNotificationAnchor.label;"/>
+ tooltiptext="&urlbar.webRTCShareScreenNotificationAnchor.tooltip;"/>
+ <image id="servicesInstall-notification-icon" class="notification-anchor-icon service-icon" role="button"
+ aria-label="&urlbar.servicesNotificationAnchor.label;"/>
+ tooltiptext="&urlbar.servicesNotificationAnchor.tooltip;"/>
+ <image id="translate-notification-icon" class="notification-anchor-icon translation-icon" role="button"
+ aria-label="&urlbar.translateNotificationAnchor.label;"/>
+ tooltiptext="&urlbar.translateNotificationAnchor.tooltip;"/>
+ <image id="translated-notification-icon" class="notification-anchor-icon translation-icon in-use" role="button"
+ aria-label="&urlbar.translatedNotificationAnchor.label;"/>
+ tooltiptext="&urlbar.translatedNotificationAnchor.tooltip;"/>
+ <image id="eme-notification-icon" class="notification-anchor-icon drm-icon" role="button"
+ aria-label="&urlbar.emeNotificationAnchor.label;"/>
+ tooltiptext="&urlbar.emeNotificationAnchor.tooltip;"/>
+ </box>
+ <image id="tracking-protection-icon"/>
+ <image id="connection-icon"/>
@ -799,6 +764,10 @@ new file mode 100644
+ class="urlbar-icon"
+ hidden="true"
+ onclick="ReaderParent.buttonClick(event);"/>
+ <toolbarbutton id="urlbar-zoom-button"
+ onclick="FullZoom.reset();"
+ tooltiptext="&urlbar.zoomReset.tooltip;"
+ hidden="true"/>
+ </hbox>
+ <hbox id="userContext-icons" hidden="true">
+ <label id="userContext-label"/>
@ -1080,7 +1049,7 @@ new file mode 100644
+ <image id="sidebar-throbber"/>
+ <toolbarbutton class="close-icon tabbable" tooltiptext="&sidebarCloseButton.tooltip;" oncommand="SidebarUI.hide();"/>
+ </sidebarheader>
+ <browser id="sidebar" flex="1" autoscroll="false" disablehistory="true"
+ <browser id="sidebar" flex="1" autoscroll="false" disablehistory="true" disablefullscreen="true"
+ style="min-width: 14em; width: 18em; max-width: 36em;" tooltip="aHTMLTooltip"/>
+ </vbox>
+
@ -1093,56 +1062,6 @@ new file mode 100644
+ contentcontextmenu="contentAreaContextMenu"
+ autocompletepopup="PopupAutoComplete"
+ selectmenulist="ContentSelectDropdown"/>
+ <chatbar id="pinnedchats" layer="true" mousethrough="always" hidden="true"/>
+ </vbox>
+ <splitter id="social-sidebar-splitter"
+ class="chromeclass-extrachrome sidebar-splitter"
+ observes="socialSidebarBroadcaster"/>
+ <vbox id="social-sidebar-box"
+ class="chromeclass-extrachrome"
+ observes="socialSidebarBroadcaster"
+ persist="width">
+
+ <sidebarheader id="social-sidebar-header" class="sidebar-header" align="center">
+ <image id="social-sidebar-favico"/>
+ <label id="social-sidebar-title" class="sidebar-title" persist="value" flex="1" crop="end" control="sidebar"/>
+ <toolbarbutton id="social-sidebar-button"
+ class="toolbarbutton-1"
+ type="menu">
+ <menupopup id="social-statusarea-popup" position="after_end">
+ <menuitem class="social-toggle-sidebar-menuitem"
+ type="checkbox"
+ autocheck="false"
+ command="Social:ToggleSidebar"
+ label="&social.toggleSidebar.label;"
+ accesskey="&social.toggleSidebar.accesskey;"/>
+ <menuitem class="social-toggle-notifications-menuitem"
+ type="checkbox"
+ autocheck="false"
+ command="Social:ToggleNotifications"
+ label="&social.toggleNotifications.label;"
+ accesskey="&social.toggleNotifications.accesskey;"/>
+ <menuseparator/>
+ <menuseparator class="social-provider-menu" hidden="true"/>
+ <menuitem class="social-addons-menuitem" command="Social:Addons"
+ label="&social.addons.label;"/>
+ <menuitem label="&social.learnMore.label;"
+ accesskey="&social.learnMore.accesskey;"
+ oncommand="SocialUI.showLearnMore();"/>
+ </menupopup>
+ </toolbarbutton>
+ </sidebarheader>
+
+ <browser id="social-sidebar-browser"
+ type="content"
+ context="contentAreaContextMenu"
+ message="true"
+ messagemanagergroup="social"
+ disableglobalhistory="true"
+ tooltip="aHTMLTooltip"
+ popupnotificationanchor="social-sidebar-favico"
+ flex="1"
+ style="min-width: 14em; width: 18em; max-width: 36em;"/>
+ </vbox>
+ <vbox id="browser-border-end" hidden="true" layer="true"/>
+ </hbox>
@ -1234,7 +1153,7 @@ diff --git a/browser/components/build/nsModule.cpp b/browser/components/build/ns
@@ -8,17 +8,17 @@
#include "nsBrowserCompsCID.h"
#include "DirectoryProvider.h"
#if defined(XP_WIN)
#include "nsWindowsShellService.h"
#elif defined(XP_MACOSX)
@ -1243,17 +1162,17 @@ diff --git a/browser/components/build/nsModule.cpp b/browser/components/build/ns
-#include "nsGNOMEShellService.h"
+#include "nsUnixShellService.h"
#endif
#if defined(XP_WIN)
#include "nsIEHistoryEnumerator.h"
#endif
#include "rdf.h"
#include "nsFeedSniffer.h"
@@ -31,18 +31,16 @@ using namespace mozilla::browser;
/////////////////////////////////////////////////////////////////////////////
NS_GENERIC_FACTORY_CONSTRUCTOR(DirectoryProvider)
#if defined(XP_WIN)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsWindowsShellService)
@ -1262,17 +1181,17 @@ diff --git a/browser/components/build/nsModule.cpp b/browser/components/build/ns
-#elif defined(MOZ_WIDGET_GTK)
-NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsGNOMEShellService, Init)
#endif
#if defined(XP_WIN)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsIEHistoryEnumerator)
#endif
NS_GENERIC_FACTORY_CONSTRUCTOR(nsFeedSniffer)
@@ -60,17 +58,17 @@ NS_DEFINE_NAMED_CID(NS_WINIEHISTORYENUME
NS_DEFINE_NAMED_CID(NS_SHELLSERVICE_CID);
#endif
static const mozilla::Module::CIDEntry kBrowserCIDs[] = {
{ &kNS_BROWSERDIRECTORYPROVIDER_CID, false, nullptr, DirectoryProviderConstructor },
#if defined(XP_WIN)
@ -1291,57 +1210,57 @@ diff --git a/browser/components/build/nsModule.cpp b/browser/components/build/ns
diff --git a/browser/components/preferences/in-content/main.js b/browser/components/preferences/in-content/main.js
--- a/browser/components/preferences/in-content/main.js
+++ b/browser/components/preferences/in-content/main.js
@@ -23,16 +23,22 @@ var gMainPane = {
init: function ()
{
function setEventListener(aId, aEventType, aCallback)
{
document.getElementById(aId)
.addEventListener(aEventType, aCallback.bind(gMainPane));
}
@@ -33,16 +33,22 @@ var gMainPane = {
if (AppConstants.platform == "win") {
// In Windows 8 we launch the control panel since it's the only
// way to get all file type association prefs. So we don't know
// when the user will select the default. We refresh here periodically
// in case the default changes. On other Windows OS's defaults can also
// be set while the prefs are open.
window.setInterval(this.updateSetDefaultBrowser.bind(this), 1000);
}
+
+ var env = Components.classes["@mozilla.org/process/environment;1"]
+ .getService(Components.interfaces.nsIEnvironment);
+ var kde_session = 0;
+ if (env.get('KDE_FULL_SESSION') == "true")
+ kde_session = 1;
+
#ifdef HAVE_SHELL_SERVICE
this.updateSetDefaultBrowser();
#ifdef XP_WIN
// In Windows 8 we launch the control panel since it's the only
// way to get all file type association prefs. So we don't know
// when the user will select the default. We refresh here periodically
// in case the default changes. On other Windows OS's defaults can also
// be set while the prefs are open.
@@ -703,16 +709,27 @@ var gMainPane = {
let alwaysCheckPref = document.getElementById("browser.shell.checkDefaultBrowser");
alwaysCheckPref.value = true;
let shellSvc = getShellService();
if (!shellSvc)
return;
try {
shellSvc.setDefaultBrowser(true, false);
+ if (kde_session == 1) {
+ var shellObj = Components.classes["@mozilla.org/file/local;1"]
+ .createInstance(Components.interfaces.nsILocalFile);
+ shellObj.initWithPath("/usr/bin/kwriteconfig");
+ var process = Components.classes["@mozilla.org/process/util;1"]
+ .createInstance(Components.interfaces.nsIProcess);
+ process.init(shellObj);
+ var args = ["--file", "kdeglobals", "--group", "General", "--key",
+ "BrowserApplication", "firefox"];
+ process.run(false, args, args.length);
+ }
} catch (ex) {
Cu.reportError(ex);
return;
}
let selectedIndex = shellSvc.isDefaultBrowser(false, true) ? 1 : 0;
document.getElementById("setDefaultPane").selectedIndex = selectedIndex;
}
// set up the "use current page" label-changing listener
this._updateUseCurrentButton();
window.addEventListener("focus", this._updateUseCurrentButton.bind(this), false);
this.updateBrowserStartupLastSession();
@@ -704,16 +710,27 @@ var gMainPane = {
let alwaysCheckPref = document.getElementById("browser.shell.checkDefaultBrowser");
alwaysCheckPref.value = true;
let shellSvc = getShellService();
if (!shellSvc)
return;
try {
shellSvc.setDefaultBrowser(true, false);
+ if (kde_session == 1) {
+ var shellObj = Components.classes["@mozilla.org/file/local;1"]
+ .createInstance(Components.interfaces.nsILocalFile);
+ shellObj.initWithPath("/usr/bin/kwriteconfig");
+ var process = Components.classes["@mozilla.org/process/util;1"]
+ .createInstance(Components.interfaces.nsIProcess);
+ process.init(shellObj);
+ var args = ["--file", "kdeglobals", "--group", "General", "--key",
+ "BrowserApplication", "firefox"];
+ process.run(false, args, args.length);
+ }
} catch (ex) {
Cu.reportError(ex);
return;
}
let selectedIndex = shellSvc.isDefaultBrowser(false, true) ? 1 : 0;
document.getElementById("setDefaultPane").selectedIndex = selectedIndex;
}
diff --git a/browser/components/shell/moz.build b/browser/components/shell/moz.build
--- a/browser/components/shell/moz.build
+++ b/browser/components/shell/moz.build
@ -1357,10 +1276,10 @@ diff --git a/browser/components/shell/moz.build b/browser/components/shell/moz.b
+ 'nsKDEShellService.cpp',
+ 'nsUnixShellService.cpp',
]
if SOURCES:
FINAL_LIBRARY = 'browsercomps'
EXTRA_COMPONENTS += [
'nsSetDefaultBrowser.js',
'nsSetDefaultBrowser.manifest',
@ -1657,21 +1576,22 @@ new file mode 100644
diff --git a/browser/installer/package-manifest.in b/browser/installer/package-manifest.in
--- a/browser/installer/package-manifest.in
+++ b/browser/installer/package-manifest.in
@@ -674,16 +674,17 @@
@@ -675,16 +675,17 @@
@RESPATH@/greprefs.js
@RESPATH@/defaults/autoconfig/prefcalls.js
@RESPATH@/browser/defaults/permissions
; Warning: changing the path to channel-prefs.js can cause bugs (Bug 756325)
; Technically this is an app pref file, but we are keeping it in the original
; gre location for now.
@RESPATH@/defaults/pref/channel-prefs.js
+@BINPATH@/defaults/pref/kde.js
; Services (gre) prefs
@RESPATH@/defaults/pref/services-sync.js
; [Layout Engine Resources]
; Style Sheets, Graphics and other Resources used by the layout engine.
@RESPATH@/res/EditorOverride.css
@RESPATH@/res/contenteditable.css

View file

@ -7,7 +7,7 @@
# This also means only STABLE upstream releases, NO betas.
# This is a discussed topic. Please, do not flame it again.
%define major 50.1.0
%define major 51.0
%define ff_epoch 0
# (tpg) set version HERE !!!
%define realver %{major}
@ -211,7 +211,7 @@ autoconf-2.13
# needed to regenerate certdata.c
pushd security/nss/lib/ckfw/builtins
perl ./certdata.perl < /etc/pki/tls/mozilla/certdata.txt
perl ./certdata.perl /etc/pki/tls/mozilla/certdata.txt
popd
%build

View file

@ -1,5 +1,5 @@
# HG changeset patch
# Parent 6ff55468281e12a84adefb46b17acb60d9cea608
# Parent f3e80d26a430dfa1c58421fb66144a3c23ffc166
Description: Add KDE integration to Firefox (toolkit parts)
Author: Wolfgang Rosenauer <wolfgang@rosenauer.org>
Author: Lubos Lunak <lunak@suse.com>
@ -19,23 +19,23 @@ diff --git a/modules/libpref/Preferences.cpp b/modules/libpref/Preferences.cpp
#include "nsAutoPtr.h"
#include "nsPrintfCString.h"
+#include "nsKDEUtils.h"
#include "nsQuickSort.h"
#include "PLDHashTable.h"
#include "prefapi.h"
#include "prefread.h"
#include "prefapi_private_data.h"
@@ -1180,16 +1181,34 @@ pref_LoadPrefsInDir(nsIFile* aDir, char
@@ -1174,16 +1175,34 @@ pref_LoadPrefsInDir(nsIFile* aDir, char
static nsresult pref_LoadPrefsInDirList(const char *listId)
{
nsresult rv;
nsCOMPtr<nsIProperties> dirSvc(do_GetService(NS_DIRECTORY_SERVICE_CONTRACTID, &rv));
if (NS_FAILED(rv))
return rv;
+ // make sure we load these special files after all the others
+ static const char* specialFiles[] = {
+#if defined(XP_UNIX)
@ -60,13 +60,13 @@ diff --git a/modules/libpref/Preferences.cpp b/modules/libpref/Preferences.cpp
getter_AddRefs(list));
if (!list)
return NS_OK;
bool hasMore;
@@ -1205,17 +1224,17 @@ static nsresult pref_LoadPrefsInDirList(
@@ -1199,17 +1218,17 @@ static nsresult pref_LoadPrefsInDirList(
nsAutoCString leaf;
path->GetNativeLeafName(leaf);
// Do we care if a file provided by this process fails to load?
if (Substring(leaf, leaf.Length() - 4).EqualsLiteral(".xpi"))
ReadExtensionPrefs(path);
@ -76,12 +76,12 @@ diff --git a/modules/libpref/Preferences.cpp b/modules/libpref/Preferences.cpp
}
return NS_OK;
}
static nsresult pref_ReadPrefFromJar(nsZipArchive* jarReader, const char *name)
{
nsZipItemPtr<char> manifest(jarReader, name, true);
NS_ENSURE_TRUE(manifest.Buffer(), NS_ERROR_NOT_AVAILABLE);
@@ -1309,24 +1328,36 @@ static nsresult pref_InitInitialObjects(
@@ -1303,24 +1322,36 @@ static nsresult pref_InitInitialObjects(
/* these pref file names should not be used: we process them after all other application pref files for backwards compatibility */
static const char* specialFiles[] = {
#if defined(XP_MACOSX)
@ -98,7 +98,7 @@ diff --git a/modules/libpref/Preferences.cpp b/modules/libpref/Preferences.cpp
"beos.js"
#endif
};
+ if(nsKDEUtils::kdeSession()) { // TODO what if some setup actually requires the helper?
+ for(int i = 0;
+ i < MOZ_ARRAY_LENGTH(specialFiles);
@ -113,7 +113,7 @@ diff --git a/modules/libpref/Preferences.cpp b/modules/libpref/Preferences.cpp
rv = pref_LoadPrefsInDir(defaultPrefDir, specialFiles, ArrayLength(specialFiles));
if (NS_FAILED(rv))
NS_WARNING("Error parsing application default preferences.");
// Load jar:$app/omni.jar!/defaults/preferences/*.js
// or jar:$gre/omni.jar!/defaults/preferences/*.js.
RefPtr<nsZipArchive> appJarReader = mozilla::Omnijar::GetReader(mozilla::Omnijar::APP);
@ -124,23 +124,23 @@ diff --git a/modules/libpref/moz.build b/modules/libpref/moz.build
@@ -31,16 +31,20 @@ UNIFIED_SOURCES += [
'prefread.cpp',
]
# prefapi.cpp cannot be built in unified mode because it uses plarena.h
SOURCES += [
'prefapi.cpp',
]
+LOCAL_INCLUDES += [
+ '/toolkit/xre'
+]
+
include('/ipc/chromium/chromium-config.mozbuild')
FINAL_LIBRARY = 'xul'
DEFINES['OS_ARCH'] = CONFIG['OS_ARCH']
DEFINES['MOZ_WIDGET_TOOLKIT'] = CONFIG['MOZ_WIDGET_TOOLKIT']
FINAL_TARGET_PP_FILES += [
diff --git a/python/mozbuild/mozpack/chrome/flags.py b/python/mozbuild/mozpack/chrome/flags.py
--- a/python/mozbuild/mozpack/chrome/flags.py
@ -157,7 +157,7 @@ diff --git a/python/mozbuild/mozpack/chrome/flags.py b/python/mozbuild/mozpack/c
+ 'desktop': StringFlag,
}
RE = re.compile(r'([!<>=]+)')
def __init__(self, *flags):
'''
Initialize a set of flags given in string form.
@ -177,7 +177,7 @@ diff --git a/python/mozbuild/mozpack/chrome/manifest.py b/python/mozbuild/mozpac
'process',
+ 'desktop',
]
def __init__(self, base, *flags):
'''
Initialize a manifest entry with the given base path and flags.
@ -187,30 +187,28 @@ diff --git a/python/mozbuild/mozpack/chrome/manifest.py b/python/mozbuild/mozpac
diff --git a/toolkit/components/downloads/moz.build b/toolkit/components/downloads/moz.build
--- a/toolkit/components/downloads/moz.build
+++ b/toolkit/components/downloads/moz.build
@@ -60,17 +60,18 @@ if not CONFIG['MOZ_SUITE']:
'nsDownloadManagerUI.js',
@@ -57,16 +57,17 @@ if not CONFIG['MOZ_SUITE']:
'nsDownloadManagerUI.manifest',
]
FINAL_LIBRARY = 'xul'
LOCAL_INCLUDES += [
'../protobuf',
- '/ipc/chromium/src'
+ '/ipc/chromium/src',
+ '/toolkit/xre'
'/ipc/chromium/src',
+ '/toolkit/xre',
'chromium'
]
DEFINES['GOOGLE_PROTOBUF_NO_RTTI'] = True
DEFINES['GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER'] = True
CXXFLAGS += CONFIG['TK_CFLAGS']
if CONFIG['GNU_CXX']:
diff --git a/toolkit/components/downloads/nsDownloadManager.cpp b/toolkit/components/downloads/nsDownloadManager.cpp
--- a/toolkit/components/downloads/nsDownloadManager.cpp
+++ b/toolkit/components/downloads/nsDownloadManager.cpp
@@ -51,16 +51,20 @@
@@ -52,16 +52,20 @@
#ifdef XP_WIN
#include <shlobj.h>
#include "nsWindowsHelpers.h"
@ -218,7 +216,7 @@ diff --git a/toolkit/components/downloads/nsDownloadManager.cpp b/toolkit/compon
#include "nsDownloadScanner.h"
#endif
#endif
+#if defined(XP_UNIX) && !defined(XP_MACOSX)
+#include "nsKDEUtils.h"
+#endif
@ -226,19 +224,19 @@ diff --git a/toolkit/components/downloads/nsDownloadManager.cpp b/toolkit/compon
#ifdef XP_MACOSX
#include <CoreFoundation/CoreFoundation.h>
#endif
#ifdef MOZ_WIDGET_ANDROID
#include "GeneratedJNIWrappers.h"
#include "FennecJNIWrappers.h"
#endif
@@ -2719,16 +2723,25 @@ nsDownload::SetState(DownloadState aStat
@@ -2723,16 +2727,25 @@ nsDownload::SetState(DownloadState aStat
nsCOMPtr<nsIPrefBranch> pref(do_GetService(NS_PREFSERVICE_CONTRACTID));
// Master pref to control this function.
bool showTaskbarAlert = true;
if (pref)
pref->GetBoolPref(PREF_BDM_SHOWALERTONCOMPLETE, &showTaskbarAlert);
if (showTaskbarAlert) {
+ if( nsKDEUtils::kdeSupport()) {
+ nsTArray<nsCString> command;
@ -252,12 +250,12 @@ diff --git a/toolkit/components/downloads/nsDownloadManager.cpp b/toolkit/compon
int32_t alertInterval = 2000;
if (pref)
pref->GetIntPref(PREF_BDM_SHOWALERTINTERVAL, &alertInterval);
int64_t alertIntervalUSec = alertInterval * PR_USEC_PER_MSEC;
int64_t goat = PR_Now() - mStartTime;
showTaskbarAlert = goat > alertIntervalUSec;
@@ -2759,16 +2772,17 @@ nsDownload::SetState(DownloadState aStat
@@ -2763,16 +2776,17 @@ nsDownload::SetState(DownloadState aStat
NS_LITERAL_STRING(DOWNLOAD_MANAGER_ALERT_ICON), title,
message, !removeWhenDone,
mPrivate ? NS_LITERAL_STRING("private") : NS_LITERAL_STRING("non-private"),
@ -267,12 +265,12 @@ diff --git a/toolkit/components/downloads/nsDownloadManager.cpp b/toolkit/compon
}
}
+ }
#if defined(XP_WIN) || defined(XP_MACOSX) || defined(MOZ_WIDGET_ANDROID) || defined(MOZ_WIDGET_GTK)
nsCOMPtr<nsIFileURL> fileURL = do_QueryInterface(mTarget);
nsCOMPtr<nsIFile> file;
nsAutoString path;
if (fileURL &&
NS_SUCCEEDED(fileURL->GetFile(getter_AddRefs(file))) &&
diff --git a/toolkit/content/jar.mn b/toolkit/content/jar.mn
@ -316,7 +314,7 @@ diff --git a/toolkit/content/widgets/dialog-kde.xml b/toolkit/content/widgets/di
new file mode 100644
--- /dev/null
+++ b/toolkit/content/widgets/dialog-kde.xml
@@ -0,0 +1,463 @@
@@ -0,0 +1,457 @@
+<?xml version="1.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
@ -386,8 +384,7 @@ new file mode 100644
+ <![CDATA[
+ if (this.hasAttribute("defaultButton"))
+ return this.getAttribute("defaultButton");
+ else // default to the accept button
+ return "accept";
+ return "accept"; // default to the accept button
+ ]]>
+ </getter>
+ <setter>
@ -491,9 +488,6 @@ new file mode 100644
+ <parameter name="aEvent"/>
+ <body>
+ <![CDATA[
+ let { AppConstants } =
+ Components.utils.import("resource://gre/modules/AppConstants.jsm", {});
+
+ function focusInit() {
+ const dialog = document.documentElement;
+ const defaultButton = dialog.getButton(dialog.defaultButton);
@ -519,7 +513,7 @@ new file mode 100644
+ initialFocusedElt.focus();
+ }
+ }
+ else if (AppConstants.platform != "macosx" &&
+ else if (!/Mac/.test(navigator.platform) &&
+ focusedElt.hasAttribute("dlgtype") && focusedElt != defaultButton) {
+ defaultButton.focus();
+ }
@ -604,16 +598,16 @@ new file mode 100644
+ else
+ switch (dlgtype) {
+ case "accept":
+ button.setAttribute("icon","accept");
+ button.setAttribute("icon", "accept");
+ break;
+ case "cancel":
+ button.setAttribute("icon","cancel");
+ button.setAttribute("icon", "cancel");
+ break;
+ case "disclosure":
+ button.setAttribute("icon","properties");
+ button.setAttribute("icon", "properties");
+ break;
+ case "help":
+ button.setAttribute("icon","help");
+ button.setAttribute("icon", "help");
+ break;
+ default:
+ break;
@ -639,10 +633,8 @@ new file mode 100644
+ for (dlgtype in buttons)
+ buttons[dlgtype].hidden = !shown[dlgtype];
+
+ let { AppConstants } =
+ Components.utils.import("resource://gre/modules/AppConstants.jsm", {});
+ // show the spacer on Windows only when the extra2 button is present
+ if (AppConstants.platform == "win") {
+ if (/Win/.test(navigator.platform)) {
+ var spacer = document.getAnonymousElementByAttribute(this, "anonid", "spacer");
+ spacer.removeAttribute("hidden");
+ spacer.setAttribute("flex", shown["extra2"]?"1":"0");
@ -784,7 +776,7 @@ diff --git a/toolkit/content/widgets/preferences-kde.xml b/toolkit/content/widge
new file mode 100644
--- /dev/null
+++ b/toolkit/content/widgets/preferences-kde.xml
@@ -0,0 +1,1410 @@
@@ -0,0 +1,1403 @@
+<?xml version="1.0"?>
+
+<!DOCTYPE bindings [
@ -1422,10 +1414,7 @@ new file mode 100644
+ var acceptButton = docElt.getButton("accept");
+ acceptButton.hidden = true;
+ var cancelButton = docElt.getButton("cancel");
+
+ let { AppConstants } =
+ Components.utils.import("resource://gre/modules/AppConstants.jsm", {});
+ if (AppConstants.platform == "macosx") {
+ if (/Mac/.test(navigator.platform)) {
+ // no buttons on Mac except Help
+ cancelButton.hidden = true;
+ // Move Help button to the end
@ -1607,9 +1596,7 @@ new file mode 100644
+ <parameter name="aPaneElement"/>
+ <body>
+ <![CDATA[
+ let { AppConstants } =
+ Components.utils.import("resource://gre/modules/AppConstants.jsm", {});
+ if (AppConstants.platform == "macosx") {
+ if (/Mac/.test(navigator.platform)) {
+ var paneTitle = aPaneElement.label;
+ if (paneTitle != "")
+ document.title = paneTitle;
@ -1683,11 +1670,9 @@ new file mode 100644
+ <property name="_shouldAnimate">
+ <getter>
+ <![CDATA[
+ let { AppConstants } =
+ Components.utils.import("resource://gre/modules/AppConstants.jsm", {});
+ var psvc = Components.classes["@mozilla.org/preferences-service;1"]
+ .getService(Components.interfaces.nsIPrefBranch);
+ var animate = AppConstants.platform == "macosx";
+ var animate = /Mac/.test(navigator.platform);
+ try {
+ animate = psvc.getBoolPref("browser.preferences.animateFadeIn");
+ }
@ -1854,7 +1839,7 @@ new file mode 100644
+ <handlers>
+ <handler event="dialogaccept">
+ <![CDATA[
+ if (!this._fireEvent("beforeaccept", this)){
+ if (!this._fireEvent("beforeaccept", this)) {
+ return false;
+ }
+
@ -2208,12 +2193,12 @@ diff --git a/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp b/toolkit/sy
#include "mozilla/Attributes.h"
#include "nsIURI.h"
+#include "nsKDEUtils.h"
class nsUnixSystemProxySettings final : public nsISystemProxySettings {
public:
NS_DECL_ISUPPORTS
NS_DECL_NSISYSTEMPROXYSETTINGS
nsUnixSystemProxySettings()
: mSchemeProxySettings(4)
@@ -39,16 +40,17 @@ private:
@ -2227,15 +2212,15 @@ diff --git a/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp b/toolkit/sy
nsresult SetProxyResultFromGSettings(const char* aKeyBase, const char* aType, nsACString& aResult);
+ nsresult GetProxyFromKDE(const nsACString& aScheme, const nsACString& aHost, PRInt32 aPort, nsACString& aResult);
};
NS_IMPL_ISUPPORTS(nsUnixSystemProxySettings, nsISystemProxySettings)
NS_IMETHODIMP
nsUnixSystemProxySettings::GetMainThreadOnly(bool *aMainThreadOnly)
{
// dbus prevents us from being threadsafe, but this routine should not block anyhow
@@ -505,16 +507,19 @@ nsUnixSystemProxySettings::GetProxyFromG
nsresult
nsUnixSystemProxySettings::GetProxyForURI(const nsACString & aSpec,
const nsACString & aScheme,
@ -2253,15 +2238,15 @@ diff --git a/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp b/toolkit/sy
}
if (mGConf)
return GetProxyFromGConf(aScheme, aHost, aPort, aResult);
@@ -540,8 +545,34 @@ static const mozilla::Module::ContractID
static const mozilla::Module kUnixProxyModule = {
mozilla::Module::kVersion,
kUnixProxyCIDs,
kUnixProxyContracts
};
NSMODULE_DEFN(nsUnixProxyModule) = &kUnixProxyModule;
+
+nsresult
@ -2292,7 +2277,7 @@ diff --git a/toolkit/system/unixproxy/nsUnixSystemProxySettings.cpp b/toolkit/sy
diff --git a/toolkit/xre/moz.build b/toolkit/xre/moz.build
--- a/toolkit/xre/moz.build
+++ b/toolkit/xre/moz.build
@@ -39,17 +39,19 @@ elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'co
@@ -40,17 +40,19 @@ elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'co
'updaterfileutils_osx.mm',
]
elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'uikit':
@ -2310,13 +2295,13 @@ diff --git a/toolkit/xre/moz.build b/toolkit/xre/moz.build
UNIFIED_SOURCES += [
'nsNativeAppSupportDefault.cpp',
]
if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk3':
diff --git a/toolkit/xre/nsKDEUtils.cpp b/toolkit/xre/nsKDEUtils.cpp
new file mode 100644
--- /dev/null
+++ b/toolkit/xre/nsKDEUtils.cpp
@@ -0,0 +1,339 @@
@@ -0,0 +1,344 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/* 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
@ -2337,6 +2322,11 @@ new file mode 100644
+#include <sys/resource.h>
+#include <unistd.h>
+#include <X11/Xlib.h>
+// copied from X11/X.h as a hack since for an unknown
+// reason it's not picked up from X11/X.h
+#ifndef None
+#define None 0L /* universal null resource or null atom */
+#endif
+
+//#define DEBUG_KDE
+#ifdef DEBUG_KDE
@ -2718,7 +2708,7 @@ diff --git a/uriloader/exthandler/moz.build b/uriloader/exthandler/moz.build
]
if CONFIG['GNU_CXX']:
CXXFLAGS += ['-Wno-error=shadow']
if 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT']:
UNIFIED_SOURCES += [
+ 'unix/nsCommonRegistry.cpp',
@ -2733,9 +2723,9 @@ diff --git a/uriloader/exthandler/moz.build b/uriloader/exthandler/moz.build
'android/nsExternalURLHandlerService.cpp',
'android/nsMIMEInfoAndroid.cpp',
@@ -123,16 +125,17 @@ include('/ipc/chromium/chromium-config.m
FINAL_LIBRARY = 'xul'
LOCAL_INCLUDES += [
'/dom/base',
'/dom/ipc',
@ -2743,11 +2733,11 @@ diff --git a/uriloader/exthandler/moz.build b/uriloader/exthandler/moz.build
'/netwerk/protocol/http',
+ '/toolkit/xre',
]
if CONFIG['MOZ_ENABLE_DBUS']:
CXXFLAGS += CONFIG['TK_CFLAGS']
CXXFLAGS += CONFIG['MOZ_DBUS_CFLAGS']
if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('gtk2', 'gtk3'):
CXXFLAGS += CONFIG['TK_CFLAGS']
diff --git a/uriloader/exthandler/unix/nsCommonRegistry.cpp b/uriloader/exthandler/unix/nsCommonRegistry.cpp
@ -2982,7 +2972,7 @@ diff --git a/uriloader/exthandler/unix/nsMIMEInfoUnix.cpp b/uriloader/exthandler
* 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 "nsMIMEInfoUnix.h"
-#include "nsGNOMERegistry.h"
+#include "nsCommonRegistry.h"
@ -2996,14 +2986,14 @@ diff --git a/uriloader/exthandler/unix/nsMIMEInfoUnix.cpp b/uriloader/exthandler
+#if defined(XP_UNIX) && !defined(XP_MACOSX)
+#include "nsKDEUtils.h"
+#endif
nsresult
nsMIMEInfoUnix::LoadUriInternal(nsIURI * aURI)
{
- return nsGNOMERegistry::LoadURL(aURI);
+ return nsCommonRegistry::LoadURL(aURI);
}
NS_IMETHODIMP
nsMIMEInfoUnix::GetHasDefaultHandler(bool *_retval)
{
@ -3012,9 +3002,9 @@ diff --git a/uriloader/exthandler/unix/nsMIMEInfoUnix.cpp b/uriloader/exthandler
// give the GNOME answer.
if (mDefaultApplication)
return nsMIMEInfoImpl::GetHasDefaultHandler(_retval);
*_retval = false;
if (mClass == eProtocolInfo) {
- *_retval = nsGNOMERegistry::HandlerExists(mSchemeOrType.get());
+ *_retval = nsCommonRegistry::HandlerExists(mSchemeOrType.get());
@ -3032,7 +3022,7 @@ diff --git a/uriloader/exthandler/unix/nsMIMEInfoUnix.cpp b/uriloader/exthandler
if (mimeInfo)
*_retval = true;
}
if (*_retval)
return NS_OK;
@@ -79,16 +82,33 @@ nsMIMEInfoUnix::LaunchDefaultWithFile(ns
@ -3043,7 +3033,7 @@ diff --git a/uriloader/exthandler/unix/nsMIMEInfoUnix.cpp b/uriloader/exthandler
}
return NS_ERROR_FAILURE;
#endif
+ if( nsKDEUtils::kdeSupport()) {
+ bool supports;
+ if( NS_SUCCEEDED( GetHasDefaultHandler( &supports )) && supports ) {
@ -3065,7 +3055,7 @@ diff --git a/uriloader/exthandler/unix/nsMIMEInfoUnix.cpp b/uriloader/exthandler
if (!giovfs) {
return NS_ERROR_FAILURE;
}
// nsGIOMimeApp->Launch wants a URI string instead of local file
nsresult rv;
nsCOMPtr<nsIIOService> ioservice = do_GetService(NS_IOSERVICE_CONTRACTID, &rv);
@ -3077,7 +3067,7 @@ diff --git a/uriloader/exthandler/unix/nsOSHelperAppService.cpp b/uriloader/exth
#include <contentaction/contentaction.h>
#include <QString>
#endif
#include "nsOSHelperAppService.h"
#include "nsMIMEInfoUnix.h"
#ifdef MOZ_WIDGET_GTK
@ -3093,20 +3083,20 @@ diff --git a/uriloader/exthandler/unix/nsOSHelperAppService.cpp b/uriloader/exth
#include "nsIFileStreams.h"
@@ -1146,26 +1146,26 @@ nsresult nsOSHelperAppService::OSProtoco
ContentAction::Action::defaultActionForScheme(QString(aProtocolScheme) + ':');
if (action.isValid())
*aHandlerExists = true;
#endif
#ifdef MOZ_WIDGET_GTK
// Check the GNOME registry for a protocol handler
- *aHandlerExists = nsGNOMERegistry::HandlerExists(aProtocolScheme);
+ *aHandlerExists = nsCommonRegistry::HandlerExists(aProtocolScheme);
#endif
return NS_OK;
}
NS_IMETHODIMP nsOSHelperAppService::GetApplicationDescription(const nsACString& aScheme, nsAString& _retval)
{
#ifdef MOZ_WIDGET_GTK
@ -3117,15 +3107,15 @@ diff --git a/uriloader/exthandler/unix/nsOSHelperAppService.cpp b/uriloader/exth
return NS_ERROR_NOT_AVAILABLE;
#endif
}
nsresult nsOSHelperAppService::GetFileTokenForPath(const char16_t * platformAppPath, nsIFile ** aFile)
{
@@ -1252,17 +1252,17 @@ nsOSHelperAppService::GetFromExtension(c
mime_types_description,
true);
if (NS_FAILED(rv) || majorType.IsEmpty()) {
#ifdef MOZ_WIDGET_GTK
LOG(("Looking in GNOME registry\n"));
RefPtr<nsMIMEInfoBase> gnomeInfo =
@ -3136,16 +3126,16 @@ diff --git a/uriloader/exthandler/unix/nsOSHelperAppService.cpp b/uriloader/exth
return gnomeInfo.forget();
}
#endif
rv = LookUpTypeAndDescription(NS_ConvertUTF8toUTF16(aFileExt),
majorType,
@@ -1373,17 +1373,17 @@ nsOSHelperAppService::GetFromType(const
@@ -1373,17 +1373,17 @@ nsOSHelperAppService::GetFromType(const
nsAutoString extensions, mime_types_description;
LookUpExtensionsAndDescription(majorType,
minorType,
extensions,
mime_types_description);
#ifdef MOZ_WIDGET_GTK
if (handler.IsEmpty()) {
- RefPtr<nsMIMEInfoBase> gnomeInfo = nsGNOMERegistry::GetFromType(aMIMEType);
@ -3153,7 +3143,7 @@ diff --git a/uriloader/exthandler/unix/nsOSHelperAppService.cpp b/uriloader/exth
if (gnomeInfo) {
LOG(("Got MIMEInfo from GNOME registry without extensions; setting them "
"to %s\n", NS_LossyConvertUTF16toASCII(extensions).get()));
NS_ASSERTION(!gnomeInfo->HasExtensions(), "How'd that happen?");
gnomeInfo->SetFileExtensions(NS_ConvertUTF16toUTF8(extensions));
return gnomeInfo.forget();
@ -3161,11 +3151,11 @@ diff --git a/uriloader/exthandler/unix/nsOSHelperAppService.cpp b/uriloader/exth
diff --git a/widget/gtk/moz.build b/widget/gtk/moz.build
--- a/widget/gtk/moz.build
+++ b/widget/gtk/moz.build
@@ -90,16 +90,17 @@ else:
@@ -101,16 +101,17 @@ else:
include('/ipc/chromium/chromium-config.mozbuild')
FINAL_LIBRARY = 'xul'
LOCAL_INCLUDES += [
'/layout/generic',
'/layout/xul',
@ -3173,54 +3163,54 @@ diff --git a/widget/gtk/moz.build b/widget/gtk/moz.build
+ '/toolkit/xre',
'/widget',
]
if CONFIG['MOZ_X11']:
LOCAL_INCLUDES += [
'/widget/x11',
]
diff --git a/widget/gtk/nsFilePicker.cpp b/widget/gtk/nsFilePicker.cpp
--- a/widget/gtk/nsFilePicker.cpp
+++ b/widget/gtk/nsFilePicker.cpp
@@ -4,32 +4,34 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "mozilla/Types.h"
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <gtk/gtk.h>
+#include <gdk/gdkx.h>
#include "nsGtkUtils.h"
#include "nsIFileURL.h"
#include "nsIURI.h"
#include "nsIWidget.h"
#include "nsIFile.h"
#include "nsIStringBundle.h"
#include "nsArrayEnumerator.h"
#include "nsMemory.h"
#include "nsEnumeratorUtils.h"
#include "nsNetUtil.h"
#include "nsReadableUtils.h"
#include "mozcontainer.h"
#include "nsFilePicker.h"
+#include "nsKDEUtils.h"
using namespace mozilla;
#define MAX_PREVIEW_SIZE 180
// bug 1184009
#define MAX_PREVIEW_SOURCE_SIZE 4096
nsIFile *nsFilePicker::mPrevDisplayDirectory = nullptr;
@@ -246,17 +248,19 @@ nsFilePicker::AppendFilters(int32_t aFil
return nsBaseFilePicker::AppendFilters(aFilterMask);
}
NS_IMETHODIMP
nsFilePicker::AppendFilter(const nsAString& aTitle, const nsAString& aFilter)
{
@ -3231,22 +3221,22 @@ diff --git a/widget/gtk/nsFilePicker.cpp b/widget/gtk/nsFilePicker.cpp
+ if( mMode != modeOpen || !nsKDEUtils::kdeSupport())
+ return NS_OK;
}
nsAutoCString filter, name;
CopyUTF16toUTF8(aFilter, filter);
CopyUTF16toUTF8(aTitle, name);
mFilters.AppendElement(filter);
mFilterNames.AppendElement(name);
@@ -371,16 +375,32 @@ nsFilePicker::Show(int16_t *aReturn)
NS_IMETHODIMP
nsFilePicker::Open(nsIFilePickerShownCallback *aCallback)
{
// Can't show two dialogs concurrently with the same filepicker
if (mRunning)
return NS_ERROR_NOT_AVAILABLE;
+ // KDE file picker is not handled via callback
+ if( nsKDEUtils::kdeSupport()) {
+ int16_t result;
@ -3265,12 +3255,12 @@ diff --git a/widget/gtk/nsFilePicker.cpp b/widget/gtk/nsFilePicker.cpp
+
nsXPIDLCString title;
title.Adopt(ToNewUTF8String(mTitle));
GtkWindow *parent_widget =
GTK_WINDOW(mParentWidget->GetNativeData(NS_NATIVE_SHELLWIDGET));
GtkFileChooserAction action = GetGtkFileChooserAction(mMode);
@@ -603,8 +623,235 @@ nsFilePicker::Done(GtkWidget* file_choos
if (mCallback) {
mCallback->Done(result);
@ -3512,13 +3502,13 @@ diff --git a/widget/gtk/nsFilePicker.h b/widget/gtk/nsFilePicker.h
+++ b/widget/gtk/nsFilePicker.h
@@ -69,14 +69,20 @@ protected:
nsString mDefaultExtension;
nsTArray<nsCString> mFilters;
nsTArray<nsCString> mFilterNames;
private:
static nsIFile *mPrevDisplayDirectory;
+ bool kdeRunning();
+ bool getKdeRunning();
+ NS_IMETHODIMP kdeFileDialog(PRInt16 *aReturn);
@ -3529,30 +3519,30 @@ diff --git a/widget/gtk/nsFilePicker.h b/widget/gtk/nsFilePicker.h
GtkFileChooserWidget *mFileChooserDelegate;
#endif
};
#endif
diff --git a/xpcom/components/ManifestParser.cpp b/xpcom/components/ManifestParser.cpp
--- a/xpcom/components/ManifestParser.cpp
+++ b/xpcom/components/ManifestParser.cpp
@@ -35,16 +35,17 @@
@@ -32,16 +32,17 @@
#include "nsTextFormatter.h"
#include "nsVersionComparator.h"
#include "nsXPCOMCIDInternal.h"
#include "nsIConsoleService.h"
#include "nsIScriptError.h"
#include "nsIXULAppInfo.h"
#include "nsIXULRuntime.h"
#ifdef MOZ_B2G_LOADER
#include "mozilla/XPTInterfaceInfoManager.h"
#endif
+#include "nsKDEUtils.h"
#ifdef MOZ_B2G_LOADER
#define XPTONLY_MANIFEST &nsComponentManagerImpl::XPTOnlyManifestManifest
#define XPTONLY_XPT &nsComponentManagerImpl::XPTOnlyManifestXPT
#else
#define XPTONLY_MANIFEST nullptr
#define XPTONLY_XPT nullptr
#endif
@@ -494,16 +495,17 @@ ParseManifest(NSLocationType aType, File
using namespace mozilla;
struct ManifestDirective
{
const char* directive;
int argc;
@@ -472,16 +473,17 @@ ParseManifest(NSLocationType aType, File
NS_NAMED_LITERAL_STRING(kRemoteEnabled, "remoteenabled");
NS_NAMED_LITERAL_STRING(kRemoteRequired, "remoterequired");
NS_NAMED_LITERAL_STRING(kApplication, "application");
@ -3566,18 +3556,18 @@ diff --git a/xpcom/components/ManifestParser.cpp b/xpcom/components/ManifestPars
#if defined(MOZ_WIDGET_ANDROID)
NS_NAMED_LITERAL_STRING(kTablet, "tablet");
#endif
NS_NAMED_LITERAL_STRING(kMain, "main");
NS_NAMED_LITERAL_STRING(kContent, "content");
@@ -554,44 +556,49 @@ ParseManifest(NSLocationType aType, File
@@ -532,44 +534,49 @@ ParseManifest(NSLocationType aType, File
CopyUTF8toUTF16(s, abi);
abi.Insert(char16_t('_'), 0);
abi.Insert(osTarget, 0);
}
}
}
nsAutoString osVersion;
+ nsAutoString desktop;
#if defined(XP_WIN)
@ -3613,14 +3603,14 @@ diff --git a/xpcom/components/ManifestParser.cpp b/xpcom/components/ManifestPars
}
+ desktop = NS_LITERAL_STRING("android");
#endif
if (XRE_IsContentProcess()) {
process = kContent;
} else {
process = kMain;
}
@@ -694,25 +701,27 @@ ParseManifest(NSLocationType aType, File
@@ -672,25 +679,27 @@ ParseManifest(NSLocationType aType, File
TriState stOsVersion = eUnspecified;
TriState stOs = eUnspecified;
TriState stABI = eUnspecified;
@ -3630,12 +3620,12 @@ diff --git a/xpcom/components/ManifestParser.cpp b/xpcom/components/ManifestPars
#endif
int flags = 0;
+ TriState stDesktop = eUnspecified;
while ((token = nsCRT::strtok(whitespace, kWhitespace, &whitespace)) &&
ok) {
ToLowerCase(token);
NS_ConvertASCIItoUTF16 wtoken(token);
if (CheckStringFlag(kApplication, wtoken, appID, stApp) ||
CheckStringFlag(kOs, wtoken, osTarget, stOs) ||
CheckStringFlag(kABI, wtoken, abi, stABI) ||
@ -3646,11 +3636,11 @@ diff --git a/xpcom/components/ManifestParser.cpp b/xpcom/components/ManifestPars
CheckVersionFlag(kGeckoVersion, wtoken, geckoVersion, stGeckoVersion)) {
continue;
}
#if defined(MOZ_WIDGET_ANDROID)
@@ -762,16 +771,17 @@ ParseManifest(NSLocationType aType, File
@@ -740,16 +749,17 @@ ParseManifest(NSLocationType aType, File
}
if (!ok ||
stApp == eBad ||
stAppVersion == eBad ||
@ -3665,7 +3655,7 @@ diff --git a/xpcom/components/ManifestParser.cpp b/xpcom/components/ManifestPars
stProcess == eBad) {
continue;
}
diff --git a/xpcom/components/moz.build b/xpcom/components/moz.build
--- a/xpcom/components/moz.build
+++ b/xpcom/components/moz.build
@ -3680,7 +3670,7 @@ diff --git a/xpcom/components/moz.build b/xpcom/components/moz.build
'/modules/libjar',
+ '/toolkit/xre'
]
if 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT']:
CXXFLAGS += CONFIG['TK_CFLAGS']
diff --git a/xpcom/io/nsLocalFileUnix.cpp b/xpcom/io/nsLocalFileUnix.cpp
@ -3692,23 +3682,23 @@ diff --git a/xpcom/io/nsLocalFileUnix.cpp b/xpcom/io/nsLocalFileUnix.cpp
#include "nsISimpleEnumerator.h"
#include "private/pprio.h"
#include "prlink.h"
#ifdef MOZ_WIDGET_GTK
#include "nsIGIOService.h"
+#include "nsKDEUtils.h"
#endif
#ifdef MOZ_WIDGET_COCOA
#include <Carbon/Carbon.h>
#include "CocoaFileUtils.h"
#include "prmem.h"
#include "plbase64.h"
@@ -1948,42 +1949,52 @@ nsLocalFile::SetPersistentDescriptor(con
return InitWithNativePath(aPersistentDescriptor);
#endif
}
NS_IMETHODIMP
nsLocalFile::Reveal()
{
@ -3718,12 +3708,12 @@ diff --git a/xpcom/io/nsLocalFileUnix.cpp b/xpcom/io/nsLocalFileUnix.cpp
- return NS_ERROR_FAILURE;
- }
+ nsAutoCString url;
bool isDirectory;
if (NS_FAILED(IsDirectory(&isDirectory))) {
return NS_ERROR_FAILURE;
}
+ nsCOMPtr<nsIGIOService> giovfs = do_GetService(NS_GIOSERVICE_CONTRACTID);
if (isDirectory) {
- return giovfs->ShowURIForInput(mPath);
@ -3739,7 +3729,7 @@ diff --git a/xpcom/io/nsLocalFileUnix.cpp b/xpcom/io/nsLocalFileUnix.cpp
if (NS_FAILED(parentDir->GetNativePath(dirPath))) {
return NS_ERROR_FAILURE;
}
- return giovfs->ShowURIForInput(dirPath);
+ url = dirPath;
}
@ -3767,7 +3757,7 @@ diff --git a/xpcom/io/nsLocalFileUnix.cpp b/xpcom/io/nsLocalFileUnix.cpp
return NS_ERROR_FAILURE;
#endif
}
NS_IMETHODIMP
nsLocalFile::Launch()
{
@ -3782,7 +3772,7 @@ diff --git a/xpcom/io/nsLocalFileUnix.cpp b/xpcom/io/nsLocalFileUnix.cpp
if (!giovfs) {
return NS_ERROR_FAILURE;
}
return giovfs->ShowURIForInput(mPath);
#elif defined(MOZ_ENABLE_CONTENTACTION)
QUrl uri = QUrl::fromLocalFile(QString::fromUtf8(mPath.get()));