| 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/prefs/pref_service.h" | 10 #include "base/prefs/pref_service.h" |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 request_context)); | 45 request_context)); |
| 46 } | 46 } |
| 47 | 47 |
| 48 void CastMetricsServiceClient::SetMetricsClientId( | 48 void CastMetricsServiceClient::SetMetricsClientId( |
| 49 const std::string& client_id) { | 49 const std::string& client_id) { |
| 50 client_id_ = client_id; | 50 client_id_ = client_id; |
| 51 LOG(INFO) << "Metrics client ID set: " << client_id; | 51 LOG(INFO) << "Metrics client ID set: " << client_id; |
| 52 PlatformSetClientID(cast_service_, client_id); | 52 PlatformSetClientID(cast_service_, client_id); |
| 53 } | 53 } |
| 54 | 54 |
| 55 void CastMetricsServiceClient::OnRecordingDisabled() { |
| 56 } |
| 57 |
| 55 void CastMetricsServiceClient::StoreClientInfo( | 58 void CastMetricsServiceClient::StoreClientInfo( |
| 56 const ::metrics::ClientInfo& client_info) { | 59 const ::metrics::ClientInfo& client_info) { |
| 57 const std::string& client_id = client_info.client_id; | 60 const std::string& client_id = client_info.client_id; |
| 58 DCHECK(client_id.empty() || base::IsValidGUID(client_id)); | 61 DCHECK(client_id.empty() || base::IsValidGUID(client_id)); |
| 59 // backup client_id or reset to empty. | 62 // backup client_id or reset to empty. |
| 60 SetMetricsClientId(client_id); | 63 SetMetricsClientId(client_id); |
| 61 } | 64 } |
| 62 | 65 |
| 63 scoped_ptr< ::metrics::ClientInfo> CastMetricsServiceClient::LoadClientInfo() { | 66 scoped_ptr< ::metrics::ClientInfo> CastMetricsServiceClient::LoadClientInfo() { |
| 64 scoped_ptr< ::metrics::ClientInfo> client_info(new ::metrics::ClientInfo); | 67 scoped_ptr< ::metrics::ClientInfo> client_info(new ::metrics::ClientInfo); |
| (...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 271 #endif // defined(OS_LINUX) | 274 #endif // defined(OS_LINUX) |
| 272 metrics_service_->Stop(); | 275 metrics_service_->Stop(); |
| 273 } | 276 } |
| 274 | 277 |
| 275 bool CastMetricsServiceClient::IsReportingEnabled() { | 278 bool CastMetricsServiceClient::IsReportingEnabled() { |
| 276 return PlatformIsReportingEnabled(cast_service_); | 279 return PlatformIsReportingEnabled(cast_service_); |
| 277 } | 280 } |
| 278 | 281 |
| 279 } // namespace metrics | 282 } // namespace metrics |
| 280 } // namespace chromecast | 283 } // namespace chromecast |
| OLD | NEW |