Bug 141090 - New profiles do not display current theme w/ check flag

patch by jerry.tan@sun.com r=me sr=bryner


git-svn-id: svn://10.0.0.236/trunk@155450 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
bsmedberg%covad.net
2004-04-24 17:05:23 +00:00
parent 35624cc5bd
commit 97a95c2fa7
4 changed files with 23 additions and 2 deletions

View File

@@ -1731,6 +1731,12 @@ NS_IMETHODIMP nsChromeRegistry::SelectLocaleForProfile(const nsACString& aLocale
return SetProvider(NS_LITERAL_CSTRING("locale"), mSelectedLocale, aLocale, PR_TRUE, NS_ConvertUCS2toUTF8(aProfilePath).get(), PR_TRUE);
}
NS_IMETHODIMP nsChromeRegistry::SelectSkinForProfile(const nsACString& aSkin,
const PRUnichar *aProfilePath)
{
return SetProvider(NS_LITERAL_CSTRING("skin"), mSelectedSkin, aSkin, PR_TRUE, NS_ConvertUCS2toUTF8(aProfilePath).get(), PR_TRUE);
}
/* void setRuntimeProvider (in boolean runtimeProvider); */
// should we inline this one?
NS_IMETHODIMP nsChromeRegistry::SetRuntimeProvider(PRBool runtimeProvider)

View File

@@ -85,7 +85,7 @@ interface nsIChromeRegistry : nsISupports
void checkForNewChrome();
};
[scriptable, uuid(a9f92623-5982-4afe-9d90-619cf5b0c39f)]
[scriptable, uuid(fd1ee2f8-0238-40b0-9b54-27cf810d9c86)]
interface nsIXULChromeRegistry : nsIChromeRegistry {
/* Applies a skin or locale to all possible packages */
@@ -96,8 +96,9 @@ interface nsIXULChromeRegistry : nsIChromeRegistry {
PRInt32 isSkinSelected(in ACString skinName, in boolean useProfile);
PRInt32 isLocaleSelected(in ACString localeName, in boolean useProfile);
// Special additional APIs for locales only.
//Special additional APIs for locales and skin.
void selectLocaleForProfile(in ACString localeName, in wstring profilePath);
void selectSkinForProfile(in ACString skinName, in wstring profilePath);
/* Should be called when locales change to reload all chrome (including XUL). */
void reloadChrome();

View File

@@ -1731,6 +1731,14 @@ nsProfile::CreateNewProfileWithLocales(const PRUnichar* profileName,
}
}
//need to set skin info here
nsCAutoString currentSkinName;
rv = packageRegistry->GetSelectedSkin(NS_LITERAL_CSTRING("global"),currentSkinName);
if (!currentSkinName.IsEmpty()) {
rv = chromeRegistry->SelectSkinForProfile(currentSkinName,
NS_ConvertUTF8toUCS2(fileStr).get());
}
if (!contentLocale.IsEmpty()) {
// caller prefers locale subdir
nsCOMPtr<nsIFile> locProfDefaultsDir;

View File

@@ -1731,6 +1731,12 @@ NS_IMETHODIMP nsChromeRegistry::SelectLocaleForProfile(const nsACString& aLocale
return SetProvider(NS_LITERAL_CSTRING("locale"), mSelectedLocale, aLocale, PR_TRUE, NS_ConvertUCS2toUTF8(aProfilePath).get(), PR_TRUE);
}
NS_IMETHODIMP nsChromeRegistry::SelectSkinForProfile(const nsACString& aSkin,
const PRUnichar *aProfilePath)
{
return SetProvider(NS_LITERAL_CSTRING("skin"), mSelectedSkin, aSkin, PR_TRUE, NS_ConvertUCS2toUTF8(aProfilePath).get(), PR_TRUE);
}
/* void setRuntimeProvider (in boolean runtimeProvider); */
// should we inline this one?
NS_IMETHODIMP nsChromeRegistry::SetRuntimeProvider(PRBool runtimeProvider)