| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/chromeos_metrics_provider.h" | 5 #include "chrome/browser/metrics/chromeos_metrics_provider.h" |
| 6 | 6 |
| 7 #include "base/prefs/pref_registry_simple.h" | 7 #include "base/prefs/pref_registry_simple.h" |
| 8 #include "base/prefs/pref_service.h" | 8 #include "base/prefs/pref_service.h" |
| 9 #include "base/strings/string_number_conversions.h" | 9 #include "base/strings/string_number_conversions.h" |
| 10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 // the UI thread. | 170 // the UI thread. |
| 171 content::BrowserThread::PostTaskAndReply( | 171 content::BrowserThread::PostTaskAndReply( |
| 172 content::BrowserThread::FILE, | 172 content::BrowserThread::FILE, |
| 173 FROM_HERE, | 173 FROM_HERE, |
| 174 base::Bind(&ChromeOSMetricsProvider::InitTaskGetHardwareClassOnFileThread, | 174 base::Bind(&ChromeOSMetricsProvider::InitTaskGetHardwareClassOnFileThread, |
| 175 weak_ptr_factory_.GetWeakPtr()), | 175 weak_ptr_factory_.GetWeakPtr()), |
| 176 callback); | 176 callback); |
| 177 } | 177 } |
| 178 | 178 |
| 179 void ChromeOSMetricsProvider::InitTaskGetHardwareClassOnFileThread() { | 179 void ChromeOSMetricsProvider::InitTaskGetHardwareClassOnFileThread() { |
| 180 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::FILE)); | 180 DCHECK_CURRENTLY_ON(content::BrowserThread::FILE); |
| 181 chromeos::system::StatisticsProvider::GetInstance()->GetMachineStatistic( | 181 chromeos::system::StatisticsProvider::GetInstance()->GetMachineStatistic( |
| 182 "hardware_class", &hardware_class_); | 182 "hardware_class", &hardware_class_); |
| 183 } | 183 } |
| 184 | 184 |
| 185 void ChromeOSMetricsProvider::ProvideSystemProfileMetrics( | 185 void ChromeOSMetricsProvider::ProvideSystemProfileMetrics( |
| 186 metrics::SystemProfileProto* system_profile_proto) { | 186 metrics::SystemProfileProto* system_profile_proto) { |
| 187 WriteBluetoothProto(system_profile_proto); | 187 WriteBluetoothProto(system_profile_proto); |
| 188 UpdateMultiProfileUserCount(system_profile_proto); | 188 UpdateMultiProfileUserCount(system_profile_proto); |
| 189 | 189 |
| 190 metrics::SystemProfileProto::Hardware* hardware = | 190 metrics::SystemProfileProto::Hardware* hardware = |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 315 | 315 |
| 316 void ChromeOSMetricsProvider::SetBluetoothAdapter( | 316 void ChromeOSMetricsProvider::SetBluetoothAdapter( |
| 317 scoped_refptr<device::BluetoothAdapter> adapter) { | 317 scoped_refptr<device::BluetoothAdapter> adapter) { |
| 318 adapter_ = adapter; | 318 adapter_ = adapter; |
| 319 } | 319 } |
| 320 | 320 |
| 321 void ChromeOSMetricsProvider::RecordEnrollmentStatus() { | 321 void ChromeOSMetricsProvider::RecordEnrollmentStatus() { |
| 322 UMA_HISTOGRAM_ENUMERATION( | 322 UMA_HISTOGRAM_ENUMERATION( |
| 323 "UMA.EnrollmentStatus", GetEnrollmentStatus(), ENROLLMENT_STATUS_MAX); | 323 "UMA.EnrollmentStatus", GetEnrollmentStatus(), ENROLLMENT_STATUS_MAX); |
| 324 } | 324 } |
| OLD | NEW |