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" | |
10 #include "base/prefs/pref_service.h" | 9 #include "base/prefs/pref_service.h" |
11 #include "chromecast/browser/metrics/cast_stability_metrics_provider.h" | 10 #include "chromecast/browser/metrics/cast_stability_metrics_provider.h" |
12 #include "chromecast/browser/metrics/platform_metrics_providers.h" | 11 #include "chromecast/browser/metrics/platform_metrics_providers.h" |
13 #include "chromecast/common/chromecast_switches.h" | 12 #include "chromecast/common/chromecast_switches.h" |
14 #include "chromecast/common/pref_names.h" | 13 #include "chromecast/common/pref_names.h" |
15 #include "components/metrics/client_info.h" | 14 #include "components/metrics/client_info.h" |
16 #include "components/metrics/gpu/gpu_metrics_provider.h" | 15 #include "components/metrics/gpu/gpu_metrics_provider.h" |
17 #include "components/metrics/metrics_pref_names.h" | 16 #include "components/metrics/metrics_pref_names.h" |
18 #include "components/metrics/metrics_provider.h" | 17 #include "components/metrics/metrics_provider.h" |
19 #include "components/metrics/metrics_service.h" | 18 #include "components/metrics/metrics_service.h" |
20 #include "components/metrics/metrics_state_manager.h" | 19 #include "components/metrics/metrics_state_manager.h" |
21 #include "components/metrics/net/net_metrics_log_uploader.h" | 20 #include "components/metrics/net/net_metrics_log_uploader.h" |
22 #include "components/metrics/net/network_metrics_provider.h" | 21 #include "components/metrics/net/network_metrics_provider.h" |
23 #include "components/metrics/profiler/profiler_metrics_provider.h" | 22 #include "components/metrics/profiler/profiler_metrics_provider.h" |
24 #include "content/public/common/content_switches.h" | 23 #include "content/public/common/content_switches.h" |
| 24 #include "ui/base/l10n/l10n_util.h" |
25 | 25 |
26 #if defined(OS_LINUX) | 26 #if defined(OS_LINUX) |
27 #include "chromecast/browser/metrics/external_metrics.h" | 27 #include "chromecast/browser/metrics/external_metrics.h" |
28 #endif // defined(OS_LINUX) | 28 #endif // defined(OS_LINUX) |
29 | 29 |
30 namespace chromecast { | 30 namespace chromecast { |
31 namespace metrics { | 31 namespace metrics { |
32 | 32 |
33 // static | 33 // static |
34 scoped_ptr<CastMetricsServiceClient> CastMetricsServiceClient::Create( | 34 scoped_ptr<CastMetricsServiceClient> CastMetricsServiceClient::Create( |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 // but this value is about not disabling metrics because of it. | 95 // but this value is about not disabling metrics because of it. |
96 return false; | 96 return false; |
97 } | 97 } |
98 | 98 |
99 int32_t CastMetricsServiceClient::GetProduct() { | 99 int32_t CastMetricsServiceClient::GetProduct() { |
100 // Chromecast currently uses the same product identifier as Chrome. | 100 // Chromecast currently uses the same product identifier as Chrome. |
101 return ::metrics::ChromeUserMetricsExtension::CHROME; | 101 return ::metrics::ChromeUserMetricsExtension::CHROME; |
102 } | 102 } |
103 | 103 |
104 std::string CastMetricsServiceClient::GetApplicationLocale() { | 104 std::string CastMetricsServiceClient::GetApplicationLocale() { |
105 return base::i18n::GetConfiguredLocale(); | 105 return l10n_util::GetConfiguredLocale(); |
106 } | 106 } |
107 | 107 |
108 bool CastMetricsServiceClient::GetBrand(std::string* brand_code) { | 108 bool CastMetricsServiceClient::GetBrand(std::string* brand_code) { |
109 return false; | 109 return false; |
110 } | 110 } |
111 | 111 |
112 ::metrics::SystemProfileProto::Channel CastMetricsServiceClient::GetChannel() { | 112 ::metrics::SystemProfileProto::Channel CastMetricsServiceClient::GetChannel() { |
113 return GetPlatformReleaseChannel(cast_service_); | 113 return GetPlatformReleaseChannel(cast_service_); |
114 } | 114 } |
115 | 115 |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
260 #endif // defined(OS_LINUX) | 260 #endif // defined(OS_LINUX) |
261 metrics_service_->Stop(); | 261 metrics_service_->Stop(); |
262 } | 262 } |
263 | 263 |
264 bool CastMetricsServiceClient::IsReportingEnabled() { | 264 bool CastMetricsServiceClient::IsReportingEnabled() { |
265 return PlatformIsReportingEnabled(cast_service_); | 265 return PlatformIsReportingEnabled(cast_service_); |
266 } | 266 } |
267 | 267 |
268 } // namespace metrics | 268 } // namespace metrics |
269 } // namespace chromecast | 269 } // namespace chromecast |
OLD | NEW |