This source file includes following definitions.
- GetVersionStringModifier
- GetChannel
#include "chrome/common/chrome_version_info.h"
#include "base/strings/string_util.h"
#include "build/build_config.h"
namespace chrome {
std::string VersionInfo::GetVersionStringModifier() {
char* env = getenv("CHROME_VERSION_EXTRA");
if (!env) {
std::string modifier;
#if defined(USE_AURA) && defined(OS_LINUX) && !defined(OS_CHROMEOS)
modifier = "aura";
#endif
return modifier;
}
std::string modifier(env);
#if defined(GOOGLE_CHROME_BUILD)
if (modifier == "unstable")
modifier = "dev";
if (modifier == "stable") {
modifier = "";
} else if ((modifier == "dev") || (modifier == "beta")) {
} else {
modifier = "unknown";
}
#endif
#if defined(USE_AURA) && defined(OS_LINUX) && !defined(OS_CHROMEOS)
modifier += " aura";
#endif
return modifier;
}
VersionInfo::Channel VersionInfo::GetChannel() {
#if defined(GOOGLE_CHROME_BUILD)
std::string channel = GetVersionStringModifier();
if (channel.empty()) {
return CHANNEL_STABLE;
} else if (StartsWithASCII(channel, "beta ", true)) {
return CHANNEL_BETA;
} else if (StartsWithASCII(channel, "dev ", true)) {
return CHANNEL_DEV;
} else if (StartsWithASCII(channel, "canary ", true)) {
return CHANNEL_CANARY;
}
#endif
return CHANNEL_UNKNOWN;
}
}