| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 #include "base/strings/string16.h" | 22 #include "base/strings/string16.h" |
| 23 #include "base/threading/platform_thread.h" | 23 #include "base/threading/platform_thread.h" |
| 24 #include "build/build_config.h" | 24 #include "build/build_config.h" |
| 25 #include "chrome/browser/browser_process.h" | 25 #include "chrome/browser/browser_process.h" |
| 26 #include "chrome/browser/chrome_notification_types.h" | 26 #include "chrome/browser/chrome_notification_types.h" |
| 27 #include "chrome/browser/google/google_brand.h" | 27 #include "chrome/browser/google/google_brand.h" |
| 28 #include "chrome/browser/metrics/chrome_metrics_service_accessor.h" | 28 #include "chrome/browser/metrics/chrome_metrics_service_accessor.h" |
| 29 #include "chrome/browser/metrics/chrome_stability_metrics_provider.h" | 29 #include "chrome/browser/metrics/chrome_stability_metrics_provider.h" |
| 30 #include "chrome/browser/metrics/https_engagement_metrics_provider.h" | 30 #include "chrome/browser/metrics/https_engagement_metrics_provider.h" |
| 31 #include "chrome/browser/metrics/metrics_reporting_state.h" | 31 #include "chrome/browser/metrics/metrics_reporting_state.h" |
| 32 #include "chrome/browser/metrics/page_load_metrics_provider.h" |
| 32 #include "chrome/browser/metrics/subprocess_metrics_provider.h" | 33 #include "chrome/browser/metrics/subprocess_metrics_provider.h" |
| 33 #include "chrome/browser/metrics/time_ticks_experiment_win.h" | 34 #include "chrome/browser/metrics/time_ticks_experiment_win.h" |
| 34 #include "chrome/browser/sync/chrome_sync_client.h" | 35 #include "chrome/browser/sync/chrome_sync_client.h" |
| 35 #include "chrome/browser/ui/browser_otr_state.h" | 36 #include "chrome/browser/ui/browser_otr_state.h" |
| 36 #include "chrome/common/channel_info.h" | 37 #include "chrome/common/channel_info.h" |
| 37 #include "chrome/common/chrome_paths.h" | 38 #include "chrome/common/chrome_paths.h" |
| 38 #include "chrome/common/chrome_switches.h" | 39 #include "chrome/common/chrome_switches.h" |
| 39 #include "chrome/common/crash_keys.h" | 40 #include "chrome/common/crash_keys.h" |
| 40 #include "chrome/common/features.h" | 41 #include "chrome/common/features.h" |
| 41 #include "chrome/installer/util/util_constants.h" | 42 #include "chrome/installer/util/util_constants.h" |
| (...skipping 479 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 521 | 522 |
| 522 metrics_service_->RegisterMetricsProvider( | 523 metrics_service_->RegisterMetricsProvider( |
| 523 std::unique_ptr<metrics::MetricsProvider>( | 524 std::unique_ptr<metrics::MetricsProvider>( |
| 524 new sync_driver::DeviceCountMetricsProvider(base::Bind( | 525 new sync_driver::DeviceCountMetricsProvider(base::Bind( |
| 525 &browser_sync::ChromeSyncClient::GetDeviceInfoTrackers)))); | 526 &browser_sync::ChromeSyncClient::GetDeviceInfoTrackers)))); |
| 526 | 527 |
| 527 metrics_service_->RegisterMetricsProvider( | 528 metrics_service_->RegisterMetricsProvider( |
| 528 std::unique_ptr<metrics::MetricsProvider>( | 529 std::unique_ptr<metrics::MetricsProvider>( |
| 529 new HttpsEngagementMetricsProvider())); | 530 new HttpsEngagementMetricsProvider())); |
| 530 | 531 |
| 532 metrics_service_->RegisterMetricsProvider( |
| 533 std::unique_ptr<metrics::MetricsProvider>(new PageLoadMetricsProvider())); |
| 534 |
| 531 // Clear stability metrics if it is the first time cellular upload logic | 535 // Clear stability metrics if it is the first time cellular upload logic |
| 532 // should apply to avoid sudden bulk uploads. It needs to be done after all | 536 // should apply to avoid sudden bulk uploads. It needs to be done after all |
| 533 // providers are registered. | 537 // providers are registered. |
| 534 if (ShouldClearSavedMetrics()) | 538 if (ShouldClearSavedMetrics()) |
| 535 metrics_service_->ClearSavedStabilityMetrics(); | 539 metrics_service_->ClearSavedStabilityMetrics(); |
| 536 } | 540 } |
| 537 | 541 |
| 538 void ChromeMetricsServiceClient::OnInitTaskGotHardwareClass() { | 542 void ChromeMetricsServiceClient::OnInitTaskGotHardwareClass() { |
| 539 const base::Closure got_bluetooth_adapter_callback = | 543 const base::Closure got_bluetooth_adapter_callback = |
| 540 base::Bind(&ChromeMetricsServiceClient::OnInitTaskGotBluetoothAdapter, | 544 base::Bind(&ChromeMetricsServiceClient::OnInitTaskGotBluetoothAdapter, |
| (...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 771 } | 775 } |
| 772 } | 776 } |
| 773 | 777 |
| 774 void ChromeMetricsServiceClient::OnURLOpenedFromOmnibox(OmniboxLog* log) { | 778 void ChromeMetricsServiceClient::OnURLOpenedFromOmnibox(OmniboxLog* log) { |
| 775 metrics_service_->OnApplicationNotIdle(); | 779 metrics_service_->OnApplicationNotIdle(); |
| 776 } | 780 } |
| 777 | 781 |
| 778 bool ChromeMetricsServiceClient::IsUMACellularUploadLogicEnabled() { | 782 bool ChromeMetricsServiceClient::IsUMACellularUploadLogicEnabled() { |
| 779 return metrics::IsCellularLogicEnabled(); | 783 return metrics::IsCellularLogicEnabled(); |
| 780 } | 784 } |
| OLD | NEW |