Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(9501)

Unified Diff: chrome/common/metrics/version_utils.cc

Issue 1030503003: Metrics log modification to handle external components. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: newlinewq Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/common/metrics/version_utils.h ('k') | components/metrics/metrics_log.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/metrics/version_utils.cc
diff --git a/chrome/common/metrics/version_utils.cc b/chrome/common/metrics/version_utils.cc
new file mode 100644
index 0000000000000000000000000000000000000000..31e6f9cf1e5dd372133651c13c807dced0be90e6
--- /dev/null
+++ b/chrome/common/metrics/version_utils.cc
@@ -0,0 +1,40 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/common/metrics/version_utils.h"
+
+#include "base/logging.h"
+#include "chrome/common/chrome_version_info_values.h"
+
+namespace metrics {
+
+std::string GetVersionString() {
+ std::string version = PRODUCT_VERSION;
+#if defined(ARCH_CPU_64_BITS)
+ version += "-64";
+#endif // defined(ARCH_CPU_64_BITS)
+ if (!IS_OFFICIAL_BUILD)
+ version.append("-devel");
+ return version;
+}
+
+SystemProfileProto::Channel AsProtobufChannel(
+ chrome::VersionInfo::Channel channel) {
+ switch (channel) {
+ case chrome::VersionInfo::CHANNEL_UNKNOWN:
+ return SystemProfileProto::CHANNEL_UNKNOWN;
+ case chrome::VersionInfo::CHANNEL_CANARY:
+ return SystemProfileProto::CHANNEL_CANARY;
+ case chrome::VersionInfo::CHANNEL_DEV:
+ return SystemProfileProto::CHANNEL_DEV;
+ case chrome::VersionInfo::CHANNEL_BETA:
+ return SystemProfileProto::CHANNEL_BETA;
+ case chrome::VersionInfo::CHANNEL_STABLE:
+ return SystemProfileProto::CHANNEL_STABLE;
+ }
+ NOTREACHED();
+ return SystemProfileProto::CHANNEL_UNKNOWN;
+}
+
+} // namespace metrics
« no previous file with comments | « chrome/common/metrics/version_utils.h ('k') | components/metrics/metrics_log.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698