Revert 248827 "android: Migrate old content readback to use asyn..."
[chromium-blink-merge.git] / chrome / common / chrome_version_info_posix.cc
blobebf67a0faa7abc6ff4c5399563ad07b56d3c99d5
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"
9 namespace chrome {
11 // static
12 std::string VersionInfo::GetVersionStringModifier() {
13 char* env = getenv("CHROME_VERSION_EXTRA");
14 if (!env) {
15 std::string modifier;
16 #if defined(USE_AURA) && defined(OS_LINUX) && !defined(OS_CHROMEOS)
17 modifier = "aura";
18 #endif
19 return modifier;
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"
26 modifier = "dev";
27 if (modifier == "stable") {
28 modifier = "";
29 } else if ((modifier == "dev") || (modifier == "beta")) {
30 // do nothing.
31 } else {
32 modifier = "unknown";
34 #endif
36 #if defined(USE_AURA) && defined(OS_LINUX) && !defined(OS_CHROMEOS)
37 modifier += " aura";
38 #endif
40 return modifier;
43 // static
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") {
50 return CHANNEL_BETA;
51 } else if (channel == "dev") {
52 return CHANNEL_DEV;
53 } else if (channel == "canary") {
54 return CHANNEL_CANARY;
56 #endif
58 return CHANNEL_UNKNOWN;
61 } // namespace chrome