diff options
Diffstat (limited to 'chrome/common/chrome_version_info.h')
-rw-r--r-- | chrome/common/chrome_version_info.h | 33 |
1 files changed, 30 insertions, 3 deletions
diff --git a/chrome/common/chrome_version_info.h b/chrome/common/chrome_version_info.h index 6d509ca..21ad32fe 100644 --- a/chrome/common/chrome_version_info.h +++ b/chrome/common/chrome_version_info.h @@ -19,6 +19,15 @@ namespace chrome { // current running build of Chrome. class VersionInfo { public: + // The possible channels for an installation, from most fun to most stable. + enum Channel { + CHANNEL_UNKNOWN = 0, // Probably blue + CHANNEL_CANARY, // Yellow + CHANNEL_DEV, // Technicolor + CHANNEL_BETA, // Rainbow + CHANNEL_STABLE // Full-spectrum + }; + VersionInfo(); ~VersionInfo(); @@ -37,14 +46,32 @@ class VersionInfo { // The SVN revision of this release. E.g. "55800". std::string LastChange() const; - // OS type. E.g. "Windows", "Linux", "FreeBSD", ... - std::string OSType() const; - // Whether this is an "official" release of the current Version(): // whether knowing Version() is enough to completely determine what // LastChange() is. bool IsOfficialBuild() const; + // OS type. E.g. "Windows", "Linux", "FreeBSD", ... + std::string OSType() const; + + // Returns a human-readable modifier for the version string. For a branded + // build, this modifier is the channel ("canary", "dev", or "beta", but "" + // for stable). On Windows, this may be modified with additional information + // after a hyphen. For multi-user installations, it will return "canary-m", + // "dev-m", "beta-m", and for a stable channel multi-user installation, "m". + // In branded builds, when the channel cannot be determined, "unknown" will + // be returned. In unbranded builds, the modifier is usually an empty string + // (""), although on Linux, it may vary in certain distributions. + // GetVersionStringModifier() is intended to be used for display purposes. + // To simply test the channel, use GetChannel(). + static std::string GetVersionStringModifier(); + + // Returns the channel for the installation. In branded builds, this will be + // CHANNEL_STABLE, CHANNEL_BETA, CHANNEL_DEV, or CHANNEL_CANARY. In unbranded + // builds, or in branded builds when the channel cannot be determined, this + // will be CHANNEL_UNKNOWN. + static Channel GetChannel(); + private: #if defined(OS_WIN) || defined(OS_MACOSX) scoped_ptr<FileVersionInfo> version_info_; |