Bug 972555 - Add more things to nsIXULRuntime so we can avoid preprocessing some tests. r=bsmedberg

This commit is contained in:
Ted Mielczarek 2014-02-19 09:20:02 -05:00
Родитель ee87a8a0da
Коммит 60d3930af5
2 изменённых файлов: 57 добавлений и 1 удалений

Просмотреть файл

@ -866,6 +866,42 @@ nsXULAppInfo::GetLastRunCrashID(nsAString &aLastRunCrashID)
#endif
}
NS_IMETHODIMP
nsXULAppInfo::GetIsReleaseBuild(bool* aResult)
{
#ifdef RELEASE_BUILD
*aResult = true;
#else
*aResult = false;
#endif
return NS_OK;
}
NS_IMETHODIMP
nsXULAppInfo::GetIsOfficialBranding(bool* aResult)
{
#ifdef MOZ_OFFICIAL_BRANDING
*aResult = true;
#else
*aResult = false;
#endif
return NS_OK;
}
NS_IMETHODIMP
nsXULAppInfo::GetDefaultUpdateChannel(nsACString& aResult)
{
aResult.AssignLiteral(NS_STRINGIFY(MOZ_UPDATE_CHANNEL));
return NS_OK;
}
NS_IMETHODIMP
nsXULAppInfo::GetDistributionID(nsACString& aResult)
{
aResult.AssignLiteral(MOZ_DISTRIBUTION_ID);
return NS_OK;
}
#ifdef XP_WIN
// Matches the enum in WinNT.h for the Vista SDK but renamed so that we can
// safely build with the Vista SDK and without it.

Просмотреть файл

@ -20,7 +20,7 @@ bool BrowserTabsRemote();
* stable/frozen, please contact Benjamin Smedberg.
*/
[scriptable, uuid(33bd1630-611e-11e3-949a-0800200c9a66)]
[scriptable, uuid(ef6df588-f0bf-4e38-949e-9de838c228ea)]
interface nsIXULRuntime : nsISupports
{
/**
@ -110,4 +110,24 @@ interface nsIXULRuntime : nsISupports
* on the previous run. Can be passed directly to CrashSubmit.submit.
*/
readonly attribute DOMString lastRunCrashID;
/**
* True if this is a RELEASE_BUILD.
*/
readonly attribute boolean isReleaseBuild;
/**
* True if this build uses official branding (MOZ_OFFICIAL_BRANDING).
*/
readonly attribute boolean isOfficialBranding;
/**
* The default update channel (MOZ_UPDATE_CHANNEL).
*/
readonly attribute AUTF8String defaultUpdateChannel;
/**
* The distribution ID for this build (MOZ_DISTRIBUTION_ID).
*/
readonly attribute AUTF8String distributionID;
};