Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(144)

Side by Side Diff: chrome/common/chrome_version_info_linux.cc

Issue 8883043: Chrome version info getter for Chrome OS. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/common/chrome_version_info_chromeos.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/common/chrome_version_info.h" 5 #include "chrome/common/chrome_version_info.h"
6 6
7 namespace chrome { 7 namespace chrome {
8 8
9 // static. Warning: this may be either Linux or ChromeOS. 9 // static
10 std::string VersionInfo::GetVersionStringModifier() { 10 std::string VersionInfo::GetVersionStringModifier() {
11 char* env = getenv("CHROME_VERSION_EXTRA"); 11 char* env = getenv("CHROME_VERSION_EXTRA");
12 if (!env) 12 if (!env)
13 return std::string(); 13 return std::string();
14 std::string modifier(env); 14 std::string modifier(env);
15 15
16 #if defined(GOOGLE_CHROME_BUILD) 16 #if defined(GOOGLE_CHROME_BUILD)
17 // Only ever return "", "unknown", "dev" or "beta" in a branded build. 17 // Only ever return "", "unknown", "dev" or "beta" in a branded build.
18 if (modifier == "unstable") // linux version of "dev" 18 if (modifier == "unstable") // linux version of "dev"
19 modifier = "dev"; 19 modifier = "dev";
20 if (modifier == "stable") { 20 if (modifier == "stable") {
21 modifier = ""; 21 modifier = "";
22 } else if ((modifier == "dev") || (modifier == "beta")) { 22 } else if ((modifier == "dev") || (modifier == "beta")) {
23 // do nothing. 23 // do nothing.
24 } else { 24 } else {
25 modifier = "unknown"; 25 modifier = "unknown";
26 } 26 }
27 #endif 27 #endif
28 28
29 return modifier; 29 return modifier;
30 } 30 }
31 31
32 // static. Warning: this may be either Linux or ChromeOS. 32 // static
33 VersionInfo::Channel VersionInfo::GetChannel() { 33 VersionInfo::Channel VersionInfo::GetChannel() {
34 #if defined(GOOGLE_CHROME_BUILD) 34 #if defined(GOOGLE_CHROME_BUILD)
35 std::string channel = GetVersionStringModifier(); 35 std::string channel = GetVersionStringModifier();
36 if (channel.empty()) { 36 if (channel.empty()) {
37 return CHANNEL_STABLE; 37 return CHANNEL_STABLE;
38 } else if (channel == "beta") { 38 } else if (channel == "beta") {
39 return CHANNEL_BETA; 39 return CHANNEL_BETA;
40 } else if (channel == "dev") { 40 } else if (channel == "dev") {
41 return CHANNEL_DEV; 41 return CHANNEL_DEV;
42 } else if (channel == "canary") { 42 } else if (channel == "canary") {
43 return CHANNEL_CANARY; 43 return CHANNEL_CANARY;
44 } 44 }
45 #endif 45 #endif
46 46
47 return CHANNEL_UNKNOWN; 47 return CHANNEL_UNKNOWN;
48 } 48 }
49 49
50 } // namespace chrome 50 } // namespace chrome
OLDNEW
« no previous file with comments | « chrome/common/chrome_version_info_chromeos.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698