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

Unified Diff: chrome/common/chrome_version_info_linux.cc

Issue 7249003: Move GetVersionStringModifier() and GetChannel() from platform_util_* to chrome_version_info_* (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: correct nits Created 9 years, 6 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/common/chrome_version_info.h ('k') | chrome/common/chrome_version_info_mac.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/chrome_version_info_linux.cc
diff --git a/chrome/common/chrome_version_info_linux.cc b/chrome/common/chrome_version_info_linux.cc
new file mode 100644
index 0000000000000000000000000000000000000000..301ed70be0a5095a25516394f9add286385490b6
--- /dev/null
+++ b/chrome/common/chrome_version_info_linux.cc
@@ -0,0 +1,50 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/common/chrome_version_info.h"
+
+namespace chrome {
+
+// static. Warning: this may be either Linux or ChromeOS.
+std::string VersionInfo::GetVersionStringModifier() {
+ char* env = getenv("CHROME_VERSION_EXTRA");
+ if (!env)
+ return std::string();
+ std::string modifier(env);
+
+#if defined(GOOGLE_CHROME_BUILD)
+ // Only ever return "", "unknown", "dev" or "beta" in a branded build.
+ if (modifier == "unstable") // linux version of "dev"
+ modifier = "dev";
+ if (modifier == "stable") {
+ modifier = "";
+ } else if ((modifier == "dev") || (modifier == "beta")) {
+ // do nothing.
+ } else {
+ modifier = "unknown";
+ }
+#endif
+
+ return modifier;
+}
+
+// static. Warning: this may be either Linux or ChromeOS.
+VersionInfo::Channel VersionInfo::GetChannel() {
+#if defined(GOOGLE_CHROME_BUILD)
+ std::string channel = GetVersionStringModifier();
+ if (channel.empty()) {
+ return CHANNEL_STABLE;
+ } else if (channel == "beta") {
+ return CHANNEL_BETA;
+ } else if (channel == "dev") {
+ return CHANNEL_DEV;
+ } else if (channel == "canary") {
+ return CHANNEL_CANARY;
+ }
+#endif
+
+ return CHANNEL_UNKNOWN;
+}
+
+} // namespace chrome
« no previous file with comments | « chrome/common/chrome_version_info.h ('k') | chrome/common/chrome_version_info_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698