| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "ios/chrome/browser/metrics/ios_chrome_metrics_service_client.h" | 5 #include "ios/chrome/browser/metrics/ios_chrome_metrics_service_client.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include <utility> | 9 #include <utility> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 182 } | 182 } |
| 183 | 183 |
| 184 void IOSChromeMetricsServiceClient::Initialize() { | 184 void IOSChromeMetricsServiceClient::Initialize() { |
| 185 metrics_service_.reset(new metrics::MetricsService( | 185 metrics_service_.reset(new metrics::MetricsService( |
| 186 metrics_state_manager_, this, GetApplicationContext()->GetLocalState())); | 186 metrics_state_manager_, this, GetApplicationContext()->GetLocalState())); |
| 187 | 187 |
| 188 // Register metrics providers. | 188 // Register metrics providers. |
| 189 metrics_service_->RegisterMetricsProvider( | 189 metrics_service_->RegisterMetricsProvider( |
| 190 std::unique_ptr<metrics::MetricsProvider>( | 190 std::unique_ptr<metrics::MetricsProvider>( |
| 191 new metrics::NetworkMetricsProvider( | 191 new metrics::NetworkMetricsProvider( |
| 192 nullptr /* network_quality_task_runner */, |
| 193 nullptr /* network_quality_estimator_provider */, |
| 192 web::WebThread::GetBlockingPool()))); | 194 web::WebThread::GetBlockingPool()))); |
| 193 | 195 |
| 194 // Currently, we configure OmniboxMetricsProvider to not log events to UMA | 196 // Currently, we configure OmniboxMetricsProvider to not log events to UMA |
| 195 // if there is a single incognito session visible. In the future, it may | 197 // if there is a single incognito session visible. In the future, it may |
| 196 // be worth revisiting this to still log events from non-incognito sessions. | 198 // be worth revisiting this to still log events from non-incognito sessions. |
| 197 metrics_service_->RegisterMetricsProvider( | 199 metrics_service_->RegisterMetricsProvider( |
| 198 std::unique_ptr<metrics::MetricsProvider>(new OmniboxMetricsProvider( | 200 std::unique_ptr<metrics::MetricsProvider>(new OmniboxMetricsProvider( |
| 199 base::Bind(&::IsOffTheRecordSessionActive)))); | 201 base::Bind(&::IsOffTheRecordSessionActive)))); |
| 200 | 202 |
| 201 stability_metrics_provider_ = new IOSChromeStabilityMetricsProvider( | 203 stability_metrics_provider_ = new IOSChromeStabilityMetricsProvider( |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 311 | 313 |
| 312 void IOSChromeMetricsServiceClient::OnURLOpenedFromOmnibox(OmniboxLog* log) { | 314 void IOSChromeMetricsServiceClient::OnURLOpenedFromOmnibox(OmniboxLog* log) { |
| 313 metrics_service_->OnApplicationNotIdle(); | 315 metrics_service_->OnApplicationNotIdle(); |
| 314 } | 316 } |
| 315 | 317 |
| 316 metrics::EnableMetricsDefault | 318 metrics::EnableMetricsDefault |
| 317 IOSChromeMetricsServiceClient::GetMetricsReportingDefaultState() { | 319 IOSChromeMetricsServiceClient::GetMetricsReportingDefaultState() { |
| 318 return metrics::GetMetricsReportingDefaultState( | 320 return metrics::GetMetricsReportingDefaultState( |
| 319 GetApplicationContext()->GetLocalState()); | 321 GetApplicationContext()->GetLocalState()); |
| 320 } | 322 } |
| OLD | NEW |