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 <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 return client.Pass(); | 98 return client.Pass(); |
99 } | 99 } |
100 | 100 |
101 // static | 101 // static |
102 void IOSChromeMetricsServiceClient::RegisterPrefs( | 102 void IOSChromeMetricsServiceClient::RegisterPrefs( |
103 PrefRegistrySimple* registry) { | 103 PrefRegistrySimple* registry) { |
104 metrics::MetricsService::RegisterPrefs(registry); | 104 metrics::MetricsService::RegisterPrefs(registry); |
105 metrics::StabilityMetricsHelper::RegisterPrefs(registry); | 105 metrics::StabilityMetricsHelper::RegisterPrefs(registry); |
106 } | 106 } |
107 | 107 |
| 108 metrics::MetricsService* IOSChromeMetricsServiceClient::GetMetricsService() { |
| 109 return metrics_service_.get(); |
| 110 } |
| 111 |
108 void IOSChromeMetricsServiceClient::SetMetricsClientId( | 112 void IOSChromeMetricsServiceClient::SetMetricsClientId( |
109 const std::string& client_id) { | 113 const std::string& client_id) { |
110 crash_keys::SetMetricsClientIdFromGUID(client_id); | 114 crash_keys::SetMetricsClientIdFromGUID(client_id); |
111 } | 115 } |
112 | 116 |
113 void IOSChromeMetricsServiceClient::OnRecordingDisabled() { | 117 void IOSChromeMetricsServiceClient::OnRecordingDisabled() { |
114 crash_keys::ClearMetricsClientId(); | 118 crash_keys::ClearMetricsClientId(); |
115 } | 119 } |
116 | 120 |
117 bool IOSChromeMetricsServiceClient::IsOffTheRecordSessionActive() { | 121 bool IOSChromeMetricsServiceClient::IsOffTheRecordSessionActive() { |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
318 base::Unretained(this))); | 322 base::Unretained(this))); |
319 } | 323 } |
320 | 324 |
321 void IOSChromeMetricsServiceClient::OnTabParented(web::WebState* web_state) { | 325 void IOSChromeMetricsServiceClient::OnTabParented(web::WebState* web_state) { |
322 metrics_service_->OnApplicationNotIdle(); | 326 metrics_service_->OnApplicationNotIdle(); |
323 } | 327 } |
324 | 328 |
325 void IOSChromeMetricsServiceClient::OnURLOpenedFromOmnibox(OmniboxLog* log) { | 329 void IOSChromeMetricsServiceClient::OnURLOpenedFromOmnibox(OmniboxLog* log) { |
326 metrics_service_->OnApplicationNotIdle(); | 330 metrics_service_->OnApplicationNotIdle(); |
327 } | 331 } |
OLD | NEW |