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

Unified Diff: chrome/common/chrome_version_info_chromeos.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/chrome_common.gypi ('k') | chrome/common/chrome_version_info_linux.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/chrome_version_info_chromeos.cc
===================================================================
--- chrome/common/chrome_version_info_chromeos.cc (revision 0)
+++ chrome/common/chrome_version_info_chromeos.cc (revision 0)
@@ -0,0 +1,47 @@
+// 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"
+
+#include "chrome/browser/chromeos/system/statistics_provider.h"
+
+namespace chrome {
+
+const char kChromeOSReleaseTrack[] = "CHROMEOS_RELEASE_TRACK";
+
+// static
+std::string VersionInfo::GetVersionStringModifier() {
haraken 2011/12/12 06:30:48 In order to make it consistent with other platform
kochi 2011/12/13 09:32:49 Done.
+ std::string channel;
+ if (chromeos::system::StatisticsProvider::GetInstance()->
+ GetMachineStatistic(kChromeOSReleaseTrack, &channel)) {
+ if (channel == "stable-channel") {
+ return "";
+ } else if (channel == "beta-channel") {
+ return "beta";
+ } else if (channel == "dev-channel") {
+ return "dev";
+ } else if (channel == "canary-channel") {
+ return "canary";
+ }
+ }
+ return "unknown";
+}
+
+// static
+VersionInfo::Channel VersionInfo::GetChannel() {
haraken 2011/12/12 06:30:48 Ditto.
kochi 2011/12/13 09:32:49 Done.
+ 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;
+ }
+
+ return CHANNEL_UNKNOWN;
+}
+
+} // namespace chrome
Property changes on: chrome/common/chrome_version_info_chromeos.cc
___________________________________________________________________
Added: svn:eol-style
+ LF
« no previous file with comments | « chrome/chrome_common.gypi ('k') | chrome/common/chrome_version_info_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698