OLD | NEW |
---|---|
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/browser/metrics/chrome_browser_main_extra_parts_metrics.h" | 5 #include "chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 27 matching lines...) Expand all Loading... | |
38 #if defined(OS_WIN) | 38 #if defined(OS_WIN) |
39 #include "chrome/installer/util/google_update_settings.h" | 39 #include "chrome/installer/util/google_update_settings.h" |
40 #endif // defined(OS_WIN) | 40 #endif // defined(OS_WIN) |
41 | 41 |
42 namespace { | 42 namespace { |
43 | 43 |
44 enum UMALinuxGlibcVersion { | 44 enum UMALinuxGlibcVersion { |
45 UMA_LINUX_GLIBC_NOT_PARSEABLE, | 45 UMA_LINUX_GLIBC_NOT_PARSEABLE, |
46 UMA_LINUX_GLIBC_UNKNOWN, | 46 UMA_LINUX_GLIBC_UNKNOWN, |
47 UMA_LINUX_GLIBC_2_11, | 47 UMA_LINUX_GLIBC_2_11, |
48 UMA_LINUX_GLIBC_2_19 = UMA_LINUX_GLIBC_2_11 + 8, | 48 UMA_LINUX_GLIBC_2_29 = UMA_LINUX_GLIBC_2_11 + 18, |
49 // NOTE: Add new version above this line and update the enum list in | 49 // NOTE: Add new version above this line and update the enum list in |
50 // tools/metrics/histograms/histograms.xml accordingly. | 50 // tools/metrics/histograms/histograms.xml accordingly. |
51 UMA_LINUX_GLIBC_VERSION_COUNT | 51 UMA_LINUX_GLIBC_VERSION_COUNT |
52 }; | 52 }; |
53 | 53 |
54 enum UMALinuxWindowManager { | 54 enum UMALinuxWindowManager { |
55 UMA_LINUX_WINDOW_MANAGER_OTHER, | 55 UMA_LINUX_WINDOW_MANAGER_OTHER, |
56 UMA_LINUX_WINDOW_MANAGER_BLACKBOX, | 56 UMA_LINUX_WINDOW_MANAGER_BLACKBOX, |
57 UMA_LINUX_WINDOW_MANAGER_CHROME_OS, // Deprecated. | 57 UMA_LINUX_WINDOW_MANAGER_CHROME_OS, // Deprecated. |
58 UMA_LINUX_WINDOW_MANAGER_COMPIZ, | 58 UMA_LINUX_WINDOW_MANAGER_COMPIZ, |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
127 glibc_version_result = UMA_LINUX_GLIBC_UNKNOWN; | 127 glibc_version_result = UMA_LINUX_GLIBC_UNKNOWN; |
128 int glibc_major_version = version.components()[0]; | 128 int glibc_major_version = version.components()[0]; |
129 int glibc_minor_version = version.components()[1]; | 129 int glibc_minor_version = version.components()[1]; |
130 if (glibc_major_version == 2) { | 130 if (glibc_major_version == 2) { |
131 // A constant to translate glibc 2.x minor versions to their | 131 // A constant to translate glibc 2.x minor versions to their |
132 // equivalent UMALinuxGlibcVersion values. | 132 // equivalent UMALinuxGlibcVersion values. |
133 const int kGlibcMinorVersionTranslationOffset = 11 - UMA_LINUX_GLIBC_2_11; | 133 const int kGlibcMinorVersionTranslationOffset = 11 - UMA_LINUX_GLIBC_2_11; |
134 int translated_glibc_minor_version = | 134 int translated_glibc_minor_version = |
135 glibc_minor_version - kGlibcMinorVersionTranslationOffset; | 135 glibc_minor_version - kGlibcMinorVersionTranslationOffset; |
136 if (translated_glibc_minor_version >= UMA_LINUX_GLIBC_2_11 && | 136 if (translated_glibc_minor_version >= UMA_LINUX_GLIBC_2_11 && |
137 translated_glibc_minor_version <= UMA_LINUX_GLIBC_2_19) { | 137 translated_glibc_minor_version <= UMA_LINUX_GLIBC_2_29) { |
138 glibc_version_result = | 138 glibc_version_result = |
139 static_cast<UMALinuxGlibcVersion>(translated_glibc_minor_version); | 139 static_cast<UMALinuxGlibcVersion>(translated_glibc_minor_version); |
140 } | 140 } |
141 } | 141 } |
142 } | 142 } |
143 UMA_HISTOGRAM_ENUMERATION("Linux.GlibcVersion", glibc_version_result, | 143 UMA_HISTOGRAM_ENUMERATION("Linux.GlibcVersion", glibc_version_result, |
Alexei Svitkine (slow)
2015/02/25 20:28:50
Perhaps it would be better to use UMA_HISTOGRAM_SP
Lei Zhang
2015/02/25 22:13:26
Done.
| |
144 UMA_LINUX_GLIBC_VERSION_COUNT); | 144 UMA_LINUX_GLIBC_VERSION_COUNT); |
145 #endif | 145 #endif |
146 } | 146 } |
147 | 147 |
148 #if defined(USE_X11) && !defined(OS_CHROMEOS) | 148 #if defined(USE_X11) && !defined(OS_CHROMEOS) |
149 UMALinuxWindowManager GetLinuxWindowManager() { | 149 UMALinuxWindowManager GetLinuxWindowManager() { |
150 switch (ui::GuessWindowManager()) { | 150 switch (ui::GuessWindowManager()) { |
151 case ui::WM_UNKNOWN: | 151 case ui::WM_UNKNOWN: |
152 return UMA_LINUX_WINDOW_MANAGER_OTHER; | 152 return UMA_LINUX_WINDOW_MANAGER_OTHER; |
153 case ui::WM_AWESOME: | 153 case ui::WM_AWESOME: |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
299 } | 299 } |
300 } | 300 } |
301 | 301 |
302 namespace chrome { | 302 namespace chrome { |
303 | 303 |
304 void AddMetricsExtraParts(ChromeBrowserMainParts* main_parts) { | 304 void AddMetricsExtraParts(ChromeBrowserMainParts* main_parts) { |
305 main_parts->AddParts(new ChromeBrowserMainExtraPartsMetrics()); | 305 main_parts->AddParts(new ChromeBrowserMainExtraPartsMetrics()); |
306 } | 306 } |
307 | 307 |
308 } // namespace chrome | 308 } // namespace chrome |
OLD | NEW |