| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/common/metrics/version_utils.h" | 5 #include "chrome/common/metrics/version_utils.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "chrome/common/chrome_version_info_values.h" | 8 #include "components/version_info/version_info_values.h" |
| 9 | 9 |
| 10 namespace metrics { | 10 namespace metrics { |
| 11 | 11 |
| 12 std::string GetVersionString() { | 12 std::string GetVersionString() { |
| 13 std::string version = PRODUCT_VERSION; | 13 std::string version = PRODUCT_VERSION; |
| 14 #if defined(ARCH_CPU_64_BITS) | 14 #if defined(ARCH_CPU_64_BITS) |
| 15 version += "-64"; | 15 version += "-64"; |
| 16 #endif // defined(ARCH_CPU_64_BITS) | 16 #endif // defined(ARCH_CPU_64_BITS) |
| 17 if (!IS_OFFICIAL_BUILD) | 17 if (!IS_OFFICIAL_BUILD) |
| 18 version.append("-devel"); | 18 version.append("-devel"); |
| 19 return version; | 19 return version; |
| 20 } | 20 } |
| 21 | 21 |
| 22 SystemProfileProto::Channel AsProtobufChannel( | 22 SystemProfileProto::Channel AsProtobufChannel( |
| 23 chrome::VersionInfo::Channel channel) { | 23 version_info::Channel channel) { |
| 24 switch (channel) { | 24 switch (channel) { |
| 25 case chrome::VersionInfo::CHANNEL_UNKNOWN: | 25 case version_info::Channel::UNKNOWN: |
| 26 return SystemProfileProto::CHANNEL_UNKNOWN; | 26 return SystemProfileProto::CHANNEL_UNKNOWN; |
| 27 case chrome::VersionInfo::CHANNEL_CANARY: | 27 case version_info::Channel::CANARY: |
| 28 return SystemProfileProto::CHANNEL_CANARY; | 28 return SystemProfileProto::CHANNEL_CANARY; |
| 29 case chrome::VersionInfo::CHANNEL_DEV: | 29 case version_info::Channel::DEV: |
| 30 return SystemProfileProto::CHANNEL_DEV; | 30 return SystemProfileProto::CHANNEL_DEV; |
| 31 case chrome::VersionInfo::CHANNEL_BETA: | 31 case version_info::Channel::BETA: |
| 32 return SystemProfileProto::CHANNEL_BETA; | 32 return SystemProfileProto::CHANNEL_BETA; |
| 33 case chrome::VersionInfo::CHANNEL_STABLE: | 33 case version_info::Channel::STABLE: |
| 34 return SystemProfileProto::CHANNEL_STABLE; | 34 return SystemProfileProto::CHANNEL_STABLE; |
| 35 } | 35 } |
| 36 NOTREACHED(); | 36 NOTREACHED(); |
| 37 return SystemProfileProto::CHANNEL_UNKNOWN; | 37 return SystemProfileProto::CHANNEL_UNKNOWN; |
| 38 } | 38 } |
| 39 | 39 |
| 40 } // namespace metrics | 40 } // namespace metrics |
| OLD | NEW |