diff --git a/xpfe/components/prefwindow/resources/content/nsPrefWindow.js b/xpfe/components/prefwindow/resources/content/nsPrefWindow.js
index ff243dbc8fbc..fa342d202865 100644
--- a/xpfe/components/prefwindow/resources/content/nsPrefWindow.js
+++ b/xpfe/components/prefwindow/resources/content/nsPrefWindow.js
@@ -86,17 +86,16 @@ nsPrefWindow.prototype =
onOK:
function ()
{
- for( var i = 0; i < hPrefWindow.okHandlers.length; i++ )
- {
- hPrefWindow.okHandlers[i]();
- }
-
var tag = document.getElementById( hPrefWindow.contentFrame ).getAttribute("tag");
if( tag == "" )
{
tag = document.getElementById( hPrefWindow.contentFrame ).getAttribute("src");
}
hPrefWindow.wsm.savePageData( tag );
+ for( var i = 0; i < hPrefWindow.okHandlers.length; i++ )
+ {
+ hPrefWindow.okHandlers[i]();
+ }
hPrefWindow.savePrefs();
},
diff --git a/xpfe/components/prefwindow/resources/content/pref-navigator.xul b/xpfe/components/prefwindow/resources/content/pref-navigator.xul
index 2522095d48d8..59257f7e3118 100644
--- a/xpfe/components/prefwindow/resources/content/pref-navigator.xul
+++ b/xpfe/components/prefwindow/resources/content/pref-navigator.xul
@@ -23,6 +23,7 @@
+
@@ -43,16 +44,18 @@
]]>
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/xpfe/components/prefwindow/resources/content/pref-winhooks.js b/xpfe/components/prefwindow/resources/content/pref-winhooks.js
index edad680b1775..c2e5df04b393 100644
--- a/xpfe/components/prefwindow/resources/content/pref-winhooks.js
+++ b/xpfe/components/prefwindow/resources/content/pref-winhooks.js
@@ -35,23 +35,8 @@ function dumpObject( obj, name ) {
// Top-level windows integration preferences.
if ( !( "winHooks" in parent ) ) {
parent.winHooks = new Object;
- parent.winHooks.settings = [ "isHandlingHTML",
- "isHandlingJPEG",
- "isHandlingGIF",
- "isHandlingPNG",
- "isHandlingMNG",
- "isHandlingBMP",
- "isHandlingICO",
- "isHandlingXML",
- "isHandlingXHTML",
- "isHandlingXUL",
- "isHandlingHTTP",
- "isHandlingHTTPS",
- "isHandlingFTP",
- "isHandlingCHROME",
- "isHandlingGOPHER",
- "showDialog" ];
+ parent.winHooks.settings = null;
parent.winHooks.winhooks = null;
parent.winHooks.prefs = null;
}
@@ -104,14 +89,34 @@ function Startup() {
// Set globals.
parent.winHooks.winhooks = winhooks;
parent.winHooks.prefs = prefs;
- // Register so we get called when pref window Ok is pressed.
- parent.hPrefWindow.registerOKCallbackFunc( onOK );
}
}
catch(e) {
dump( e + "\n" );
}
}
+ if ( !settings ) {
+ // Set state specific to this panel (not shared with the "default browser"
+ // button state from the Navigator panel).
+ settings = parent.winHooks.settings = [ "isHandlingHTML",
+ "isHandlingJPEG",
+ "isHandlingGIF",
+ "isHandlingPNG",
+ "isHandlingMNG",
+ "isHandlingBMP",
+ "isHandlingICO",
+ "isHandlingXML",
+ "isHandlingXHTML",
+ "isHandlingXUL",
+ "isHandlingHTTP",
+ "isHandlingHTTPS",
+ "isHandlingFTP",
+ "isHandlingCHROME",
+ "isHandlingGOPHER",
+ "showDialog" ];
+ // Register so we get called when pref window Ok is pressed.
+ parent.hPrefWindow.registerOKCallbackFunc( onOK );
+ }
// Transfer object settings to the dialog checkboxes.
for( var index in settings ) {
var setting = settings[ index ];
diff --git a/xpfe/components/prefwindow/resources/content/win/platformPrefOverlay.xul b/xpfe/components/prefwindow/resources/content/win/platformPrefOverlay.xul
index 187ccecf8fbd..c47c233c94f1 100644
--- a/xpfe/components/prefwindow/resources/content/win/platformPrefOverlay.xul
+++ b/xpfe/components/prefwindow/resources/content/win/platformPrefOverlay.xul
@@ -21,9 +21,15 @@
Contributor(s):
Ben Goodger
+ Bill Law
-->
-
+
+%brandDTD;
+
+%platformPrefOverlayDTD;
+]>
@@ -36,6 +42,172 @@
+
+
+
+
+
+
+
+
+ &makeDefaultText;
+
+
+
+
+
+
+
+ &alreadyDefaultText;
+
+
+
+
+
+
+
+ &defaultPendingText;
+
+
+
+
+
+
+
+
+
+
diff --git a/xpfe/components/winhooks/nsIWindowsHooks.idl b/xpfe/components/winhooks/nsIWindowsHooks.idl
index c4f693cba0f6..81208481cdec 100644
--- a/xpfe/components/winhooks/nsIWindowsHooks.idl
+++ b/xpfe/components/winhooks/nsIWindowsHooks.idl
@@ -143,6 +143,12 @@ interface nsIWindowsHooksSettings : nsISupports {
// appears on startup if there is a mismatch
// between registry and these settings.
attribute boolean showDialog;
+
+ // Registry mismatch indicator.
+ // This is true if the Win32 registry is
+ // currently set to match the preferences
+ // in this object.
+ readonly attribute boolean registryMatches;
};
/* nsIWindowsHooks
diff --git a/xpfe/components/winhooks/nsWindowsHooks.cpp b/xpfe/components/winhooks/nsWindowsHooks.cpp
index caab669a640b..a4accf821122 100644
--- a/xpfe/components/winhooks/nsWindowsHooks.cpp
+++ b/xpfe/components/winhooks/nsWindowsHooks.cpp
@@ -291,6 +291,48 @@ static PRBool isAccessRestricted() {
+// Implementation of method that checks whether the settings match what's in the
+// Windows registry.
+NS_IMETHODIMP
+nsWindowsHooksSettings::GetRegistryMatches( PRBool *_retval ) {
+ NS_ENSURE_ARG( _retval );
+ *_retval = PR_TRUE;
+ // Test registry for all selected attributes.
+ if ( misMatch( mHandleHTTP, http )
+ ||
+ misMatch( mHandleHTTPS, https )
+ ||
+ misMatch( mHandleFTP, ftp )
+ ||
+ misMatch( mHandleCHROME, chrome )
+ ||
+ misMatch( mHandleGOPHER, gopher )
+ ||
+ misMatch( mHandleHTML, mozillaMarkup )
+ ||
+ misMatch( mHandleJPEG, jpg )
+ ||
+ misMatch( mHandleGIF, gif )
+ ||
+ misMatch( mHandlePNG, png )
+ ||
+ misMatch( mHandleMNG, mng )
+ ||
+ misMatch( mHandleBMP, bmp )
+ ||
+ misMatch( mHandleICO, ico )
+ ||
+ misMatch( mHandleXML, xml )
+ ||
+ misMatch( mHandleXHTML, xhtml )
+ ||
+ misMatch( mHandleXUL, xul ) ) {
+ // Registry is out of synch.
+ *_retval = PR_FALSE;
+ }
+ return NS_OK;
+}
+
// Implementation of method that checks settings versus registry and prompts user
// if out of synch.
NS_IMETHODIMP
@@ -357,35 +399,9 @@ nsWindowsHooks::CheckSettings( nsIDOMWindowInternal *aParent,
// First, make sure the user cares.
if ( settings->mShowDialog || installing ) {
// Look at registry setting for all things that are set.
- if ( misMatch( settings->mHandleHTTP, http )
- ||
- misMatch( settings->mHandleHTTPS, https )
- ||
- misMatch( settings->mHandleFTP, ftp )
- ||
- misMatch( settings->mHandleCHROME, chrome )
- ||
- misMatch( settings->mHandleGOPHER, gopher )
- ||
- misMatch( settings->mHandleHTML, mozillaMarkup )
- ||
- misMatch( settings->mHandleJPEG, jpg )
- ||
- misMatch( settings->mHandleGIF, gif )
- ||
- misMatch( settings->mHandlePNG, png )
- ||
- misMatch( settings->mHandleMNG, mng )
- ||
- misMatch( settings->mHandleBMP, bmp )
- ||
- misMatch( settings->mHandleICO, ico )
- ||
- misMatch( settings->mHandleXML, xml )
- ||
- misMatch( settings->mHandleXHTML, xhtml )
- ||
- misMatch( settings->mHandleXUL, xul )) {
+ PRBool matches = PR_TRUE;
+ settings->GetRegistryMatches( &matches );
+ if ( !matches ) {
// Need to prompt user.
// First:
// o We need the common dialog service to show the dialog.
diff --git a/xpfe/global/resources/content/nsWidgetStateManager.js b/xpfe/global/resources/content/nsWidgetStateManager.js
index b933e9cd3b5b..35f826de3cce 100644
--- a/xpfe/global/resources/content/nsWidgetStateManager.js
+++ b/xpfe/global/resources/content/nsWidgetStateManager.js
@@ -163,8 +163,12 @@ nsWidgetStateManager.prototype =
var pageData = this.dataManager.getPageData( aPageTag );
if( 'SetFields' in this.contentArea )
{
- this.contentArea.SetFields( pageData );
- return;
+ if ( !this.contentArea.SetFields( pageData ) )
+ {
+ // If the function returns false (or null/undefined) then it
+ // doesn't want *us* to process the page data.
+ return;
+ }
}
for( var elementID in pageData )