| 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 // Retrieves the brand code string associated with the install, returning | 43 // Retrieves the brand code string associated with the install, returning |
| 44 // false if no brand code is available. | 44 // false if no brand code is available. |
| 45 virtual bool GetBrand(std::string* brand_code) = 0; | 45 virtual bool GetBrand(std::string* brand_code) = 0; |
| 46 | 46 |
| 47 // Returns the release channel (e.g. stable, beta, etc) of the application. | 47 // Returns the release channel (e.g. stable, beta, etc) of the application. |
| 48 virtual SystemProfileProto::Channel GetChannel() = 0; | 48 virtual SystemProfileProto::Channel GetChannel() = 0; |
| 49 | 49 |
| 50 // Returns the version of the application as a string. | 50 // Returns the version of the application as a string. |
| 51 virtual std::string GetVersionString() = 0; | 51 virtual std::string GetVersionString() = 0; |
| 52 | 52 |
| 53 // Called by the metrics service when a log has been uploaded. | 53 // Called by the metrics service when a log has been uploaded, passing whether |
| 54 virtual void OnLogUploadComplete() = 0; | 54 // upload was successful. |
| 55 virtual void OnLogUploadComplete(bool upload_succeeded) = 0; |
| 55 | 56 |
| 56 // Starts gathering metrics, calling |done_callback| when initial metrics | 57 // Starts gathering metrics, calling |done_callback| when initial metrics |
| 57 // gathering is complete. | 58 // gathering is complete. |
| 58 virtual void StartGatheringMetrics(const base::Closure& done_callback) = 0; | 59 virtual void StartGatheringMetrics(const base::Closure& done_callback) = 0; |
| 59 | 60 |
| 60 // Called prior to a metrics log being closed, allowing the client to collect | 61 // Called prior to a metrics log being closed, allowing the client to collect |
| 61 // extra histograms that will go in that log. Asynchronous API - the client | 62 // extra histograms that will go in that log. Asynchronous API - the client |
| 62 // implementation should call |done_callback| when complete. | 63 // implementation should call |done_callback| when complete. |
| 63 virtual void CollectFinalMetrics(const base::Closure& done_callback) = 0; | 64 virtual void CollectFinalMetrics(const base::Closure& done_callback) = 0; |
| 64 | 65 |
| 65 // Creates a MetricsLogUploader with the specified parameters (see comments on | 66 // Creates a MetricsLogUploader with the specified parameters (see comments on |
| 66 // MetricsLogUploader for details). | 67 // MetricsLogUploader for details). |
| 67 virtual scoped_ptr<MetricsLogUploader> CreateUploader( | 68 virtual scoped_ptr<MetricsLogUploader> CreateUploader( |
| 68 const base::Callback<void(int)>& on_upload_complete) = 0; | 69 const base::Callback<void(int)>& on_upload_complete) = 0; |
| 69 | 70 |
| 70 // Returns the standard interval between upload attempts. | 71 // Returns the standard interval between upload attempts. |
| 71 virtual base::TimeDelta GetStandardUploadInterval() = 0; | 72 virtual base::TimeDelta GetStandardUploadInterval() = 0; |
| 72 | 73 |
| 73 // Returns the name of a key under HKEY_CURRENT_USER that can be used to store | 74 // 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. | 75 // backups of metrics data. Unused except on Windows. |
| 75 virtual base::string16 GetRegistryBackupKey(); | 76 virtual base::string16 GetRegistryBackupKey(); |
| 76 }; | 77 }; |
| 77 | 78 |
| 78 } // namespace metrics | 79 } // namespace metrics |
| 79 | 80 |
| 80 #endif // COMPONENTS_METRICS_METRICS_SERVICE_CLIENT_H_ | 81 #endif // COMPONENTS_METRICS_METRICS_SERVICE_CLIENT_H_ |
| OLD | NEW |