OLD | NEW |
| (Empty) |
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. | |
4 | |
5 #include "components/metrics/net/version_utils.h" | |
6 | |
7 #include "base/logging.h" | |
8 #include "build/build_config.h" | |
9 #include "components/version_info/version_info.h" | |
10 | |
11 namespace metrics { | |
12 | |
13 std::string GetVersionString() { | |
14 std::string version = version_info::GetVersionNumber(); | |
15 #if defined(ARCH_CPU_64_BITS) | |
16 version += "-64"; | |
17 #endif // defined(ARCH_CPU_64_BITS) | |
18 if (!version_info::IsOfficialBuild()) | |
19 version.append("-devel"); | |
20 return version; | |
21 } | |
22 | |
23 SystemProfileProto::Channel AsProtobufChannel( | |
24 version_info::Channel channel) { | |
25 switch (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; | |
36 } | |
37 NOTREACHED(); | |
38 return SystemProfileProto::CHANNEL_UNKNOWN; | |
39 } | |
40 | |
41 } // namespace metrics | |
OLD | NEW |