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