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 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 11 matching lines...) Expand all Loading... |
22 // An abstraction of operations that depend on the embedder's (e.g. Chrome) | 22 // An abstraction of operations that depend on the embedder's (e.g. Chrome) |
23 // environment. | 23 // environment. |
24 class MetricsServiceClient { | 24 class MetricsServiceClient { |
25 public: | 25 public: |
26 virtual ~MetricsServiceClient() {} | 26 virtual ~MetricsServiceClient() {} |
27 | 27 |
28 // Registers the client id with other services (e.g. crash reporting), called | 28 // Registers the client id with other services (e.g. crash reporting), called |
29 // when metrics recording gets enabled. | 29 // when metrics recording gets enabled. |
30 virtual void SetMetricsClientId(const std::string& client_id) = 0; | 30 virtual void SetMetricsClientId(const std::string& client_id) = 0; |
31 | 31 |
| 32 // Notifies the client that recording is disabled, so that other services |
| 33 // (such as crash reporting) can clear any association with metrics. |
| 34 virtual void OnRecordingDisabled() = 0; |
| 35 |
32 // Whether there's an "off the record" (aka "Incognito") session active. | 36 // Whether there's an "off the record" (aka "Incognito") session active. |
33 virtual bool IsOffTheRecordSessionActive() = 0; | 37 virtual bool IsOffTheRecordSessionActive() = 0; |
34 | 38 |
35 // Returns the product value to use in uploaded reports, which will be used to | 39 // Returns the product value to use in uploaded reports, which will be used to |
36 // set the ChromeUserMetricsExtension.product field. See comments on that | 40 // set the ChromeUserMetricsExtension.product field. See comments on that |
37 // field on why it's an int32 rather than an enum. | 41 // field on why it's an int32 rather than an enum. |
38 virtual int32_t GetProduct() = 0; | 42 virtual int32_t GetProduct() = 0; |
39 | 43 |
40 // Returns the current application locale (e.g. "en-US"). | 44 // Returns the current application locale (e.g. "en-US"). |
41 virtual std::string GetApplicationLocale() = 0; | 45 virtual std::string GetApplicationLocale() = 0; |
(...skipping 29 matching lines...) Expand all Loading... |
71 virtual base::TimeDelta GetStandardUploadInterval() = 0; | 75 virtual base::TimeDelta GetStandardUploadInterval() = 0; |
72 | 76 |
73 // Returns the name of a key under HKEY_CURRENT_USER that can be used to store | 77 // Returns the name of a key under HKEY_CURRENT_USER that can be used to store |
74 // backups of metrics data. Unused except on Windows. | 78 // backups of metrics data. Unused except on Windows. |
75 virtual base::string16 GetRegistryBackupKey(); | 79 virtual base::string16 GetRegistryBackupKey(); |
76 }; | 80 }; |
77 | 81 |
78 } // namespace metrics | 82 } // namespace metrics |
79 | 83 |
80 #endif // COMPONENTS_METRICS_METRICS_SERVICE_CLIENT_H_ | 84 #endif // COMPONENTS_METRICS_METRICS_SERVICE_CLIENT_H_ |
OLD | NEW |