diff --git a/mozilla/xpfe/components/prefwindow/resources/content/pref-winhooks.js b/mozilla/xpfe/components/prefwindow/resources/content/pref-winhooks.js index 4fc00dd69b1..edad680b177 100644 --- a/mozilla/xpfe/components/prefwindow/resources/content/pref-winhooks.js +++ b/mozilla/xpfe/components/prefwindow/resources/content/pref-winhooks.js @@ -43,6 +43,7 @@ if ( !( "winHooks" in parent ) ) { "isHandlingBMP", "isHandlingICO", "isHandlingXML", + "isHandlingXHTML", "isHandlingXUL", "isHandlingHTTP", "isHandlingHTTPS", diff --git a/mozilla/xpfe/components/prefwindow/resources/content/pref-winhooks.xul b/mozilla/xpfe/components/prefwindow/resources/content/pref-winhooks.xul index 712b3290f11..433e5279844 100644 --- a/mozilla/xpfe/components/prefwindow/resources/content/pref-winhooks.xul +++ b/mozilla/xpfe/components/prefwindow/resources/content/pref-winhooks.xul @@ -99,6 +99,13 @@ + + + + + + + diff --git a/mozilla/xpfe/components/prefwindow/resources/locale/en-US/pref-winhooks.dtd b/mozilla/xpfe/components/prefwindow/resources/locale/en-US/pref-winhooks.dtd index cf6a778907d..d68b5dbb71c 100644 --- a/mozilla/xpfe/components/prefwindow/resources/locale/en-US/pref-winhooks.dtd +++ b/mozilla/xpfe/components/prefwindow/resources/locale/en-US/pref-winhooks.dtd @@ -3,26 +3,28 @@ - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + diff --git a/mozilla/xpfe/components/winhooks/nsIWindowsHooks.idl b/mozilla/xpfe/components/winhooks/nsIWindowsHooks.idl index 616e725faee..f44beb9783b 100644 --- a/mozilla/xpfe/components/winhooks/nsIWindowsHooks.idl +++ b/mozilla/xpfe/components/winhooks/nsIWindowsHooks.idl @@ -135,6 +135,7 @@ interface nsIWindowsHooksSettings : nsISupports { attribute boolean isHandlingBMP; attribute boolean isHandlingICO; attribute boolean isHandlingXML; + attribute boolean isHandlingXHTML; attribute boolean isHandlingXUL; // Nag dialog flag. Set this so that dialog diff --git a/mozilla/xpfe/components/winhooks/nsWindowsHooks.cpp b/mozilla/xpfe/components/winhooks/nsWindowsHooks.cpp index b159d1562ed..17f78fb9449 100644 --- a/mozilla/xpfe/components/winhooks/nsWindowsHooks.cpp +++ b/mozilla/xpfe/components/winhooks/nsWindowsHooks.cpp @@ -69,25 +69,27 @@ static ProtocolRegistryEntry ftp( "ftp" ), chrome( "chrome" ), gopher( "gopher" ); -const char *jpgExts[] = { ".jpg", ".jpeg", 0 }; -const char *gifExts[] = { ".gif", 0 }; -const char *pngExts[] = { ".png", 0 }; -const char *mngExts[] = { ".mng", 0 }; -const char *bmpExts[] = { ".bmp", 0 }; -const char *icoExts[] = { ".ico", 0 }; -const char *xmlExts[] = { ".xml", 0 }; -const char *xulExts[] = { ".xul", 0 }; -const char *htmExts[] = { ".htm", ".html", ".shtml", 0 }; +const char *jpgExts[] = { ".jpg", ".jpeg", 0 }; +const char *gifExts[] = { ".gif", 0 }; +const char *pngExts[] = { ".png", 0 }; +const char *mngExts[] = { ".mng", 0 }; +const char *bmpExts[] = { ".bmp", 0 }; +const char *icoExts[] = { ".ico", 0 }; +const char *xmlExts[] = { ".xml", 0 }; +const char *xhtmExts[] = { ".xht", ".xhtml", 0 }; +const char *xulExts[] = { ".xul", 0 }; +const char *htmExts[] = { ".htm", ".html", ".shtml", 0 }; static FileTypeRegistryEntry - jpg( jpgExts, "MozillaJPEG", "Mozilla Joint Photographic Experts Group Image File" ), - gif( gifExts, "MozillaGIF", "Mozilla Graphics Interchange Format Image File" ), - png( pngExts, "MozillaPNG", "Mozilla Portable Network Graphic Image File" ), - mng( mngExts, "MozillaMNG", "Mozilla Multiple-Image Network Graphic Image File" ), - bmp( bmpExts, "MozillaBMP", "Mozilla Bitmap Image File" ), - ico( icoExts, "MozillaICO", "Mozilla Icon File" ), - xml( xmlExts, "MozillaXML", "Mozilla XML File Document" ), - xul( xulExts, "MozillaXUL", "Mozilla XUL File Document" ); + jpg( jpgExts, "MozillaJPEG", "Mozilla Joint Photographic Experts Group Image File" ), + gif( gifExts, "MozillaGIF", "Mozilla Graphics Interchange Format Image File" ), + png( pngExts, "MozillaPNG", "Mozilla Portable Network Graphic Image File" ), + mng( mngExts, "MozillaMNG", "Mozilla Multiple-Image Network Graphic Image File" ), + bmp( bmpExts, "MozillaBMP", "Mozilla Bitmap Image File" ), + ico( icoExts, "MozillaICO", "Mozilla Icon File" ), + xml( xmlExts, "MozillaXML", "Mozilla XML File Document" ), + xhtml( xhtmExts, "MozillaXHTML", "Mozilla XHTML File Document" ), + xul( xulExts, "MozillaXUL", "Mozilla XUL File Document" ); static EditableFileTypeRegistryEntry mozillaMarkup( htmExts, "MozillaHTML", "Mozilla HyperText Markup Language Document" ); @@ -140,6 +142,7 @@ DEFINE_GETTER_AND_SETTER( IsHandlingMNG, mHandleMNG ) DEFINE_GETTER_AND_SETTER( IsHandlingBMP, mHandleBMP ) DEFINE_GETTER_AND_SETTER( IsHandlingICO, mHandleICO ) DEFINE_GETTER_AND_SETTER( IsHandlingXML, mHandleXML ) +DEFINE_GETTER_AND_SETTER( IsHandlingXHTML, mHandleXHTML ) DEFINE_GETTER_AND_SETTER( IsHandlingXUL, mHandleXUL ) DEFINE_GETTER_AND_SETTER( IsHandlingHTTP, mHandleHTTP ) DEFINE_GETTER_AND_SETTER( IsHandlingHTTPS, mHandleHTTPS ) @@ -190,6 +193,7 @@ nsWindowsHooks::GetSettings( nsWindowsHooksSettings **result ) { prefs->mHandleBMP = (void*)( BoolRegistryEntry( "isHandlingBMP" ) ) ? PR_TRUE : PR_FALSE; prefs->mHandleICO = (void*)( BoolRegistryEntry( "isHandlingICO" ) ) ? PR_TRUE : PR_FALSE; prefs->mHandleXML = (void*)( BoolRegistryEntry( "isHandlingXML" ) ) ? PR_TRUE : PR_FALSE; + prefs->mHandleXHTML = (void*)( BoolRegistryEntry( "isHandlingXHTML" ) ) ? PR_TRUE : PR_FALSE; prefs->mHandleXUL = (void*)( BoolRegistryEntry( "isHandlingXUL" ) ) ? PR_TRUE : PR_FALSE; prefs->mShowDialog = (void*)( BoolRegistryEntry( "showDialog" ) ) ? PR_TRUE : PR_FALSE; prefs->mHaveBeenSet = (void*)( BoolRegistryEntry( "haveBeenSet" ) ) ? PR_TRUE : PR_FALSE; @@ -311,6 +315,7 @@ nsWindowsHooks::CheckSettings( nsIDOMWindowInternal *aParent, settings->mHandleBMP = PR_TRUE; settings->mHandleICO = PR_TRUE; settings->mHandleXML = PR_TRUE; + settings->mHandleXHTML = PR_TRUE; settings->mHandleXUL = PR_TRUE; settings->mShowDialog = PR_TRUE; @@ -361,7 +366,9 @@ nsWindowsHooks::CheckSettings( nsIDOMWindowInternal *aParent, || misMatch( settings->mHandleXML, xml ) || - misMatch( settings->mHandleXUL, xul ) ) { + misMatch( settings->mHandleXHTML, xhtml ) + || + misMatch( settings->mHandleXUL, xul )) { // Need to prompt user. // First: // o We need the common dialog service to show the dialog. @@ -521,6 +528,7 @@ nsWindowsHooks::SetSettings(nsIWindowsHooksSettings *prefs) { putPRBoolIntoRegistry( "isHandlingBMP", prefs, &nsIWindowsHooksSettings::GetIsHandlingBMP ); putPRBoolIntoRegistry( "isHandlingICO", prefs, &nsIWindowsHooksSettings::GetIsHandlingICO ); putPRBoolIntoRegistry( "isHandlingXML", prefs, &nsIWindowsHooksSettings::GetIsHandlingXML ); + putPRBoolIntoRegistry( "isHandlingXHTML", prefs, &nsIWindowsHooksSettings::GetIsHandlingXHTML ); putPRBoolIntoRegistry( "isHandlingXUL", prefs, &nsIWindowsHooksSettings::GetIsHandlingXUL ); putPRBoolIntoRegistry( "showDialog", prefs, &nsIWindowsHooksSettings::GetShowDialog ); @@ -583,6 +591,11 @@ nsWindowsHooks::SetRegistry() { } else { (void) xml.reset(); } + if ( prefs->mHandleXHTML ) { + (void) xhtml.set(); + } else { + (void) xhtml.reset(); + } if ( prefs->mHandleXUL ) { (void) xul.set(); } else { diff --git a/mozilla/xpfe/components/winhooks/nsWindowsHooks.h b/mozilla/xpfe/components/winhooks/nsWindowsHooks.h index 10196816eba..853e68644a2 100644 --- a/mozilla/xpfe/components/winhooks/nsWindowsHooks.h +++ b/mozilla/xpfe/components/winhooks/nsWindowsHooks.h @@ -87,6 +87,7 @@ private: PRBool mHandleBMP; PRBool mHandleICO; PRBool mHandleXML; + PRBool mHandleXHTML; PRBool mHandleXUL; }; struct {