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> |
(...skipping 23 matching lines...) Expand all Loading... |
34 // Returns the MetricsService instance that this client is associated with. | 34 // Returns the MetricsService instance that this client is associated with. |
35 // With the exception of testing contexts, the returned instance must be valid | 35 // With the exception of testing contexts, the returned instance must be valid |
36 // for the lifetime of this object (typically, the embedder's client | 36 // for the lifetime of this object (typically, the embedder's client |
37 // implementation will own the MetricsService instance being returned). | 37 // implementation will own the MetricsService instance being returned). |
38 virtual MetricsService* GetMetricsService() = 0; | 38 virtual MetricsService* GetMetricsService() = 0; |
39 | 39 |
40 // Registers the client id with other services (e.g. crash reporting), called | 40 // Registers the client id with other services (e.g. crash reporting), called |
41 // when metrics recording gets enabled. | 41 // when metrics recording gets enabled. |
42 virtual void SetMetricsClientId(const std::string& client_id) = 0; | 42 virtual void SetMetricsClientId(const std::string& client_id) = 0; |
43 | 43 |
44 // Notifies the client that recording is disabled, so that other services | |
45 // (such as crash reporting) can clear any association with metrics. | |
46 virtual void OnRecordingDisabled() = 0; | |
47 | |
48 // Whether there's an "off the record" (aka "Incognito") session active. | 44 // Whether there's an "off the record" (aka "Incognito") session active. |
49 virtual bool IsOffTheRecordSessionActive() = 0; | 45 virtual bool IsOffTheRecordSessionActive() = 0; |
50 | 46 |
51 // Returns the product value to use in uploaded reports, which will be used to | 47 // Returns the product value to use in uploaded reports, which will be used to |
52 // set the ChromeUserMetricsExtension.product field. See comments on that | 48 // set the ChromeUserMetricsExtension.product field. See comments on that |
53 // field on why it's an int32_t rather than an enum. | 49 // field on why it's an int32_t rather than an enum. |
54 virtual int32_t GetProduct() = 0; | 50 virtual int32_t GetProduct() = 0; |
55 | 51 |
56 // Returns the current application locale (e.g. "en-US"). | 52 // Returns the current application locale (e.g. "en-US"). |
57 virtual std::string GetApplicationLocale() = 0; | 53 virtual std::string GetApplicationLocale() = 0; |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 // shown during first-run. | 103 // shown during first-run. |
108 virtual EnableMetricsDefault GetMetricsReportingDefaultState(); | 104 virtual EnableMetricsDefault GetMetricsReportingDefaultState(); |
109 | 105 |
110 // Returns whether cellular logic is enabled for metrics reporting. | 106 // Returns whether cellular logic is enabled for metrics reporting. |
111 virtual bool IsUMACellularUploadLogicEnabled(); | 107 virtual bool IsUMACellularUploadLogicEnabled(); |
112 }; | 108 }; |
113 | 109 |
114 } // namespace metrics | 110 } // namespace metrics |
115 | 111 |
116 #endif // COMPONENTS_METRICS_METRICS_SERVICE_CLIENT_H_ | 112 #endif // COMPONENTS_METRICS_METRICS_SERVICE_CLIENT_H_ |
OLD | NEW |