| 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 <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 // Retrieves the brand code string associated with the install, returning | 35 // Retrieves the brand code string associated with the install, returning |
| 36 // false if no brand code is available. | 36 // false if no brand code is available. |
| 37 virtual bool GetBrand(std::string* brand_code) = 0; | 37 virtual bool GetBrand(std::string* brand_code) = 0; |
| 38 | 38 |
| 39 // Returns the release channel (e.g. stable, beta, etc) of the application. | 39 // Returns the release channel (e.g. stable, beta, etc) of the application. |
| 40 virtual SystemProfileProto::Channel GetChannel() = 0; | 40 virtual SystemProfileProto::Channel GetChannel() = 0; |
| 41 | 41 |
| 42 // Returns the version of the application as a string. | 42 // Returns the version of the application as a string. |
| 43 virtual std::string GetVersionString() = 0; | 43 virtual std::string GetVersionString() = 0; |
| 44 | 44 |
| 45 // Returns the install date of the application, in seconds since the epoch. | |
| 46 virtual int64 GetInstallDate() = 0; | |
| 47 | |
| 48 // Called by the metrics service when a log has been uploaded. | 45 // Called by the metrics service when a log has been uploaded. |
| 49 virtual void OnLogUploadComplete() = 0; | 46 virtual void OnLogUploadComplete() = 0; |
| 50 | 47 |
| 51 // Starts gathering metrics, calling |done_callback| when initial metrics | 48 // Starts gathering metrics, calling |done_callback| when initial metrics |
| 52 // gathering is complete. | 49 // gathering is complete. |
| 53 virtual void StartGatheringMetrics(const base::Closure& done_callback) = 0; | 50 virtual void StartGatheringMetrics(const base::Closure& done_callback) = 0; |
| 54 | 51 |
| 55 // Called prior to a metrics log being closed, allowing the client to collect | 52 // Called prior to a metrics log being closed, allowing the client to collect |
| 56 // extra histograms that will go in that log. Asynchronous API - the client | 53 // extra histograms that will go in that log. Asynchronous API - the client |
| 57 // implementation should call |done_callback| when complete. | 54 // implementation should call |done_callback| when complete. |
| 58 virtual void CollectFinalMetrics(const base::Closure& done_callback) = 0; | 55 virtual void CollectFinalMetrics(const base::Closure& done_callback) = 0; |
| 59 | 56 |
| 60 // Creates a MetricsLogUploader with the specified parameters (see comments on | 57 // Creates a MetricsLogUploader with the specified parameters (see comments on |
| 61 // MetricsLogUploader for details). | 58 // MetricsLogUploader for details). |
| 62 virtual scoped_ptr<MetricsLogUploader> CreateUploader( | 59 virtual scoped_ptr<MetricsLogUploader> CreateUploader( |
| 63 const std::string& server_url, | 60 const std::string& server_url, |
| 64 const std::string& mime_type, | 61 const std::string& mime_type, |
| 65 const base::Callback<void(int)>& on_upload_complete) = 0; | 62 const base::Callback<void(int)>& on_upload_complete) = 0; |
| 66 }; | 63 }; |
| 67 | 64 |
| 68 } // namespace metrics | 65 } // namespace metrics |
| 69 | 66 |
| 70 #endif // COMPONENTS_METRICS_METRICS_SERVICE_CLIENT_H_ | 67 #endif // COMPONENTS_METRICS_METRICS_SERVICE_CLIENT_H_ |
| OLD | NEW |