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