| 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 21 matching lines...) Expand all Loading... |
| 32 namespace chromecast { | 32 namespace chromecast { |
| 33 | 33 |
| 34 class CastService; | 34 class CastService; |
| 35 | 35 |
| 36 namespace metrics { | 36 namespace metrics { |
| 37 | 37 |
| 38 class ExternalMetrics; | 38 class ExternalMetrics; |
| 39 | 39 |
| 40 class CastMetricsServiceClient : public ::metrics::MetricsServiceClient { | 40 class CastMetricsServiceClient : public ::metrics::MetricsServiceClient { |
| 41 public: | 41 public: |
| 42 virtual ~CastMetricsServiceClient(); | 42 ~CastMetricsServiceClient() override; |
| 43 | 43 |
| 44 static scoped_ptr<CastMetricsServiceClient> Create( | 44 static scoped_ptr<CastMetricsServiceClient> Create( |
| 45 base::TaskRunner* io_task_runner, | 45 base::TaskRunner* io_task_runner, |
| 46 PrefService* pref_service, | 46 PrefService* pref_service, |
| 47 net::URLRequestContextGetter* request_context); | 47 net::URLRequestContextGetter* request_context); |
| 48 | 48 |
| 49 void Initialize(CastService* cast_service); | 49 void Initialize(CastService* cast_service); |
| 50 | 50 |
| 51 // metrics::MetricsServiceClient implementation: | 51 // metrics::MetricsServiceClient implementation: |
| 52 virtual void SetMetricsClientId(const std::string& client_id) override; | 52 void SetMetricsClientId(const std::string& client_id) override; |
| 53 virtual bool IsOffTheRecordSessionActive() override; | 53 bool IsOffTheRecordSessionActive() override; |
| 54 virtual int32_t GetProduct() override; | 54 int32_t GetProduct() override; |
| 55 virtual std::string GetApplicationLocale() override; | 55 std::string GetApplicationLocale() override; |
| 56 virtual bool GetBrand(std::string* brand_code) override; | 56 bool GetBrand(std::string* brand_code) override; |
| 57 virtual ::metrics::SystemProfileProto::Channel GetChannel() override; | 57 ::metrics::SystemProfileProto::Channel GetChannel() override; |
| 58 virtual std::string GetVersionString() override; | 58 std::string GetVersionString() override; |
| 59 virtual void OnLogUploadComplete() override; | 59 void OnLogUploadComplete() override; |
| 60 virtual void StartGatheringMetrics( | 60 void StartGatheringMetrics(const base::Closure& done_callback) override; |
| 61 const base::Closure& done_callback) override; | 61 void CollectFinalMetrics(const base::Closure& done_callback) override; |
| 62 virtual void CollectFinalMetrics(const base::Closure& done_callback) override; | 62 scoped_ptr< ::metrics::MetricsLogUploader> CreateUploader( |
| 63 virtual scoped_ptr< ::metrics::MetricsLogUploader> CreateUploader( | |
| 64 const std::string& server_url, | 63 const std::string& server_url, |
| 65 const std::string& mime_type, | 64 const std::string& mime_type, |
| 66 const base::Callback<void(int)>& on_upload_complete) override; | 65 const base::Callback<void(int)>& on_upload_complete) override; |
| 67 | 66 |
| 68 // Starts/stops the metrics service. | 67 // Starts/stops the metrics service. |
| 69 void EnableMetricsService(bool enabled); | 68 void EnableMetricsService(bool enabled); |
| 70 | 69 |
| 71 std::string client_id() const { | 70 std::string client_id() const { |
| 72 return client_id_; | 71 return client_id_; |
| 73 } | 72 } |
| (...skipping 23 matching lines...) Expand all Loading... |
| 97 scoped_ptr< ::metrics::MetricsService> metrics_service_; | 96 scoped_ptr< ::metrics::MetricsService> metrics_service_; |
| 98 net::URLRequestContextGetter* const request_context_; | 97 net::URLRequestContextGetter* const request_context_; |
| 99 | 98 |
| 100 DISALLOW_COPY_AND_ASSIGN(CastMetricsServiceClient); | 99 DISALLOW_COPY_AND_ASSIGN(CastMetricsServiceClient); |
| 101 }; | 100 }; |
| 102 | 101 |
| 103 } // namespace metrics | 102 } // namespace metrics |
| 104 } // namespace chromecast | 103 } // namespace chromecast |
| 105 | 104 |
| 106 #endif // CHROMECAST_BROWSER_METRICS_CAST_METRICS_SERVICE_CLIENT_H_ | 105 #endif // CHROMECAST_BROWSER_METRICS_CAST_METRICS_SERVICE_CLIENT_H_ |
| OLD | NEW |