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

Unified Diff: chrome/browser/metrics/metrics_log.cc

Issue 10834077: [UMA] Add " (Metro)" to the OS name for UMA uploads from Chrome running under Windows 8's Metro mod… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added a TODO Created 8 years, 4 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/metrics/metrics_log.cc
diff --git a/chrome/browser/metrics/metrics_log.cc b/chrome/browser/metrics/metrics_log.cc
index 69fd3f8a02b456c3121e4526d17c538393c14058..ef9879b3c60db28e82b86f95a96f17ee3892634b 100644
--- a/chrome/browser/metrics/metrics_log.cc
+++ b/chrome/browser/metrics/metrics_log.cc
@@ -47,8 +47,10 @@
#define OPEN_ELEMENT_FOR_SCOPE(name) ScopedElement scoped_element(this, name)
-// http://blogs.msdn.com/oldnewthing/archive/2004/10/25/247180.aspx
#if defined(OS_WIN)
+#include "base/win/metro.h"
+
+// http://blogs.msdn.com/oldnewthing/archive/2004/10/25/247180.aspx
extern "C" IMAGE_DOS_HEADER __ImageBase;
#endif
@@ -756,7 +758,17 @@ void MetricsLog::RecordEnvironmentProto(
#endif
SystemProfileProto::OS* os = system_profile->mutable_os();
- os->set_name(base::SysInfo::OperatingSystemName());
+ std::string os_name = base::SysInfo::OperatingSystemName();
+#if defined(OS_WIN)
+ // TODO(mad): This only checks whether the main process is a Metro process at
+ // upload time; not whether the collected metrics were all gathered from
+ // Metro. This is ok as an approximation for now, since users will rarely be
+ // switching from Metro to Desktop mode; but we should re-evaluate whether we
+ // can distinguish metrics more cleanly in the future: http://crbug.com/140568
+ if (base::win::IsMetroProcess())
+ os_name += " (Metro)";
+#endif
+ os->set_name(os_name);
os->set_version(base::SysInfo::OperatingSystemVersion());
const content::GPUInfo& gpu_info =
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698