| 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 20 matching lines...) Expand all Loading... |
| 31 #include "base/version.h" | 31 #include "base/version.h" |
| 32 #if defined(USE_X11) | 32 #if defined(USE_X11) |
| 33 #include "ui/base/x/x11_util.h" | 33 #include "ui/base/x/x11_util.h" |
| 34 #endif | 34 #endif |
| 35 #endif // defined(OS_LINUX) && !defined(OS_CHROMEOS) | 35 #endif // defined(OS_LINUX) && !defined(OS_CHROMEOS) |
| 36 | 36 |
| 37 #if defined(OS_WIN) | 37 #if defined(OS_WIN) |
| 38 #include "chrome/installer/util/google_update_settings.h" | 38 #include "chrome/installer/util/google_update_settings.h" |
| 39 #endif // defined(OS_WIN) | 39 #endif // defined(OS_WIN) |
| 40 | 40 |
| 41 #if defined(OS_MACOSX) && !defined(OS_IOS) |
| 42 #include "chrome/browser/metrics/chrome_browser_main_extra_parts_metrics_mac.h" |
| 43 #endif // defined(OS_MACOSX) && !defined(OS_IOS) |
| 44 |
| 41 namespace { | 45 namespace { |
| 42 | 46 |
| 43 enum UMALinuxGlibcVersion { | 47 enum UMALinuxGlibcVersion { |
| 44 UMA_LINUX_GLIBC_NOT_PARSEABLE, | 48 UMA_LINUX_GLIBC_NOT_PARSEABLE, |
| 45 UMA_LINUX_GLIBC_UNKNOWN, | 49 UMA_LINUX_GLIBC_UNKNOWN, |
| 46 UMA_LINUX_GLIBC_2_11, | 50 UMA_LINUX_GLIBC_2_11, |
| 47 UMA_LINUX_GLIBC_2_19 = UMA_LINUX_GLIBC_2_11 + 8, | 51 UMA_LINUX_GLIBC_2_19 = UMA_LINUX_GLIBC_2_11 + 8, |
| 48 // NOTE: Add new version above this line and update the enum list in | 52 // NOTE: Add new version above this line and update the enum list in |
| 49 // tools/metrics/histograms/histograms.xml accordingly. | 53 // tools/metrics/histograms/histograms.xml accordingly. |
| 50 UMA_LINUX_GLIBC_VERSION_COUNT | 54 UMA_LINUX_GLIBC_VERSION_COUNT |
| (...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 236 | 240 |
| 237 void ChromeBrowserMainExtraPartsMetrics::PostBrowserStart() { | 241 void ChromeBrowserMainExtraPartsMetrics::PostBrowserStart() { |
| 238 RecordLinuxGlibcVersion(); | 242 RecordLinuxGlibcVersion(); |
| 239 #if defined(USE_X11) && !defined(OS_CHROMEOS) | 243 #if defined(USE_X11) && !defined(OS_CHROMEOS) |
| 240 UMA_HISTOGRAM_ENUMERATION("Linux.WindowManager", | 244 UMA_HISTOGRAM_ENUMERATION("Linux.WindowManager", |
| 241 GetLinuxWindowManager(), | 245 GetLinuxWindowManager(), |
| 242 UMA_LINUX_WINDOW_MANAGER_COUNT); | 246 UMA_LINUX_WINDOW_MANAGER_COUNT); |
| 243 #endif | 247 #endif |
| 244 RecordTouchEventState(); | 248 RecordTouchEventState(); |
| 245 | 249 |
| 250 #if defined(OS_MACOSX) && !defined(OS_IOS) |
| 251 extra_parts_metrics_mac_.reset(new ChromeBrowserMainExtraPartsMetricsMac); |
| 252 #endif // defined(OS_MACOSX) && !defined(OS_IOS) |
| 253 |
| 246 const int kStartupMetricsGatheringDelaySeconds = 45; | 254 const int kStartupMetricsGatheringDelaySeconds = 45; |
| 247 content::BrowserThread::GetBlockingPool()->PostDelayedTask( | 255 content::BrowserThread::GetBlockingPool()->PostDelayedTask( |
| 248 FROM_HERE, | 256 FROM_HERE, |
| 249 base::Bind(&RecordStartupMetricsOnBlockingPool), | 257 base::Bind(&RecordStartupMetricsOnBlockingPool), |
| 250 base::TimeDelta::FromSeconds(kStartupMetricsGatheringDelaySeconds)); | 258 base::TimeDelta::FromSeconds(kStartupMetricsGatheringDelaySeconds)); |
| 251 } | 259 } |
| 252 | 260 |
| 253 namespace chrome { | 261 namespace chrome { |
| 254 | 262 |
| 255 void AddMetricsExtraParts(ChromeBrowserMainParts* main_parts) { | 263 void AddMetricsExtraParts(ChromeBrowserMainParts* main_parts) { |
| 256 main_parts->AddParts(new ChromeBrowserMainExtraPartsMetrics()); | 264 main_parts->AddParts(new ChromeBrowserMainExtraPartsMetrics()); |
| 257 } | 265 } |
| 258 | 266 |
| 259 } // namespace chrome | 267 } // namespace chrome |
| OLD | NEW |