| 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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 #endif | 98 #endif |
| 99 | 99 |
| 100 #if defined(OS_WIN) | 100 #if defined(OS_WIN) |
| 101 #include <windows.h> | 101 #include <windows.h> |
| 102 | 102 |
| 103 #include "chrome/browser/metrics/antivirus_metrics_provider_win.h" | 103 #include "chrome/browser/metrics/antivirus_metrics_provider_win.h" |
| 104 #include "chrome/browser/metrics/google_update_metrics_provider_win.h" | 104 #include "chrome/browser/metrics/google_update_metrics_provider_win.h" |
| 105 #include "chrome/common/metrics_constants_util_win.h" | 105 #include "chrome/common/metrics_constants_util_win.h" |
| 106 #include "chrome/install_static/install_util.h" | 106 #include "chrome/install_static/install_util.h" |
| 107 #include "chrome/installer/util/browser_distribution.h" | 107 #include "chrome/installer/util/browser_distribution.h" |
| 108 #include "components/browser_watcher/stability_debugging_win.h" |
| 108 #include "components/browser_watcher/watcher_metrics_provider_win.h" | 109 #include "components/browser_watcher/watcher_metrics_provider_win.h" |
| 109 #endif | 110 #endif |
| 110 | 111 |
| 111 #if defined(OS_WIN) || defined(OS_MACOSX) | 112 #if defined(OS_WIN) || defined(OS_MACOSX) |
| 112 #include "third_party/crashpad/crashpad/client/crashpad_info.h" | 113 #include "third_party/crashpad/crashpad/client/crashpad_info.h" |
| 113 #endif | 114 #endif |
| 114 | 115 |
| 115 #if !defined(OS_CHROMEOS) | 116 #if !defined(OS_CHROMEOS) |
| 116 #include "chrome/browser/signin/chrome_signin_status_metrics_provider_delegate.h
" | 117 #include "chrome/browser/signin/chrome_signin_status_metrics_provider_delegate.h
" |
| 117 #include "components/signin/core/browser/signin_status_metrics_provider.h" | 118 #include "components/signin/core/browser/signin_status_metrics_provider.h" |
| (...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 387 #endif // OS_WIN || OS_MACOSX | 388 #endif // OS_WIN || OS_MACOSX |
| 388 } | 389 } |
| 389 | 390 |
| 390 void ChromeMetricsServiceClient::OnLogUploadComplete() { | 391 void ChromeMetricsServiceClient::OnLogUploadComplete() { |
| 391 // Collect time ticks stats after each UMA upload. | 392 // Collect time ticks stats after each UMA upload. |
| 392 #if defined(OS_WIN) | 393 #if defined(OS_WIN) |
| 393 chrome::CollectTimeTicksStats(); | 394 chrome::CollectTimeTicksStats(); |
| 394 #endif | 395 #endif |
| 395 } | 396 } |
| 396 | 397 |
| 398 void ChromeMetricsServiceClient::OnLogCleanShutdown() { |
| 399 #if defined(OS_WIN) |
| 400 base::FilePath user_data_dir; |
| 401 if (!base::PathService::Get(chrome::DIR_USER_DATA, &user_data_dir)) { |
| 402 // TODO(manzagop): add a metric. |
| 403 return; |
| 404 } |
| 405 browser_watcher::MarkStabilityFileForDeletion(user_data_dir); |
| 406 #endif // OS_WIN |
| 407 } |
| 408 |
| 397 void ChromeMetricsServiceClient::InitializeSystemProfileMetrics( | 409 void ChromeMetricsServiceClient::InitializeSystemProfileMetrics( |
| 398 const base::Closure& done_callback) { | 410 const base::Closure& done_callback) { |
| 399 DCHECK(initialize_task_queue_.empty()); | 411 DCHECK(initialize_task_queue_.empty()); |
| 400 | 412 |
| 401 // Each provider's initializer takes its own "done_callback" to enable | 413 // Each provider's initializer takes its own "done_callback" to enable |
| 402 // asynchronously chaining. We bind |next_task| to this callback, so | 414 // asynchronously chaining. We bind |next_task| to this callback, so |
| 403 // OnInitNextTask() gets called after each initializer, and we can go through | 415 // OnInitNextTask() gets called after each initializer, and we can go through |
| 404 // successive tasks in |initialize_task_queue_|. Note that |next_task| is | 416 // successive tasks in |initialize_task_queue_|. Note that |next_task| is |
| 405 // copied by value when passed into base::Bind(). | 417 // copied by value when passed into base::Bind(). |
| 406 base::Closure next_task = | 418 base::Closure next_task = |
| (...skipping 472 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 879 } | 891 } |
| 880 } | 892 } |
| 881 | 893 |
| 882 void ChromeMetricsServiceClient::OnURLOpenedFromOmnibox(OmniboxLog* log) { | 894 void ChromeMetricsServiceClient::OnURLOpenedFromOmnibox(OmniboxLog* log) { |
| 883 metrics_service_->OnApplicationNotIdle(); | 895 metrics_service_->OnApplicationNotIdle(); |
| 884 } | 896 } |
| 885 | 897 |
| 886 bool ChromeMetricsServiceClient::IsUMACellularUploadLogicEnabled() { | 898 bool ChromeMetricsServiceClient::IsUMACellularUploadLogicEnabled() { |
| 887 return metrics::IsCellularLogicEnabled(); | 899 return metrics::IsCellularLogicEnabled(); |
| 888 } | 900 } |
| OLD | NEW |