Bug 1073536 - Allow checking if MOZILLA_OFFICIAL is set via nsIXULRuntime. r=ted
authorGeorg Fritzsche <georg.fritzsche@googlemail.com>
Fri, 10 Oct 2014 17:21:17 +0200
changeset 209862 89260f6357816b361ed2b6d3dc331638087fa9e2
parent 209861 b7f4185d9a8e05640c05e300f2d9c4f93c1826f2
child 209863 e4368578fe83b7ac0dd70ff600060c4ba3f075f9
push id27628
push userkwierso@gmail.com
push dateSat, 11 Oct 2014 02:00:16 +0000
treeherdermozilla-central@f74ad36bb97b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersted
bugs1073536
milestone35.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1073536 - Allow checking if MOZILLA_OFFICIAL is set via nsIXULRuntime. r=ted
toolkit/xre/nsAppRunner.cpp
xpcom/system/nsIXULRuntime.idl
--- a/toolkit/xre/nsAppRunner.cpp
+++ b/toolkit/xre/nsAppRunner.cpp
@@ -968,16 +968,27 @@ nsXULAppInfo::GetDefaultUpdateChannel(ns
 
 NS_IMETHODIMP
 nsXULAppInfo::GetDistributionID(nsACString& aResult)
 {
   aResult.AssignLiteral(MOZ_DISTRIBUTION_ID);
   return NS_OK;
 }
 
+NS_IMETHODIMP
+nsXULAppInfo::GetIsOfficial(bool* aResult)
+{
+#ifdef MOZILLA_OFFICIAL
+  *aResult = true;
+#else
+  *aResult = false;
+#endif
+  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.
 typedef enum 
 {
   VistaTokenElevationTypeDefault = 1,
   VistaTokenElevationTypeFull,
   VistaTokenElevationTypeLimited
--- a/xpcom/system/nsIXULRuntime.idl
+++ b/xpcom/system/nsIXULRuntime.idl
@@ -18,17 +18,17 @@ bool BrowserTabsRemoteAutostart();
 
 /**
  * Provides information about the XUL runtime.
  * @status UNSTABLE - This interface is not frozen and will probably change in
  *                    future releases. If you need this functionality to be
  *                    stable/frozen, please contact Benjamin Smedberg.
  */
 
-[scriptable, uuid(588831D6-7576-4CEA-B368-3AAB76CD9FCC)]
+[scriptable, uuid(15b0e6cf-83da-4672-814e-cfa0b06ba31b)]
 interface nsIXULRuntime : nsISupports
 {
   /**
    * Whether the application was launched in safe mode.
    */
   readonly attribute boolean inSafeMode;
 
   /**
@@ -146,9 +146,14 @@ interface nsIXULRuntime : nsISupports
    * The default update channel (MOZ_UPDATE_CHANNEL).
    */
   readonly attribute AUTF8String defaultUpdateChannel;
 
   /**
    * The distribution ID for this build (MOZ_DISTRIBUTION_ID).
    */
   readonly attribute AUTF8String distributionID;
+
+  /**
+   * True if this is an official build (MOZILLA_OFFICIAL).
+   */
+  readonly attribute boolean isOfficial;
 };