| 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 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 EnrollmentStatus GetEnrollmentStatus() { | 108 EnrollmentStatus GetEnrollmentStatus() { |
| 109 policy::BrowserPolicyConnectorChromeOS* connector = | 109 policy::BrowserPolicyConnectorChromeOS* connector = |
| 110 g_browser_process->platform_part()->browser_policy_connector_chromeos(); | 110 g_browser_process->platform_part()->browser_policy_connector_chromeos(); |
| 111 if (!connector) | 111 if (!connector) |
| 112 return ERROR_GETTING_ENROLLMENT_STATUS; | 112 return ERROR_GETTING_ENROLLMENT_STATUS; |
| 113 | 113 |
| 114 if (!connector->IsEnterpriseManaged()) | 114 if (!connector->IsEnterpriseManaged()) |
| 115 return NON_MANAGED; | 115 return NON_MANAGED; |
| 116 | 116 |
| 117 std::string domain = connector->GetEnterpriseDomain(); | 117 std::string domain = connector->GetEnterpriseDomain(); |
| 118 if (base::EndsWith(domain, kEduDomain, false /* case insensitive */)) | 118 if (base::EndsWith(domain, kEduDomain, base::CompareCase::INSENSITIVE_ASCII)) |
| 119 return MANAGED_EDU; | 119 return MANAGED_EDU; |
| 120 | 120 |
| 121 return MANAGED_NON_EDU; | 121 return MANAGED_NON_EDU; |
| 122 } | 122 } |
| 123 | 123 |
| 124 } // namespace | 124 } // namespace |
| 125 | 125 |
| 126 ChromeOSMetricsProvider::ChromeOSMetricsProvider() | 126 ChromeOSMetricsProvider::ChromeOSMetricsProvider() |
| 127 : registered_user_count_at_log_initialization_(false), | 127 : registered_user_count_at_log_initialization_(false), |
| 128 user_count_at_log_initialization_(0), | 128 user_count_at_log_initialization_(0), |
| (...skipping 186 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 |