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_METRICS_CAST_METRICS_SERVICE_CLIENT_H_ | 5 #ifndef CHROMECAST_METRICS_CAST_METRICS_SERVICE_CLIENT_H_ |
6 #define CHROMECAST_METRICS_CAST_METRICS_SERVICE_CLIENT_H_ | 6 #define CHROMECAST_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 23 matching lines...) Expand all Loading... |
34 class CastMetricsServiceClient : public ::metrics::MetricsServiceClient { | 34 class CastMetricsServiceClient : public ::metrics::MetricsServiceClient { |
35 public: | 35 public: |
36 virtual ~CastMetricsServiceClient(); | 36 virtual ~CastMetricsServiceClient(); |
37 | 37 |
38 static CastMetricsServiceClient* Create( | 38 static CastMetricsServiceClient* Create( |
39 base::TaskRunner* io_task_runner, | 39 base::TaskRunner* io_task_runner, |
40 PrefService* pref_service, | 40 PrefService* pref_service, |
41 net::URLRequestContextGetter* request_context); | 41 net::URLRequestContextGetter* request_context); |
42 | 42 |
43 // metrics::MetricsServiceClient implementation: | 43 // metrics::MetricsServiceClient implementation: |
44 virtual void SetMetricsClientId(const std::string& client_id) OVERRIDE; | 44 virtual void SetMetricsClientId(const std::string& client_id) override; |
45 virtual bool IsOffTheRecordSessionActive() OVERRIDE; | 45 virtual bool IsOffTheRecordSessionActive() override; |
46 virtual int32_t GetProduct() OVERRIDE; | 46 virtual int32_t GetProduct() override; |
47 virtual std::string GetApplicationLocale() OVERRIDE; | 47 virtual std::string GetApplicationLocale() override; |
48 virtual bool GetBrand(std::string* brand_code) OVERRIDE; | 48 virtual bool GetBrand(std::string* brand_code) override; |
49 virtual ::metrics::SystemProfileProto::Channel GetChannel() OVERRIDE; | 49 virtual ::metrics::SystemProfileProto::Channel GetChannel() override; |
50 virtual std::string GetVersionString() OVERRIDE; | 50 virtual std::string GetVersionString() override; |
51 virtual void OnLogUploadComplete() OVERRIDE; | 51 virtual void OnLogUploadComplete() override; |
52 virtual void StartGatheringMetrics( | 52 virtual void StartGatheringMetrics( |
53 const base::Closure& done_callback) OVERRIDE; | 53 const base::Closure& done_callback) override; |
54 virtual void CollectFinalMetrics(const base::Closure& done_callback) OVERRIDE; | 54 virtual void CollectFinalMetrics(const base::Closure& done_callback) override; |
55 virtual scoped_ptr< ::metrics::MetricsLogUploader> CreateUploader( | 55 virtual scoped_ptr< ::metrics::MetricsLogUploader> CreateUploader( |
56 const std::string& server_url, | 56 const std::string& server_url, |
57 const std::string& mime_type, | 57 const std::string& mime_type, |
58 const base::Callback<void(int)>& on_upload_complete) OVERRIDE; | 58 const base::Callback<void(int)>& on_upload_complete) override; |
59 | 59 |
60 // Starts/stops the metrics service. | 60 // Starts/stops the metrics service. |
61 void EnableMetricsService(bool enabled); | 61 void EnableMetricsService(bool enabled); |
62 | 62 |
63 private: | 63 private: |
64 CastMetricsServiceClient( | 64 CastMetricsServiceClient( |
65 base::TaskRunner* io_task_runner, | 65 base::TaskRunner* io_task_runner, |
66 PrefService* pref_service, | 66 PrefService* pref_service, |
67 net::URLRequestContextGetter* request_context); | 67 net::URLRequestContextGetter* request_context); |
68 | 68 |
69 // Returns whether or not metrics reporting is enabled. | 69 // Returns whether or not metrics reporting is enabled. |
70 bool IsReportingEnabled(); | 70 bool IsReportingEnabled(); |
71 | 71 |
72 scoped_ptr< ::metrics::MetricsStateManager> metrics_state_manager_; | 72 scoped_ptr< ::metrics::MetricsStateManager> metrics_state_manager_; |
73 scoped_ptr< ::metrics::MetricsService> metrics_service_; | 73 scoped_ptr< ::metrics::MetricsService> metrics_service_; |
74 scoped_refptr<base::MessageLoopProxy> metrics_service_loop_; | 74 scoped_refptr<base::MessageLoopProxy> metrics_service_loop_; |
75 net::URLRequestContextGetter* request_context_; | 75 net::URLRequestContextGetter* request_context_; |
76 | 76 |
77 DISALLOW_COPY_AND_ASSIGN(CastMetricsServiceClient); | 77 DISALLOW_COPY_AND_ASSIGN(CastMetricsServiceClient); |
78 }; | 78 }; |
79 | 79 |
80 } // namespace metrics | 80 } // namespace metrics |
81 } // namespace chromecast | 81 } // namespace chromecast |
82 | 82 |
83 #endif // CHROMECAST_METRICS_CAST_METRICS_SERVICE_CLIENT_H_ | 83 #endif // CHROMECAST_METRICS_CAST_METRICS_SERVICE_CLIENT_H_ |
OLD | NEW |