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/chrome_metrics_service_client.h" | 5 #include "chrome/browser/metrics/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 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
172 | 172 |
173 #if defined(OS_ANDROID) | 173 #if defined(OS_ANDROID) |
174 AndroidMetricsProvider::RegisterPrefs(registry); | 174 AndroidMetricsProvider::RegisterPrefs(registry); |
175 #endif // defined(OS_ANDROID) | 175 #endif // defined(OS_ANDROID) |
176 | 176 |
177 #if defined(ENABLE_PLUGINS) | 177 #if defined(ENABLE_PLUGINS) |
178 PluginMetricsProvider::RegisterPrefs(registry); | 178 PluginMetricsProvider::RegisterPrefs(registry); |
179 #endif // defined(ENABLE_PLUGINS) | 179 #endif // defined(ENABLE_PLUGINS) |
180 } | 180 } |
181 | 181 |
182 metrics::MetricsService* ChromeMetricsServiceClient::GetMetricsService() { | |
183 return metrics_service_.get(); | |
184 } | |
185 | |
186 void ChromeMetricsServiceClient::SetMetricsClientId( | 182 void ChromeMetricsServiceClient::SetMetricsClientId( |
187 const std::string& client_id) { | 183 const std::string& client_id) { |
188 crash_keys::SetMetricsClientIdFromGUID(client_id); | 184 crash_keys::SetMetricsClientIdFromGUID(client_id); |
189 } | 185 } |
190 | 186 |
191 void ChromeMetricsServiceClient::OnRecordingDisabled() { | 187 void ChromeMetricsServiceClient::OnRecordingDisabled() { |
192 crash_keys::ClearMetricsClientId(); | 188 crash_keys::ClearMetricsClientId(); |
193 } | 189 } |
194 | 190 |
195 bool ChromeMetricsServiceClient::IsOffTheRecordSessionActive() { | 191 bool ChromeMetricsServiceClient::IsOffTheRecordSessionActive() { |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
273 } | 269 } |
274 | 270 |
275 base::string16 ChromeMetricsServiceClient::GetRegistryBackupKey() { | 271 base::string16 ChromeMetricsServiceClient::GetRegistryBackupKey() { |
276 #if defined(OS_WIN) | 272 #if defined(OS_WIN) |
277 return L"Software\\" PRODUCT_STRING_PATH L"\\StabilityMetrics"; | 273 return L"Software\\" PRODUCT_STRING_PATH L"\\StabilityMetrics"; |
278 #else | 274 #else |
279 return base::string16(); | 275 return base::string16(); |
280 #endif | 276 #endif |
281 } | 277 } |
282 | 278 |
283 void ChromeMetricsServiceClient::OnPluginLoadingError( | 279 void ChromeMetricsServiceClient::LogPluginLoadingError( |
284 const base::FilePath& plugin_path) { | 280 const base::FilePath& plugin_path) { |
285 #if defined(ENABLE_PLUGINS) | 281 #if defined(ENABLE_PLUGINS) |
286 plugin_metrics_provider_->LogPluginLoadingError(plugin_path); | 282 plugin_metrics_provider_->LogPluginLoadingError(plugin_path); |
287 #else | 283 #else |
288 NOTREACHED(); | 284 NOTREACHED(); |
289 #endif // defined(ENABLE_PLUGINS) | 285 #endif // defined(ENABLE_PLUGINS) |
290 } | 286 } |
291 | 287 |
292 void ChromeMetricsServiceClient::Initialize() { | 288 void ChromeMetricsServiceClient::Initialize() { |
293 // Clear metrics reports if it is the first time cellular upload logic should | 289 // Clear metrics reports if it is the first time cellular upload logic should |
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
603 break; | 599 break; |
604 | 600 |
605 default: | 601 default: |
606 NOTREACHED(); | 602 NOTREACHED(); |
607 } | 603 } |
608 } | 604 } |
609 | 605 |
610 void ChromeMetricsServiceClient::OnURLOpenedFromOmnibox(OmniboxLog* log) { | 606 void ChromeMetricsServiceClient::OnURLOpenedFromOmnibox(OmniboxLog* log) { |
611 metrics_service_->OnApplicationNotIdle(); | 607 metrics_service_->OnApplicationNotIdle(); |
612 } | 608 } |
OLD | NEW |