diff --git a/mozilla/Makefile.in b/mozilla/Makefile.in
index ebfffce9607..2bc23a42c10 100644
--- a/mozilla/Makefile.in
+++ b/mozilla/Makefile.in
@@ -238,6 +238,10 @@ ifndef MOZ_XUL
tier_9_dirs += embedding/minimo/chromelite
endif
+ifdef MOZ_ENABLE_GTK2
+tier_9_dirs += toolkit/components/gnome
+endif
+
#
# tier 40 - security
#
diff --git a/mozilla/allmakefiles.sh b/mozilla/allmakefiles.sh
index fb75b9e4f90..65bb27d8993 100755
--- a/mozilla/allmakefiles.sh
+++ b/mozilla/allmakefiles.sh
@@ -1080,6 +1080,12 @@ if [ ! "$SYSTEM_PNG" ]; then
MAKEFILES_libimg="$MAKEFILES_libimg modules/libimg/png/Makefile"
fi
+MAKEFILES_gnome="
+ toolkit/Makefile
+ toolkit/components/Makefile
+ toolkit/components/gnome/Makefile
+"
+
#
# l10n/
#
@@ -1478,6 +1484,10 @@ if test -z "$MOZ_XUL"; then
add_makefiles "$MAKEFILES_minimo"
fi
+if test -n "$MOZ_ENABLE_GTK2"; then
+ add_makefiles "$MAKEFILES_gnome"
+fi
+
else
# Standalone modules go here
diff --git a/mozilla/browser/app/Makefile.in b/mozilla/browser/app/Makefile.in
index 33dc72b6782..f95765699e2 100644
--- a/mozilla/browser/app/Makefile.in
+++ b/mozilla/browser/app/Makefile.in
@@ -213,9 +213,8 @@ ifneq (,$(filter-out OS2 WINNT,$(OS_ARCH)))
firefox:: mozilla.in Makefile.in Makefile $(DEPTH)/config/autoconf.mk
cat $< | sed -e "s|%MOZAPPDIR%|$(mozappdir)|" \
- -e "s|%MOZ_USER_DIR%|.firefox|" \
- -e "s|%MREDIR%|$(mredir)|" \
- -e "s|%MOZILLA-BIN%|$(PROGRAM)|g" > $@
+ -e "s|%MOZ_USER_DIR%|.mozilla/firefox|" \
+ -e "s|%MREDIR%|$(mredir)|" > $@
chmod +x $@
libs:: firefox
@@ -234,6 +233,7 @@ ifneq (,$(filter gtk gtk2,$(MOZ_WIDGET_TOOLKIT)))
ICON_FILES = \
$(DIST)/branding/mozicon50.xpm \
$(DIST)/branding/mozicon16.xpm \
+ $(DIST)/branding/document.png \
$(NULL)
libs:: $(ICON_FILES)
@@ -268,6 +268,7 @@ endif
ifneq (,$(filter gtk gtk2,$(MOZ_WIDGET_TOOLKIT)))
cp $(srcdir)/mozicon16.xpm $(DIST)/branding/mozicon16.xpm
cp $(srcdir)/mozicon50.xpm $(DIST)/branding/mozicon50.xpm
+ cp $(srcdir)/document.png $(DIST)/branding/document.png
endif
ifeq ($(MOZ_WIDGET_TOOLKIT),gtk2)
cp $(srcdir)/default.xpm $(DIST)/branding/default.xpm
diff --git a/mozilla/browser/app/document.png b/mozilla/browser/app/document.png
new file mode 100644
index 00000000000..be4a022e668
Binary files /dev/null and b/mozilla/browser/app/document.png differ
diff --git a/mozilla/browser/base/Makefile.in b/mozilla/browser/base/Makefile.in
index 8e02e041182..8f94eb6df4a 100644
--- a/mozilla/browser/base/Makefile.in
+++ b/mozilla/browser/base/Makefile.in
@@ -29,3 +29,7 @@ include $(DEPTH)/config/autoconf.mk
include $(topsrcdir)/config/config.mk
include $(topsrcdir)/config/rules.mk
+
+ifneq (,$(filter windows gtk2, $(MOZ_WIDGET_TOOLKIT)))
+DEFINES += -DHAVE_SHELL_SERVICE=1
+endif
diff --git a/mozilla/browser/base/content/browser-sets.inc b/mozilla/browser/base/content/browser-sets.inc
index fcb73da9a80..2dc32d37951 100644
--- a/mozilla/browser/base/content/browser-sets.inc
+++ b/mozilla/browser/base/content/browser-sets.inc
@@ -81,7 +81,7 @@
-#ifdef XP_WIN
+#ifdef HAVE_SHELL_SERVICE
#endif
diff --git a/mozilla/browser/base/content/browser.js b/mozilla/browser/base/content/browser.js
index b494d959672..0b23e25dd9f 100644
--- a/mozilla/browser/base/content/browser.js
+++ b/mozilla/browser/base/content/browser.js
@@ -1149,31 +1149,35 @@ function delayedStartup()
gQuickFindTimeoutLength = gPrefService.getIntPref("accessibility.typeaheadfind.timeout");
-#ifdef XP_WIN
+#ifdef HAVE_SHELL_SERVICE
// Perform default browser checking (after window opens).
- var shell = Components.classes["@mozilla.org/browser/shell-service;1"]
- .getService(Components.interfaces.nsIShellService);
- var shouldCheck = shell.shouldCheckDefaultBrowser;
- if (shouldCheck && !shell.isDefaultBrowser(true)) {
- var brandBundle = document.getElementById("bundle_brand");
- var shellBundle = document.getElementById("bundle_shell");
-
- var brandShortName = brandBundle.getString("brandShortName");
- var promptTitle = shellBundle.getString("setDefaultBrowserTitle");
- var promptMessage = shellBundle.getFormattedString("setDefaultBrowserMessage",
- [brandShortName]);
- var checkboxLabel = shellBundle.getString("setDefaultBrowserDontAsk");
- const IPS = Components.interfaces.nsIPromptService;
- var ps = Components.classes["@mozilla.org/embedcomp/prompt-service;1"]
- .getService(IPS);
- var checkEveryTime = { value: shouldCheck };
- var rv = ps.confirmEx(window, promptTitle, promptMessage,
- (IPS.BUTTON_TITLE_YES * IPS.BUTTON_POS_0) +
- (IPS.BUTTON_TITLE_NO * IPS.BUTTON_POS_1),
- null, null, null, checkboxLabel, checkEveryTime);
- if (rv == 0)
- shell.setDefaultBrowser(true, false);
- shell.shouldCheckDefaultBrowser = checkEveryTime.value;
+ var shell = getShellService();
+ if (shell) {
+ var shouldCheck = shell.shouldCheckDefaultBrowser;
+ if (shouldCheck && !shell.isDefaultBrowser(true)) {
+ var brandBundle = document.getElementById("bundle_brand");
+ var shellBundle = document.getElementById("bundle_shell");
+
+ var brandShortName = brandBundle.getString("brandShortName");
+ var promptTitle = shellBundle.getString("setDefaultBrowserTitle");
+ var promptMessage = shellBundle.getFormattedString("setDefaultBrowserMessage",
+ [brandShortName]);
+ var checkboxLabel = shellBundle.getString("setDefaultBrowserDontAsk");
+ const IPS = Components.interfaces.nsIPromptService;
+ var ps = Components.classes["@mozilla.org/embedcomp/prompt-service;1"]
+ .getService(IPS);
+ var checkEveryTime = { value: shouldCheck };
+ var rv = ps.confirmEx(window, promptTitle, promptMessage,
+ (IPS.BUTTON_TITLE_YES * IPS.BUTTON_POS_0) +
+ (IPS.BUTTON_TITLE_NO * IPS.BUTTON_POS_1),
+ null, null, null, checkboxLabel, checkEveryTime);
+ if (rv == 0)
+ shell.setDefaultBrowser(true, false);
+ shell.shouldCheckDefaultBrowser = checkEveryTime.value;
+ }
+ } else {
+ // We couldn't get the shell service; go hide the mail toolbar button.
+ document.getElementById("mail-button").hidden = true;
}
#endif
@@ -3678,11 +3682,17 @@ nsContextMenu.prototype = {
this.showItem( "context-viewinfo", !( this.inDirList || this.onImage || this.isTextSelected || this.onLink || this.onTextInput ) );
this.showItem( "context-sep-properties", !( this.inDirList || this.isTextSelected || this.onTextInput ) );
- // Set As Wallpaper depends on whether an image was clicked on, and only works on Windows.
- var isWin = navigator.appVersion.indexOf("Windows") != -1;
- this.showItem( "context-setWallpaper", isWin && this.onImage );
+ // Set As Wallpaper depends on whether an image was clicked on, and only works if we have a shell service.
+ var haveSetWallpaper = false;
+#ifdef HAVE_SHELL_SERVICE
+ // Only enable set as wallpaper if we can get the shell service.
+ var shell = getShellService();
+ if (shell)
+ haveSetWallpaper = true;
+#endif
+ this.showItem( "context-setWallpaper", haveSetWallpaper && this.onImage );
- if( isWin && this.onImage )
+ if( haveSetWallpaper && this.onImage )
// Disable the Set As Wallpaper menu item if we're still trying to load the image
this.setItemAttr( "context-setWallpaper", "disabled", (("complete" in this.target) && !this.target.complete) ? "true" : null );
@@ -5242,25 +5252,26 @@ var MailIntegration = {
var extProtocolSvc = Components.classes["@mozilla.org/uriloader/external-protocol-service;1"].getService(Components.interfaces.nsIExternalProtocolService);
if (extProtocolSvc)
extProtocolSvc.loadUrl(aURL);
-#ifdef XP_WIN
+#ifdef HAVE_SHELL_SERVICE
},
readMail: function ()
{
- const ss = Components.interfaces.nsIShellService;
- var shell = Components.classes["@mozilla.org/browser/shell-service;1"].getService(ss);
- shell.openPreferredApplication(ss.APPLICATION_MAIL);
+ var shell = getShellService();
+ if (shell)
+ shell.openPreferredApplication(Components.interfaces.nsIShellService.APPLICATION_MAIL);
},
readNews: function ()
{
- const ss = Components.interfaces.nsIShellService;
- var shell = Components.classes["@mozilla.org/browser/shell-service;1"].getService(Components.interfaces.nsIShellService);
- shell.openPreferredApplication(ss.APPLICATION_NEWS);
+ var shell = window.getShellService();
+ if (shell)
+ shell.openPreferredApplication(Components.interfaces.nsIShellService.APPLICATION_NEWS);
},
updateUnreadCount: function ()
{
+#ifdef XP_WIN
var shell = Components.classes["@mozilla.org/browser/shell-service;1"]
.getService(Components.interfaces.nsIWindowsShellService);
var unreadCount = shell.unreadMailCount;
@@ -5271,6 +5282,7 @@ var MailIntegration = {
message = gNavigatorBundle.getFormattedString("mailUnreadMenuitem", [unreadCount]);
element = document.getElementById("Browser:ReadMail");
element.setAttribute("label", message);
+#endif
}
#else
}
diff --git a/mozilla/browser/base/content/browser.xul b/mozilla/browser/base/content/browser.xul
index ed13504d2b8..4332c50f8cf 100644
--- a/mozilla/browser/base/content/browser.xul
+++ b/mozilla/browser/base/content/browser.xul
@@ -316,7 +316,7 @@
observes="viewHistorySidebar"
tooltiptext="&historyButton.tooltip;"/>
-#ifdef XP_WIN
+#ifdef HAVE_SHELL_SERVICE
+
+