Chromium Code Reviews| 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 #ifndef CHROMECAST_BROWSER_METRICS_CAST_METRICS_SERVICE_CLIENT_H_ | 5 #ifndef CHROMECAST_BROWSER_METRICS_CAST_METRICS_SERVICE_CLIENT_H_ |
| 6 #define CHROMECAST_BROWSER_METRICS_CAST_METRICS_SERVICE_CLIENT_H_ | 6 #define CHROMECAST_BROWSER_METRICS_CAST_METRICS_SERVICE_CLIENT_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 30 matching lines...) Expand all Loading... | |
| 41 class CastMetricsServiceClient : public ::metrics::MetricsServiceClient { | 41 class CastMetricsServiceClient : public ::metrics::MetricsServiceClient { |
| 42 public: | 42 public: |
| 43 ~CastMetricsServiceClient() override; | 43 ~CastMetricsServiceClient() override; |
| 44 | 44 |
| 45 static scoped_ptr<CastMetricsServiceClient> Create( | 45 static scoped_ptr<CastMetricsServiceClient> Create( |
| 46 base::TaskRunner* io_task_runner, | 46 base::TaskRunner* io_task_runner, |
| 47 PrefService* pref_service, | 47 PrefService* pref_service, |
| 48 net::URLRequestContextGetter* request_context); | 48 net::URLRequestContextGetter* request_context); |
| 49 static void RegisterPrefs(PrefRegistrySimple* registry); | 49 static void RegisterPrefs(PrefRegistrySimple* registry); |
| 50 | 50 |
| 51 void SetPersistedClientId(const std::string& client_id); | |
|
halliwell
2015/08/19 13:25:17
nit: persistent
gunsch
2015/08/19 15:34:46
I'm not sure I agree, actually. "SetPersistentClie
halliwell
2015/08/19 20:56:18
I see, thanks for explanation.
| |
| 51 void Initialize(CastService* cast_service); | 52 void Initialize(CastService* cast_service); |
| 52 void Finalize(); | 53 void Finalize(); |
| 53 | 54 |
| 54 // metrics::MetricsServiceClient implementation: | 55 // metrics::MetricsServiceClient implementation: |
| 55 void SetMetricsClientId(const std::string& client_id) override; | 56 void SetMetricsClientId(const std::string& client_id) override; |
| 56 void OnRecordingDisabled() override; | 57 void OnRecordingDisabled() override; |
| 57 bool IsOffTheRecordSessionActive() override; | 58 bool IsOffTheRecordSessionActive() override; |
| 58 int32_t GetProduct() override; | 59 int32_t GetProduct() override; |
| 59 std::string GetApplicationLocale() override; | 60 std::string GetApplicationLocale() override; |
| 60 bool GetBrand(std::string* brand_code) override; | 61 bool GetBrand(std::string* brand_code) override; |
| (...skipping 19 matching lines...) Expand all Loading... | |
| 80 // Returns whether or not metrics reporting is enabled. | 81 // Returns whether or not metrics reporting is enabled. |
| 81 bool IsReportingEnabled(); | 82 bool IsReportingEnabled(); |
| 82 | 83 |
| 83 scoped_ptr< ::metrics::ClientInfo> LoadClientInfo(); | 84 scoped_ptr< ::metrics::ClientInfo> LoadClientInfo(); |
| 84 void StoreClientInfo(const ::metrics::ClientInfo& client_info); | 85 void StoreClientInfo(const ::metrics::ClientInfo& client_info); |
| 85 | 86 |
| 86 base::TaskRunner* const io_task_runner_; | 87 base::TaskRunner* const io_task_runner_; |
| 87 PrefService* const pref_service_; | 88 PrefService* const pref_service_; |
| 88 CastService* cast_service_; | 89 CastService* cast_service_; |
| 89 std::string client_id_; | 90 std::string client_id_; |
| 91 std::string platform_client_id_; | |
|
gfhuang
2015/08/19 15:48:27
persisted_client_id_
gunsch
2015/08/19 15:52:50
Done.
| |
| 92 bool client_info_loaded_; | |
| 90 | 93 |
| 91 #if defined(OS_LINUX) | 94 #if defined(OS_LINUX) |
| 92 ExternalMetrics* external_metrics_; | 95 ExternalMetrics* external_metrics_; |
| 93 ExternalMetrics* platform_metrics_; | 96 ExternalMetrics* platform_metrics_; |
| 94 #endif // defined(OS_LINUX) | 97 #endif // defined(OS_LINUX) |
| 95 const scoped_refptr<base::SingleThreadTaskRunner> task_runner_; | 98 const scoped_refptr<base::SingleThreadTaskRunner> task_runner_; |
| 96 scoped_ptr< ::metrics::MetricsStateManager> metrics_state_manager_; | 99 scoped_ptr< ::metrics::MetricsStateManager> metrics_state_manager_; |
| 97 scoped_ptr< ::metrics::MetricsService> metrics_service_; | 100 scoped_ptr< ::metrics::MetricsService> metrics_service_; |
| 98 net::URLRequestContextGetter* const request_context_; | 101 net::URLRequestContextGetter* const request_context_; |
| 99 | 102 |
| 100 DISALLOW_COPY_AND_ASSIGN(CastMetricsServiceClient); | 103 DISALLOW_COPY_AND_ASSIGN(CastMetricsServiceClient); |
| 101 }; | 104 }; |
| 102 | 105 |
| 103 } // namespace metrics | 106 } // namespace metrics |
| 104 } // namespace chromecast | 107 } // namespace chromecast |
| 105 | 108 |
| 106 #endif // CHROMECAST_BROWSER_METRICS_CAST_METRICS_SERVICE_CLIENT_H_ | 109 #endif // CHROMECAST_BROWSER_METRICS_CAST_METRICS_SERVICE_CLIENT_H_ |
| OLD | NEW |