1 // Copyright 2015 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/metrics/version_utils.h"
7 #include "base/logging.h"
8 #include "components/version_info/version_info.h"
9 #include "components/version_info/version_info_values.h"
13 std::string
GetVersionString() {
14 std::string version
= PRODUCT_VERSION
;
15 #if defined(ARCH_CPU_64_BITS)
17 #endif // defined(ARCH_CPU_64_BITS)
18 if (!IS_OFFICIAL_BUILD
)
19 version
.append("-devel");
23 SystemProfileProto::Channel
AsProtobufChannel(
24 version_info::Channel channel
) {
26 case version_info::Channel::UNKNOWN
:
27 return SystemProfileProto::CHANNEL_UNKNOWN
;
28 case version_info::Channel::CANARY
:
29 return SystemProfileProto::CHANNEL_CANARY
;
30 case version_info::Channel::DEV
:
31 return SystemProfileProto::CHANNEL_DEV
;
32 case version_info::Channel::BETA
:
33 return SystemProfileProto::CHANNEL_BETA
;
34 case version_info::Channel::STABLE
:
35 return SystemProfileProto::CHANNEL_STABLE
;
38 return SystemProfileProto::CHANNEL_UNKNOWN
;
41 } // namespace metrics