| 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 |
| 11 #include "base/bind.h" | 11 #include "base/bind.h" |
| 12 #include "base/callback.h" | 12 #include "base/callback.h" |
| 13 #include "base/command_line.h" | 13 #include "base/command_line.h" |
| 14 #include "base/files/file_path.h" | 14 #include "base/files/file_path.h" |
| 15 #include "base/logging.h" | 15 #include "base/logging.h" |
| 16 #include "base/metrics/histogram.h" | 16 #include "base/metrics/histogram.h" |
| 17 #include "base/rand_util.h" | 17 #include "base/rand_util.h" |
| 18 #include "base/strings/string16.h" | 18 #include "base/strings/string16.h" |
| 19 #include "base/threading/platform_thread.h" | 19 #include "base/threading/platform_thread.h" |
| 20 #include "build/build_config.h" | 20 #include "build/build_config.h" |
| 21 #include "chrome/browser/browser_process.h" | 21 #include "chrome/browser/browser_process.h" |
| 22 #include "chrome/browser/chrome_notification_types.h" | 22 #include "chrome/browser/chrome_notification_types.h" |
| 23 #include "chrome/browser/google/google_brand.h" | 23 #include "chrome/browser/google/google_brand.h" |
| 24 #include "chrome/browser/metrics/chrome_stability_metrics_provider.h" | 24 #include "chrome/browser/metrics/chrome_stability_metrics_provider.h" |
| 25 #include "chrome/browser/metrics/time_ticks_experiment_win.h" | 25 #include "chrome/browser/metrics/time_ticks_experiment_win.h" |
| 26 #include "chrome/browser/ui/browser_otr_state.h" | 26 #include "chrome/browser/ui/browser_otr_state.h" |
| 27 #include "chrome/common/channel_info.h" | 27 #include "chrome/common/channel_info.h" |
| 28 #include "chrome/common/chrome_constants.h" | |
| 29 #include "chrome/common/chrome_paths.h" | 28 #include "chrome/common/chrome_paths.h" |
| 30 #include "chrome/common/chrome_switches.h" | 29 #include "chrome/common/chrome_switches.h" |
| 31 #include "chrome/common/crash_keys.h" | 30 #include "chrome/common/crash_keys.h" |
| 32 #include "chrome/common/features.h" | 31 #include "chrome/common/features.h" |
| 33 #include "components/metrics/call_stack_profile_metrics_provider.h" | 32 #include "components/metrics/call_stack_profile_metrics_provider.h" |
| 34 #include "components/metrics/drive_metrics_provider.h" | 33 #include "components/metrics/drive_metrics_provider.h" |
| 35 #include "components/metrics/gpu/gpu_metrics_provider.h" | 34 #include "components/metrics/gpu/gpu_metrics_provider.h" |
| 36 #include "components/metrics/metrics_pref_names.h" | 35 #include "components/metrics/metrics_pref_names.h" |
| 37 #include "components/metrics/metrics_service.h" | 36 #include "components/metrics/metrics_service.h" |
| 38 #include "components/metrics/net/net_metrics_log_uploader.h" | 37 #include "components/metrics/net/net_metrics_log_uploader.h" |
| (...skipping 30 matching lines...) Expand all Loading... |
| 69 #endif | 68 #endif |
| 70 | 69 |
| 71 #if defined(OS_CHROMEOS) | 70 #if defined(OS_CHROMEOS) |
| 72 #include "chrome/browser/metrics/chromeos_metrics_provider.h" | 71 #include "chrome/browser/metrics/chromeos_metrics_provider.h" |
| 73 #include "chrome/browser/signin/signin_status_metrics_provider_chromeos.h" | 72 #include "chrome/browser/signin/signin_status_metrics_provider_chromeos.h" |
| 74 #endif | 73 #endif |
| 75 | 74 |
| 76 #if defined(OS_WIN) | 75 #if defined(OS_WIN) |
| 77 #include <windows.h> | 76 #include <windows.h> |
| 78 #include "chrome/browser/metrics/google_update_metrics_provider_win.h" | 77 #include "chrome/browser/metrics/google_update_metrics_provider_win.h" |
| 78 #include "chrome/common/chrome_constants_util_win.h" |
| 79 #include "chrome/installer/util/browser_distribution.h" | 79 #include "chrome/installer/util/browser_distribution.h" |
| 80 #include "components/browser_watcher/watcher_metrics_provider_win.h" | 80 #include "components/browser_watcher/watcher_metrics_provider_win.h" |
| 81 #endif | 81 #endif |
| 82 | 82 |
| 83 #if !defined(OS_CHROMEOS) | 83 #if !defined(OS_CHROMEOS) |
| 84 #include "chrome/browser/signin/chrome_signin_status_metrics_provider_delegate.h
" | 84 #include "chrome/browser/signin/chrome_signin_status_metrics_provider_delegate.h
" |
| 85 #include "components/signin/core/browser/signin_status_metrics_provider.h" | 85 #include "components/signin/core/browser/signin_status_metrics_provider.h" |
| 86 #endif // !defined(OS_CHROMEOS) | 86 #endif // !defined(OS_CHROMEOS) |
| 87 | 87 |
| 88 namespace { | 88 namespace { |
| (...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 358 #endif // BUILDFLAG(ANDROID_JAVA_UI) | 358 #endif // BUILDFLAG(ANDROID_JAVA_UI) |
| 359 | 359 |
| 360 #if defined(OS_WIN) | 360 #if defined(OS_WIN) |
| 361 google_update_metrics_provider_ = new GoogleUpdateMetricsProviderWin; | 361 google_update_metrics_provider_ = new GoogleUpdateMetricsProviderWin; |
| 362 metrics_service_->RegisterMetricsProvider( | 362 metrics_service_->RegisterMetricsProvider( |
| 363 scoped_ptr<metrics::MetricsProvider>(google_update_metrics_provider_)); | 363 scoped_ptr<metrics::MetricsProvider>(google_update_metrics_provider_)); |
| 364 | 364 |
| 365 metrics_service_->RegisterMetricsProvider( | 365 metrics_service_->RegisterMetricsProvider( |
| 366 scoped_ptr<metrics::MetricsProvider>( | 366 scoped_ptr<metrics::MetricsProvider>( |
| 367 new browser_watcher::WatcherMetricsProviderWin( | 367 new browser_watcher::WatcherMetricsProviderWin( |
| 368 chrome::kBrowserExitCodesRegistryPath, | 368 chrome::GetBrowserExitCodesRegistryPath(), |
| 369 content::BrowserThread::GetBlockingPool()))); | 369 content::BrowserThread::GetBlockingPool()))); |
| 370 #endif // defined(OS_WIN) | 370 #endif // defined(OS_WIN) |
| 371 | 371 |
| 372 #if defined(ENABLE_PLUGINS) | 372 #if defined(ENABLE_PLUGINS) |
| 373 plugin_metrics_provider_ = | 373 plugin_metrics_provider_ = |
| 374 new PluginMetricsProvider(g_browser_process->local_state()); | 374 new PluginMetricsProvider(g_browser_process->local_state()); |
| 375 metrics_service_->RegisterMetricsProvider( | 375 metrics_service_->RegisterMetricsProvider( |
| 376 scoped_ptr<metrics::MetricsProvider>(plugin_metrics_provider_)); | 376 scoped_ptr<metrics::MetricsProvider>(plugin_metrics_provider_)); |
| 377 #endif // defined(ENABLE_PLUGINS) | 377 #endif // defined(ENABLE_PLUGINS) |
| 378 | 378 |
| (...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 611 break; | 611 break; |
| 612 | 612 |
| 613 default: | 613 default: |
| 614 NOTREACHED(); | 614 NOTREACHED(); |
| 615 } | 615 } |
| 616 } | 616 } |
| 617 | 617 |
| 618 void ChromeMetricsServiceClient::OnURLOpenedFromOmnibox(OmniboxLog* log) { | 618 void ChromeMetricsServiceClient::OnURLOpenedFromOmnibox(OmniboxLog* log) { |
| 619 metrics_service_->OnApplicationNotIdle(); | 619 metrics_service_->OnApplicationNotIdle(); |
| 620 } | 620 } |
| OLD | NEW |