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/channel_info.h"
7 #include "components/version_info/version_info.h"
11 static version_info::Channel chromeos_channel
= version_info::Channel::UNKNOWN
;
13 std::string
GetChannelString() {
14 #if defined(GOOGLE_CHROME_BUILD)
15 switch (chromeos_channel
) {
16 case version_info::Channel::STABLE
:
18 case version_info::Channel::BETA
:
20 case version_info::Channel::DEV
:
22 case version_info::Channel::CANARY
:
31 version_info::Channel
GetChannel() {
32 return chromeos_channel
;
35 void SetChannel(const std::string
& channel
) {
36 #if defined(GOOGLE_CHROME_BUILD)
37 if (channel
== "stable-channel") {
38 chromeos_channel
= version_info::Channel::STABLE
;
39 } else if (channel
== "beta-channel") {
40 chromeos_channel
= version_info::Channel::BETA
;
41 } else if (channel
== "dev-channel") {
42 chromeos_channel
= version_info::Channel::DEV
;
43 } else if (channel
== "canary-channel") {
44 chromeos_channel
= version_info::Channel::CANARY
;