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 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 if (force_client_id_.empty()) { | 152 if (force_client_id_.empty()) { |
153 LOG(WARNING) << "Empty client id from platform," | 153 LOG(WARNING) << "Empty client id from platform," |
154 << " assuming this is the first boot up of a new device."; | 154 << " assuming this is the first boot up of a new device."; |
155 } else { | 155 } else { |
156 LOG(ERROR) << "Invalid client id from platform: " << force_client_id_ | 156 LOG(ERROR) << "Invalid client id from platform: " << force_client_id_ |
157 << " from platform."; | 157 << " from platform."; |
158 } | 158 } |
159 return std::unique_ptr<::metrics::ClientInfo>(); | 159 return std::unique_ptr<::metrics::ClientInfo>(); |
160 } | 160 } |
161 | 161 |
162 bool CastMetricsServiceClient::IsOffTheRecordSessionActive() { | |
163 // Chromecast behaves as "off the record" w/r/t recording browsing state, | |
164 // but this value is about not disabling metrics because of it. | |
165 return false; | |
166 } | |
167 | |
168 int32_t CastMetricsServiceClient::GetProduct() { | 162 int32_t CastMetricsServiceClient::GetProduct() { |
169 // Chromecast currently uses the same product identifier as Chrome. | 163 // Chromecast currently uses the same product identifier as Chrome. |
170 return ::metrics::ChromeUserMetricsExtension::CAST; | 164 return ::metrics::ChromeUserMetricsExtension::CAST; |
171 } | 165 } |
172 | 166 |
173 std::string CastMetricsServiceClient::GetApplicationLocale() { | 167 std::string CastMetricsServiceClient::GetApplicationLocale() { |
174 return base::i18n::GetConfiguredLocale(); | 168 return base::i18n::GetConfiguredLocale(); |
175 } | 169 } |
176 | 170 |
177 bool CastMetricsServiceClient::GetBrand(std::string* brand_code) { | 171 bool CastMetricsServiceClient::GetBrand(std::string* brand_code) { |
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
405 external_metrics_->StopAndDestroy(); | 399 external_metrics_->StopAndDestroy(); |
406 external_metrics_ = nullptr; | 400 external_metrics_ = nullptr; |
407 platform_metrics_->StopAndDestroy(); | 401 platform_metrics_->StopAndDestroy(); |
408 platform_metrics_ = nullptr; | 402 platform_metrics_ = nullptr; |
409 #endif // defined(OS_LINUX) | 403 #endif // defined(OS_LINUX) |
410 metrics_service_->Stop(); | 404 metrics_service_->Stop(); |
411 } | 405 } |
412 | 406 |
413 } // namespace metrics | 407 } // namespace metrics |
414 } // namespace chromecast | 408 } // namespace chromecast |
OLD | NEW |