| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_services_manager_client.h" | 5 #include "chrome/browser/metrics/chrome_metrics_services_manager_client.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/feature_list.h" | 8 #include "base/feature_list.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
| (...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 239 | 239 |
| 240 net::URLRequestContextGetter* | 240 net::URLRequestContextGetter* |
| 241 ChromeMetricsServicesManagerClient::GetURLRequestContext() { | 241 ChromeMetricsServicesManagerClient::GetURLRequestContext() { |
| 242 return g_browser_process->system_request_context(); | 242 return g_browser_process->system_request_context(); |
| 243 } | 243 } |
| 244 | 244 |
| 245 bool ChromeMetricsServicesManagerClient::IsMetricsReportingEnabled() { | 245 bool ChromeMetricsServicesManagerClient::IsMetricsReportingEnabled() { |
| 246 return enabled_state_provider_->IsReportingEnabled(); | 246 return enabled_state_provider_->IsReportingEnabled(); |
| 247 } | 247 } |
| 248 | 248 |
| 249 bool ChromeMetricsServicesManagerClient::OnlyDoMetricsRecording() { | |
| 250 const base::CommandLine* cmdline = base::CommandLine::ForCurrentProcess(); | |
| 251 return cmdline->HasSwitch(switches::kMetricsRecordingOnly) || | |
| 252 cmdline->HasSwitch(switches::kEnableBenchmarking); | |
| 253 } | |
| 254 | |
| 255 #if defined(OS_WIN) | 249 #if defined(OS_WIN) |
| 256 void ChromeMetricsServicesManagerClient::UpdateRunningServices( | 250 void ChromeMetricsServicesManagerClient::UpdateRunningServices( |
| 257 bool may_record, | 251 bool may_record, |
| 258 bool may_upload) { | 252 bool may_upload) { |
| 259 // First, set the registry value so that Crashpad will have the sampling state | 253 // First, set the registry value so that Crashpad will have the sampling state |
| 260 // now and for subsequent runs. | 254 // now and for subsequent runs. |
| 261 install_static::SetCollectStatsInSample(IsClientInSample()); | 255 install_static::SetCollectStatsInSample(IsClientInSample()); |
| 262 | 256 |
| 263 // Next, get Crashpad to pick up the sampling state for this session. | 257 // Next, get Crashpad to pick up the sampling state for this session. |
| 264 | 258 |
| (...skipping 20 matching lines...) Expand all Loading... |
| 285 local_state_, enabled_state_provider_.get(), | 279 local_state_, enabled_state_provider_.get(), |
| 286 base::Bind(&PostStoreMetricsClientInfo), | 280 base::Bind(&PostStoreMetricsClientInfo), |
| 287 base::Bind(&GoogleUpdateSettings::LoadMetricsClientInfo)); | 281 base::Bind(&GoogleUpdateSettings::LoadMetricsClientInfo)); |
| 288 } | 282 } |
| 289 return metrics_state_manager_.get(); | 283 return metrics_state_manager_.get(); |
| 290 } | 284 } |
| 291 | 285 |
| 292 bool ChromeMetricsServicesManagerClient::IsMetricsReportingForceEnabled() { | 286 bool ChromeMetricsServicesManagerClient::IsMetricsReportingForceEnabled() { |
| 293 return ChromeMetricsServiceClient::IsMetricsReportingForceEnabled(); | 287 return ChromeMetricsServiceClient::IsMetricsReportingForceEnabled(); |
| 294 } | 288 } |
| OLD | NEW |