| 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 |
| 11 #include "base/callback_forward.h" | 11 #include "base/callback_forward.h" |
| 12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
| 13 #include "base/single_thread_task_runner.h" |
| 13 #include "base/strings/string16.h" | 14 #include "base/strings/string16.h" |
| 14 #include "base/time/time.h" | 15 #include "base/time/time.h" |
| 15 #include "components/metrics/proto/system_profile.pb.h" | 16 #include "components/metrics/proto/system_profile.pb.h" |
| 16 | 17 |
| 17 namespace base { | 18 namespace base { |
| 18 class FilePath; | 19 class FilePath; |
| 19 } | 20 } |
| 20 | 21 |
| 21 namespace metrics { | 22 namespace metrics { |
| 22 | 23 |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 const base::Closure& done_callback) = 0; | 93 const base::Closure& done_callback) = 0; |
| 93 | 94 |
| 94 // Creates a MetricsLogUploader with the specified parameters (see comments on | 95 // Creates a MetricsLogUploader with the specified parameters (see comments on |
| 95 // MetricsLogUploader for details). | 96 // MetricsLogUploader for details). |
| 96 virtual scoped_ptr<MetricsLogUploader> CreateUploader( | 97 virtual scoped_ptr<MetricsLogUploader> CreateUploader( |
| 97 const base::Callback<void(int)>& on_upload_complete) = 0; | 98 const base::Callback<void(int)>& on_upload_complete) = 0; |
| 98 | 99 |
| 99 // Returns the standard interval between upload attempts. | 100 // Returns the standard interval between upload attempts. |
| 100 virtual base::TimeDelta GetStandardUploadInterval() = 0; | 101 virtual base::TimeDelta GetStandardUploadInterval() = 0; |
| 101 | 102 |
| 103 // Returns the task runner for the main thread. |
| 104 virtual scoped_refptr<base::SingleThreadTaskRunner> |
| 105 GetMainThreadTaskRunner() = 0; |
| 106 |
| 102 // Returns the name of a key under HKEY_CURRENT_USER that can be used to store | 107 // Returns the name of a key under HKEY_CURRENT_USER that can be used to store |
| 103 // backups of metrics data. Unused except on Windows. | 108 // backups of metrics data. Unused except on Windows. |
| 104 virtual base::string16 GetRegistryBackupKey(); | 109 virtual base::string16 GetRegistryBackupKey(); |
| 105 | 110 |
| 106 // Called on plugin loading errors. | 111 // Called on plugin loading errors. |
| 107 virtual void OnPluginLoadingError(const base::FilePath& plugin_path) {} | 112 virtual void OnPluginLoadingError(const base::FilePath& plugin_path) {} |
| 108 | 113 |
| 109 // Called on renderer crashes in some embedders (e.g., those that do not use | 114 // Called on renderer crashes in some embedders (e.g., those that do not use |
| 110 // //content and thus do not have //content's notification system available | 115 // //content and thus do not have //content's notification system available |
| 111 // as a mechanism for observing renderer crashes). | 116 // as a mechanism for observing renderer crashes). |
| 112 virtual void OnRendererProcessCrash() {} | 117 virtual void OnRendererProcessCrash() {} |
| 113 | 118 |
| 114 // Returns whether metrics reporting is managed by policy. | 119 // Returns whether metrics reporting is managed by policy. |
| 115 virtual bool IsReportingPolicyManaged(); | 120 virtual bool IsReportingPolicyManaged(); |
| 116 | 121 |
| 117 // Gets information about the default value for the enable metrics reporting | 122 // Gets information about the default value for the enable metrics reporting |
| 118 // checkbox shown during first-run. | 123 // checkbox shown during first-run. |
| 119 virtual EnableMetricsDefault GetDefaultOptIn(); | 124 virtual EnableMetricsDefault GetDefaultOptIn(); |
| 120 | 125 |
| 121 // Returns whether cellular logic is enabled for metrics reporting. | 126 // Returns whether cellular logic is enabled for metrics reporting. |
| 122 virtual bool IsUMACellularUploadLogicEnabled(); | 127 virtual bool IsUMACellularUploadLogicEnabled(); |
| 123 }; | 128 }; |
| 124 | 129 |
| 125 } // namespace metrics | 130 } // namespace metrics |
| 126 | 131 |
| 127 #endif // COMPONENTS_METRICS_METRICS_SERVICE_CLIENT_H_ | 132 #endif // COMPONENTS_METRICS_METRICS_SERVICE_CLIENT_H_ |
| OLD | NEW |