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

Side by Side Diff: chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.cc

Issue 374203004: mac: Add metrics to record Bluetooth availability and capabilities. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comments from mark. Created 6 years, 5 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 unified diff | Download patch
OLDNEW
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"
11 #include "base/cpu.h" 11 #include "base/cpu.h"
12 #include "base/metrics/histogram.h" 12 #include "base/metrics/histogram.h"
13 #include "base/metrics/sparse_histogram.h" 13 #include "base/metrics/sparse_histogram.h"
14 #include "base/sys_info.h" 14 #include "base/sys_info.h"
15 #include "base/threading/sequenced_worker_pool.h" 15 #include "base/threading/sequenced_worker_pool.h"
16 #include "base/time/time.h" 16 #include "base/time/time.h"
17 #include "chrome/browser/about_flags.h" 17 #include "chrome/browser/about_flags.h"
18 #include "chrome/browser/browser_process.h" 18 #include "chrome/browser/browser_process.h"
19 #include "chrome/browser/chrome_browser_main.h" 19 #include "chrome/browser/chrome_browser_main.h"
20 #include "chrome/browser/chrome_browser_metrics_service_observer.h" 20 #include "chrome/browser/chrome_browser_metrics_service_observer.h"
21 #include "chrome/browser/mac/hardware_utility.h"
21 #include "chrome/browser/pref_service_flags_storage.h" 22 #include "chrome/browser/pref_service_flags_storage.h"
22 #include "chrome/browser/shell_integration.h" 23 #include "chrome/browser/shell_integration.h"
23 #include "content/public/browser/browser_thread.h" 24 #include "content/public/browser/browser_thread.h"
24 #include "ui/base/touch/touch_device.h" 25 #include "ui/base/touch/touch_device.h"
25 #include "ui/base/ui_base_switches.h" 26 #include "ui/base/ui_base_switches.h"
26 #include "ui/events/event_switches.h" 27 #include "ui/events/event_switches.h"
27 28
28 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) 29 #if defined(OS_LINUX) && !defined(OS_CHROMEOS)
29 #include <gnu/libc-version.h> 30 #include <gnu/libc-version.h>
30 31
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 UMA_HISTOGRAM_SPARSE_SLOWLY("Platform.LogicalCpuCount", 88 UMA_HISTOGRAM_SPARSE_SLOWLY("Platform.LogicalCpuCount",
88 base::SysInfo::NumberOfProcessors()); 89 base::SysInfo::NumberOfProcessors());
89 } 90 }
90 91
91 // Called on the blocking pool some time after startup to avoid slowing down 92 // Called on the blocking pool some time after startup to avoid slowing down
92 // startup with metrics that aren't trivial to compute. 93 // startup with metrics that aren't trivial to compute.
93 void RecordStartupMetricsOnBlockingPool() { 94 void RecordStartupMetricsOnBlockingPool() {
94 #if defined(OS_WIN) 95 #if defined(OS_WIN)
95 GoogleUpdateSettings::RecordChromeUpdatePolicyHistograms(); 96 GoogleUpdateSettings::RecordChromeUpdatePolicyHistograms();
96 #endif // defined(OS_WIN) 97 #endif // defined(OS_WIN)
98
99 #if defined(OS_MACOSX) && !defined(OS_IOS)
100 hardware_utility::BluetoothAvailability availability =
101 hardware_utility::GetBluetoothAvailability();
102 UMA_HISTOGRAM_ENUMERATION("OSX.BluetoothAvailability",
103 availability,
104 hardware_utility::BLUETOOTH_AVAILABILITY_COUNT);
Ilya Sherman 2014/07/09 21:19:33 I might be mistaken, but I don't think that the bl
Ilya Sherman 2014/07/09 21:19:33 By the way, note that there is a Bluetooth section
erikchen 2014/07/11 17:25:44 We're not touching the bluetooth system, we're tou
erikchen 2014/07/11 17:25:44 As per offline discussion, I am keeping this a his
105 #endif // defined(OS_MACOSX) && !defined(OS_IOS)
97 } 106 }
98 107
99 void RecordLinuxGlibcVersion() { 108 void RecordLinuxGlibcVersion() {
100 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) 109 #if defined(OS_LINUX) && !defined(OS_CHROMEOS)
101 Version version(gnu_get_libc_version()); 110 Version version(gnu_get_libc_version());
102 111
103 UMALinuxGlibcVersion glibc_version_result = UMA_LINUX_GLIBC_NOT_PARSEABLE; 112 UMALinuxGlibcVersion glibc_version_result = UMA_LINUX_GLIBC_NOT_PARSEABLE;
104 if (version.IsValid() && version.components().size() == 2) { 113 if (version.IsValid() && version.components().size() == 2) {
105 glibc_version_result = UMA_LINUX_GLIBC_UNKNOWN; 114 glibc_version_result = UMA_LINUX_GLIBC_UNKNOWN;
106 int glibc_major_version = version.components()[0]; 115 int glibc_major_version = version.components()[0];
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 #endif 240 #endif
232 } 241 }
233 242
234 namespace chrome { 243 namespace chrome {
235 244
236 void AddMetricsExtraParts(ChromeBrowserMainParts* main_parts) { 245 void AddMetricsExtraParts(ChromeBrowserMainParts* main_parts) {
237 main_parts->AddParts(new ChromeBrowserMainExtraPartsMetrics()); 246 main_parts->AddParts(new ChromeBrowserMainExtraPartsMetrics());
238 } 247 }
239 248
240 } // namespace chrome 249 } // namespace chrome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698