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 "chromecast/browser/metrics/cast_metrics_service_client.h" | 5 #include "chromecast/browser/metrics/cast_metrics_service_client.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/guid.h" | 8 #include "base/guid.h" |
9 #include "base/i18n/rtl.h" | 9 #include "base/i18n/rtl.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
266 request_context_(request_context) { | 266 request_context_(request_context) { |
267 } | 267 } |
268 | 268 |
269 CastMetricsServiceClient::~CastMetricsServiceClient() { | 269 CastMetricsServiceClient::~CastMetricsServiceClient() { |
270 #if defined(OS_LINUX) | 270 #if defined(OS_LINUX) |
271 DCHECK(!external_metrics_); | 271 DCHECK(!external_metrics_); |
272 DCHECK(!platform_metrics_); | 272 DCHECK(!platform_metrics_); |
273 #endif // defined(OS_LINUX) | 273 #endif // defined(OS_LINUX) |
274 } | 274 } |
275 | 275 |
| 276 void CastMetricsServiceClient::OnApplicationNotIdle() { |
| 277 metrics_service_->OnApplicationNotIdle(); |
| 278 } |
| 279 |
276 void CastMetricsServiceClient::Initialize(CastService* cast_service) { | 280 void CastMetricsServiceClient::Initialize(CastService* cast_service) { |
277 DCHECK(cast_service); | 281 DCHECK(cast_service); |
278 DCHECK(!cast_service_); | 282 DCHECK(!cast_service_); |
279 cast_service_ = cast_service; | 283 cast_service_ = cast_service; |
280 | 284 |
281 metrics_state_manager_ = ::metrics::MetricsStateManager::Create( | 285 metrics_state_manager_ = ::metrics::MetricsStateManager::Create( |
282 pref_service_, | 286 pref_service_, |
283 base::Bind(&CastMetricsServiceClient::IsReportingEnabled, | 287 base::Bind(&CastMetricsServiceClient::IsReportingEnabled, |
284 base::Unretained(this)), | 288 base::Unretained(this)), |
285 base::Bind(&CastMetricsServiceClient::StoreClientInfo, | 289 base::Bind(&CastMetricsServiceClient::StoreClientInfo, |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
355 #endif // defined(OS_LINUX) | 359 #endif // defined(OS_LINUX) |
356 metrics_service_->Stop(); | 360 metrics_service_->Stop(); |
357 } | 361 } |
358 | 362 |
359 bool CastMetricsServiceClient::IsReportingEnabled() { | 363 bool CastMetricsServiceClient::IsReportingEnabled() { |
360 return pref_service_->GetBoolean(prefs::kOptInStats); | 364 return pref_service_->GetBoolean(prefs::kOptInStats); |
361 } | 365 } |
362 | 366 |
363 } // namespace metrics | 367 } // namespace metrics |
364 } // namespace chromecast | 368 } // namespace chromecast |
OLD | NEW |