| 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 <utility> | 9 #include <utility> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 #include "components/metrics/url_constants.h" | 65 #include "components/metrics/url_constants.h" |
| 66 #include "components/omnibox/browser/omnibox_metrics_provider.h" | 66 #include "components/omnibox/browser/omnibox_metrics_provider.h" |
| 67 #include "components/prefs/pref_registry_simple.h" | 67 #include "components/prefs/pref_registry_simple.h" |
| 68 #include "components/prefs/pref_service.h" | 68 #include "components/prefs/pref_service.h" |
| 69 #include "components/sync/device_info/device_count_metrics_provider.h" | 69 #include "components/sync/device_info/device_count_metrics_provider.h" |
| 70 #include "components/translate/core/browser/translate_ranker_metrics_provider.h" | 70 #include "components/translate/core/browser/translate_ranker_metrics_provider.h" |
| 71 #include "components/version_info/version_info.h" | 71 #include "components/version_info/version_info.h" |
| 72 #include "content/public/browser/browser_thread.h" | 72 #include "content/public/browser/browser_thread.h" |
| 73 #include "content/public/browser/histogram_fetcher.h" | 73 #include "content/public/browser/histogram_fetcher.h" |
| 74 #include "content/public/browser/notification_service.h" | 74 #include "content/public/browser/notification_service.h" |
| 75 #include "printing/features/features.h" |
| 75 | 76 |
| 76 #if BUILDFLAG(ANDROID_JAVA_UI) | 77 #if BUILDFLAG(ANDROID_JAVA_UI) |
| 77 #include "chrome/browser/metrics/android_metrics_provider.h" | 78 #include "chrome/browser/metrics/android_metrics_provider.h" |
| 78 #include "chrome/browser/metrics/page_load_metrics_provider.h" | 79 #include "chrome/browser/metrics/page_load_metrics_provider.h" |
| 79 #endif | 80 #endif |
| 80 | 81 |
| 81 #if defined(ENABLE_PRINT_PREVIEW) | 82 #if BUILDFLAG(ENABLE_PRINT_PREVIEW) |
| 82 #include "chrome/browser/service_process/service_process_control.h" | 83 #include "chrome/browser/service_process/service_process_control.h" |
| 83 #endif | 84 #endif |
| 84 | 85 |
| 85 #if defined(ENABLE_EXTENSIONS) | 86 #if defined(ENABLE_EXTENSIONS) |
| 86 #include "chrome/browser/metrics/extensions_metrics_provider.h" | 87 #include "chrome/browser/metrics/extensions_metrics_provider.h" |
| 87 #endif | 88 #endif |
| 88 | 89 |
| 89 #if defined(ENABLE_PLUGINS) | 90 #if defined(ENABLE_PLUGINS) |
| 90 #include "chrome/browser/metrics/plugin_metrics_provider.h" | 91 #include "chrome/browser/metrics/plugin_metrics_provider.h" |
| 91 #endif | 92 #endif |
| (...skipping 663 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 755 // Create a callback_task for OnHistogramSynchronizationDone. | 756 // Create a callback_task for OnHistogramSynchronizationDone. |
| 756 base::Closure callback = base::Bind( | 757 base::Closure callback = base::Bind( |
| 757 &ChromeMetricsServiceClient::OnHistogramSynchronizationDone, | 758 &ChromeMetricsServiceClient::OnHistogramSynchronizationDone, |
| 758 weak_ptr_factory_.GetWeakPtr()); | 759 weak_ptr_factory_.GetWeakPtr()); |
| 759 | 760 |
| 760 base::TimeDelta timeout = | 761 base::TimeDelta timeout = |
| 761 base::TimeDelta::FromMilliseconds(kMaxHistogramGatheringWaitDuration); | 762 base::TimeDelta::FromMilliseconds(kMaxHistogramGatheringWaitDuration); |
| 762 | 763 |
| 763 DCHECK_EQ(num_async_histogram_fetches_in_progress_, 0); | 764 DCHECK_EQ(num_async_histogram_fetches_in_progress_, 0); |
| 764 | 765 |
| 765 #if !defined(ENABLE_PRINT_PREVIEW) | 766 #if !BUILDFLAG(ENABLE_PRINT_PREVIEW) |
| 766 num_async_histogram_fetches_in_progress_ = 2; | 767 num_async_histogram_fetches_in_progress_ = 2; |
| 767 #else // !ENABLE_PRINT_PREVIEW | 768 #else // !ENABLE_PRINT_PREVIEW |
| 768 num_async_histogram_fetches_in_progress_ = 3; | 769 num_async_histogram_fetches_in_progress_ = 3; |
| 769 // Run requests to service and content in parallel. | 770 // Run requests to service and content in parallel. |
| 770 if (!ServiceProcessControl::GetInstance()->GetHistograms(callback, timeout)) { | 771 if (!ServiceProcessControl::GetInstance()->GetHistograms(callback, timeout)) { |
| 771 // Assume |num_async_histogram_fetches_in_progress_| is not changed by | 772 // Assume |num_async_histogram_fetches_in_progress_| is not changed by |
| 772 // |GetHistograms()|. | 773 // |GetHistograms()|. |
| 773 DCHECK_EQ(num_async_histogram_fetches_in_progress_, 3); | 774 DCHECK_EQ(num_async_histogram_fetches_in_progress_, 3); |
| 774 // Assign |num_async_histogram_fetches_in_progress_| above and decrement it | 775 // Assign |num_async_histogram_fetches_in_progress_| above and decrement it |
| 775 // here to make code work even if |GetHistograms()| fired |callback|. | 776 // here to make code work even if |GetHistograms()| fired |callback|. |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 877 } | 878 } |
| 878 } | 879 } |
| 879 | 880 |
| 880 void ChromeMetricsServiceClient::OnURLOpenedFromOmnibox(OmniboxLog* log) { | 881 void ChromeMetricsServiceClient::OnURLOpenedFromOmnibox(OmniboxLog* log) { |
| 881 metrics_service_->OnApplicationNotIdle(); | 882 metrics_service_->OnApplicationNotIdle(); |
| 882 } | 883 } |
| 883 | 884 |
| 884 bool ChromeMetricsServiceClient::IsUMACellularUploadLogicEnabled() { | 885 bool ChromeMetricsServiceClient::IsUMACellularUploadLogicEnabled() { |
| 885 return metrics::IsCellularLogicEnabled(); | 886 return metrics::IsCellularLogicEnabled(); |
| 886 } | 887 } |
| OLD | NEW |