| 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 COMPONENTS_METRICS_METRICS_SERVICE_CLIENT_H_ | 5 #ifndef COMPONENTS_METRICS_METRICS_SERVICE_CLIENT_H_ |
| 6 #define COMPONENTS_METRICS_METRICS_SERVICE_CLIENT_H_ | 6 #define COMPONENTS_METRICS_METRICS_SERVICE_CLIENT_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| 11 #include <string> | 11 #include <string> |
| 12 | 12 |
| 13 #include "base/callback_forward.h" | 13 #include "base/callback.h" |
| 14 #include "base/strings/string16.h" | 14 #include "base/strings/string16.h" |
| 15 #include "base/time/time.h" | 15 #include "base/time/time.h" |
| 16 #include "components/metrics/metrics_reporting_default_state.h" | 16 #include "components/metrics/metrics_reporting_default_state.h" |
| 17 #include "components/metrics/proto/system_profile.pb.h" | 17 #include "components/metrics/proto/system_profile.pb.h" |
| 18 | 18 |
| 19 namespace base { | 19 namespace base { |
| 20 class FilePath; | 20 class FilePath; |
| 21 } | 21 } |
| 22 | 22 |
| 23 namespace ukm { | 23 namespace ukm { |
| 24 class UkmService; | 24 class UkmService; |
| 25 } | 25 } |
| 26 | 26 |
| 27 namespace metrics { | 27 namespace metrics { |
| 28 | 28 |
| 29 class MetricsLogUploader; | 29 class MetricsLogUploader; |
| 30 class MetricsService; | 30 class MetricsService; |
| 31 | 31 |
| 32 // An abstraction of operations that depend on the embedder's (e.g. Chrome) | 32 // An abstraction of operations that depend on the embedder's (e.g. Chrome) |
| 33 // environment. | 33 // environment. |
| 34 class MetricsServiceClient { | 34 class MetricsServiceClient { |
| 35 public: | 35 public: |
| 36 virtual ~MetricsServiceClient() {} | 36 MetricsServiceClient(); |
| 37 virtual ~MetricsServiceClient(); |
| 37 | 38 |
| 38 // Returns the MetricsService instance that this client is associated with. | 39 // Returns the MetricsService instance that this client is associated with. |
| 39 // With the exception of testing contexts, the returned instance must be valid | 40 // With the exception of testing contexts, the returned instance must be valid |
| 40 // for the lifetime of this object (typically, the embedder's client | 41 // for the lifetime of this object (typically, the embedder's client |
| 41 // implementation will own the MetricsService instance being returned). | 42 // implementation will own the MetricsService instance being returned). |
| 42 virtual MetricsService* GetMetricsService() = 0; | 43 virtual MetricsService* GetMetricsService() = 0; |
| 43 | 44 |
| 44 // Returns the UkmService instance that this client is associated with. | 45 // Returns the UkmService instance that this client is associated with. |
| 45 virtual ukm::UkmService* GetUkmService(); | 46 virtual ukm::UkmService* GetUkmService(); |
| 46 | 47 |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 | 114 |
| 114 // Returns whether metrics reporting is managed by policy. | 115 // Returns whether metrics reporting is managed by policy. |
| 115 virtual bool IsReportingPolicyManaged(); | 116 virtual bool IsReportingPolicyManaged(); |
| 116 | 117 |
| 117 // Gets information about the default value for the metrics reporting checkbox | 118 // Gets information about the default value for the metrics reporting checkbox |
| 118 // shown during first-run. | 119 // shown during first-run. |
| 119 virtual EnableMetricsDefault GetMetricsReportingDefaultState(); | 120 virtual EnableMetricsDefault GetMetricsReportingDefaultState(); |
| 120 | 121 |
| 121 // Returns whether cellular logic is enabled for metrics reporting. | 122 // Returns whether cellular logic is enabled for metrics reporting. |
| 122 virtual bool IsUMACellularUploadLogicEnabled(); | 123 virtual bool IsUMACellularUploadLogicEnabled(); |
| 124 |
| 125 // Returns if history sync is enabled on all active profiles. |
| 126 virtual bool IsHistorySyncEnabledOnAllProfiles(); |
| 127 |
| 128 // Sets the callback to run MetricsServiceManager::UpdateRunningServices. |
| 129 void SetUpdateRunningServicesCallback(const base::Closure& callback); |
| 130 |
| 131 protected: |
| 132 base::Closure update_running_services_; |
| 133 |
| 134 DISALLOW_COPY_AND_ASSIGN(MetricsServiceClient); |
| 123 }; | 135 }; |
| 124 | 136 |
| 125 } // namespace metrics | 137 } // namespace metrics |
| 126 | 138 |
| 127 #endif // COMPONENTS_METRICS_METRICS_SERVICE_CLIENT_H_ | 139 #endif // COMPONENTS_METRICS_METRICS_SERVICE_CLIENT_H_ |
| OLD | NEW |