Chromium Code Reviews
|
| OLD | NEW |
|---|---|
| (Empty) | |
| 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. | |
| 4 | |
| 5 #include "chrome/common/chrome_version_info.h" | |
| 6 | |
| 7 #include "chrome/browser/chromeos/system/statistics_provider.h" | |
| 8 | |
| 9 namespace chrome { | |
| 10 | |
| 11 const char kChromeOSReleaseTrack[] = "CHROMEOS_RELEASE_TRACK"; | |
| 12 | |
| 13 // static | |
| 14 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.
| |
| 15 std::string channel; | |
| 16 if (chromeos::system::StatisticsProvider::GetInstance()-> | |
| 17 GetMachineStatistic(kChromeOSReleaseTrack, &channel)) { | |
| 18 if (channel == "stable-channel") { | |
| 19 return ""; | |
| 20 } else if (channel == "beta-channel") { | |
| 21 return "beta"; | |
| 22 } else if (channel == "dev-channel") { | |
| 23 return "dev"; | |
| 24 } else if (channel == "canary-channel") { | |
| 25 return "canary"; | |
| 26 } | |
| 27 } | |
| 28 return "unknown"; | |
| 29 } | |
| 30 | |
| 31 // static | |
| 32 VersionInfo::Channel VersionInfo::GetChannel() { | |
|
haraken
2011/12/12 06:30:48
Ditto.
kochi
2011/12/13 09:32:49
Done.
| |
| 33 std::string channel = GetVersionStringModifier(); | |
| 34 if (channel.empty()) { | |
| 35 return CHANNEL_STABLE; | |
| 36 } else if (channel == "beta") { | |
| 37 return CHANNEL_BETA; | |
| 38 } else if (channel == "dev") { | |
| 39 return CHANNEL_DEV; | |
| 40 } else if (channel == "canary") { | |
| 41 return CHANNEL_CANARY; | |
| 42 } | |
| 43 | |
| 44 return CHANNEL_UNKNOWN; | |
| 45 } | |
| 46 | |
| 47 } // namespace chrome | |
| OLD | NEW |