| 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/path_service.h" | 17 #include "base/path_service.h" |
| 18 #include "base/rand_util.h" | 18 #include "base/rand_util.h" |
| 19 #include "base/strings/string16.h" | 19 #include "base/strings/string16.h" |
| 20 #include "base/threading/platform_thread.h" | 20 #include "base/threading/platform_thread.h" |
| 21 #include "build/build_config.h" | 21 #include "build/build_config.h" |
| 22 #include "chrome/browser/browser_process.h" | 22 #include "chrome/browser/browser_process.h" |
| 23 #include "chrome/browser/chrome_notification_types.h" | 23 #include "chrome/browser/chrome_notification_types.h" |
| 24 #include "chrome/browser/google/google_brand.h" | 24 #include "chrome/browser/google/google_brand.h" |
| 25 #include "chrome/browser/metrics/chrome_stability_metrics_provider.h" | 25 #include "chrome/browser/metrics/chrome_stability_metrics_provider.h" |
| 26 #include "chrome/browser/metrics/time_ticks_experiment_win.h" | 26 #include "chrome/browser/metrics/time_ticks_experiment_win.h" |
| 27 #include "chrome/browser/sync/chrome_sync_client.h" | 27 #include "chrome/browser/sync/chrome_sync_client.h" |
| 28 #include "chrome/browser/ui/browser_otr_state.h" | 28 #include "chrome/browser/ui/browser_otr_state.h" |
| 29 #include "chrome/common/channel_info.h" | 29 #include "chrome/common/channel_info.h" |
| 30 #include "chrome/common/chrome_constants.h" | |
| 31 #include "chrome/common/chrome_paths.h" | 30 #include "chrome/common/chrome_paths.h" |
| 32 #include "chrome/common/chrome_switches.h" | 31 #include "chrome/common/chrome_switches.h" |
| 33 #include "chrome/common/crash_keys.h" | 32 #include "chrome/common/crash_keys.h" |
| 34 #include "chrome/common/features.h" | 33 #include "chrome/common/features.h" |
| 35 #include "chrome/installer/util/util_constants.h" | 34 #include "chrome/installer/util/util_constants.h" |
| 36 #include "components/metrics/call_stack_profile_metrics_provider.h" | 35 #include "components/metrics/call_stack_profile_metrics_provider.h" |
| 37 #include "components/metrics/drive_metrics_provider.h" | 36 #include "components/metrics/drive_metrics_provider.h" |
| 38 #include "components/metrics/file_metrics_provider.h" | 37 #include "components/metrics/file_metrics_provider.h" |
| 39 #include "components/metrics/gpu/gpu_metrics_provider.h" | 38 #include "components/metrics/gpu/gpu_metrics_provider.h" |
| 40 #include "components/metrics/metrics_pref_names.h" | 39 #include "components/metrics/metrics_pref_names.h" |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 #endif | 73 #endif |
| 75 | 74 |
| 76 #if defined(OS_CHROMEOS) | 75 #if defined(OS_CHROMEOS) |
| 77 #include "chrome/browser/metrics/chromeos_metrics_provider.h" | 76 #include "chrome/browser/metrics/chromeos_metrics_provider.h" |
| 78 #include "chrome/browser/signin/signin_status_metrics_provider_chromeos.h" | 77 #include "chrome/browser/signin/signin_status_metrics_provider_chromeos.h" |
| 79 #endif | 78 #endif |
| 80 | 79 |
| 81 #if defined(OS_WIN) | 80 #if defined(OS_WIN) |
| 82 #include <windows.h> | 81 #include <windows.h> |
| 83 #include "chrome/browser/metrics/google_update_metrics_provider_win.h" | 82 #include "chrome/browser/metrics/google_update_metrics_provider_win.h" |
| 83 #include "chrome/common/chrome_constants_util_win.h" |
| 84 #include "chrome/installer/util/browser_distribution.h" | 84 #include "chrome/installer/util/browser_distribution.h" |
| 85 #include "components/browser_watcher/watcher_metrics_provider_win.h" | 85 #include "components/browser_watcher/watcher_metrics_provider_win.h" |
| 86 #endif | 86 #endif |
| 87 | 87 |
| 88 #if !defined(OS_CHROMEOS) | 88 #if !defined(OS_CHROMEOS) |
| 89 #include "chrome/browser/signin/chrome_signin_status_metrics_provider_delegate.h
" | 89 #include "chrome/browser/signin/chrome_signin_status_metrics_provider_delegate.h
" |
| 90 #include "components/signin/core/browser/signin_status_metrics_provider.h" | 90 #include "components/signin/core/browser/signin_status_metrics_provider.h" |
| 91 #endif // !defined(OS_CHROMEOS) | 91 #endif // !defined(OS_CHROMEOS) |
| 92 | 92 |
| 93 namespace { | 93 namespace { |
| (...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 394 #endif // BUILDFLAG(ANDROID_JAVA_UI) | 394 #endif // BUILDFLAG(ANDROID_JAVA_UI) |
| 395 | 395 |
| 396 #if defined(OS_WIN) | 396 #if defined(OS_WIN) |
| 397 google_update_metrics_provider_ = new GoogleUpdateMetricsProviderWin; | 397 google_update_metrics_provider_ = new GoogleUpdateMetricsProviderWin; |
| 398 metrics_service_->RegisterMetricsProvider( | 398 metrics_service_->RegisterMetricsProvider( |
| 399 scoped_ptr<metrics::MetricsProvider>(google_update_metrics_provider_)); | 399 scoped_ptr<metrics::MetricsProvider>(google_update_metrics_provider_)); |
| 400 | 400 |
| 401 metrics_service_->RegisterMetricsProvider( | 401 metrics_service_->RegisterMetricsProvider( |
| 402 scoped_ptr<metrics::MetricsProvider>( | 402 scoped_ptr<metrics::MetricsProvider>( |
| 403 new browser_watcher::WatcherMetricsProviderWin( | 403 new browser_watcher::WatcherMetricsProviderWin( |
| 404 chrome::kBrowserExitCodesRegistryPath, | 404 chrome::GetBrowserExitCodesRegistryPath(), |
| 405 content::BrowserThread::GetBlockingPool()))); | 405 content::BrowserThread::GetBlockingPool()))); |
| 406 #endif // defined(OS_WIN) | 406 #endif // defined(OS_WIN) |
| 407 | 407 |
| 408 #if defined(ENABLE_PLUGINS) | 408 #if defined(ENABLE_PLUGINS) |
| 409 plugin_metrics_provider_ = | 409 plugin_metrics_provider_ = |
| 410 new PluginMetricsProvider(g_browser_process->local_state()); | 410 new PluginMetricsProvider(g_browser_process->local_state()); |
| 411 metrics_service_->RegisterMetricsProvider( | 411 metrics_service_->RegisterMetricsProvider( |
| 412 scoped_ptr<metrics::MetricsProvider>(plugin_metrics_provider_)); | 412 scoped_ptr<metrics::MetricsProvider>(plugin_metrics_provider_)); |
| 413 #endif // defined(ENABLE_PLUGINS) | 413 #endif // defined(ENABLE_PLUGINS) |
| 414 | 414 |
| (...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 664 break; | 664 break; |
| 665 | 665 |
| 666 default: | 666 default: |
| 667 NOTREACHED(); | 667 NOTREACHED(); |
| 668 } | 668 } |
| 669 } | 669 } |
| 670 | 670 |
| 671 void ChromeMetricsServiceClient::OnURLOpenedFromOmnibox(OmniboxLog* log) { | 671 void ChromeMetricsServiceClient::OnURLOpenedFromOmnibox(OmniboxLog* log) { |
| 672 metrics_service_->OnApplicationNotIdle(); | 672 metrics_service_->OnApplicationNotIdle(); |
| 673 } | 673 } |
| OLD | NEW |