1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "chrome/common/chrome_version_info.h"
7 #include "build/build_config.h"
12 std::string
VersionInfo::GetVersionStringModifier() {
13 char* env
= getenv("CHROME_VERSION_EXTRA");
16 #if defined(USE_AURA) && defined(OS_LINUX) && !defined(OS_CHROMEOS)
21 std::string
modifier(env
);
23 #if defined(GOOGLE_CHROME_BUILD)
24 // Only ever return "", "unknown", "dev" or "beta" in a branded build.
25 if (modifier
== "unstable") // linux version of "dev"
27 if (modifier
== "stable") {
29 } else if ((modifier
== "dev") || (modifier
== "beta")) {
36 #if defined(USE_AURA) && defined(OS_LINUX) && !defined(OS_CHROMEOS)
44 VersionInfo::Channel
VersionInfo::GetChannel() {
45 #if defined(GOOGLE_CHROME_BUILD)
46 std::string channel
= GetVersionStringModifier();
47 if (channel
.empty()) {
48 return CHANNEL_STABLE
;
49 } else if (channel
== "beta") {
51 } else if (channel
== "dev") {
53 } else if (channel
== "canary") {
54 return CHANNEL_CANARY
;
58 return CHANNEL_UNKNOWN
;