| 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 BASE_METRICS_USER_METRICS_H_ | 5 #ifndef BASE_METRICS_USER_METRICS_H_ |
| 6 #define BASE_METRICS_USER_METRICS_H_ | 6 #define BASE_METRICS_USER_METRICS_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/base_export.h" | 10 #include "base/base_export.h" |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 // possible actions), see RecordComputedAction. | 41 // possible actions), see RecordComputedAction. |
| 42 BASE_EXPORT void RecordAction(const UserMetricsAction& action); | 42 BASE_EXPORT void RecordAction(const UserMetricsAction& action); |
| 43 | 43 |
| 44 // This function has identical input and behavior to RecordAction, but is | 44 // This function has identical input and behavior to RecordAction, but is |
| 45 // not automatically found by the action-processing scripts. It can be used | 45 // not automatically found by the action-processing scripts. It can be used |
| 46 // when it's a pain to enumerate all possible actions, but if you use this | 46 // when it's a pain to enumerate all possible actions, but if you use this |
| 47 // you need to also update the rules for extracting known actions in | 47 // you need to also update the rules for extracting known actions in |
| 48 // tools/metrics/actions/extract_actions.py. | 48 // tools/metrics/actions/extract_actions.py. |
| 49 BASE_EXPORT void RecordComputedAction(const std::string& action); | 49 BASE_EXPORT void RecordComputedAction(const std::string& action); |
| 50 | 50 |
| 51 // This function records a sample string along with the metric using RAPPOR. |
| 52 BASE_EXPORT void RecordRappor( |
| 53 const std::string& metric, |
| 54 const std::string& sample); |
| 55 |
| 51 // Called with the action string. | 56 // Called with the action string. |
| 52 typedef base::Callback<void(const std::string&)> ActionCallback; | 57 typedef base::Callback<void(const std::string&)> ActionCallback; |
| 53 | 58 |
| 54 // Add/remove action callbacks (see above). | 59 // Add/remove action callbacks (see above). |
| 55 BASE_EXPORT void AddActionCallback(const ActionCallback& callback); | 60 BASE_EXPORT void AddActionCallback(const ActionCallback& callback); |
| 56 BASE_EXPORT void RemoveActionCallback(const ActionCallback& callback); | 61 BASE_EXPORT void RemoveActionCallback(const ActionCallback& callback); |
| 57 | 62 |
| 63 typedef base::Callback<void( |
| 64 const std::string&, |
| 65 const std::string&)> RapporCallback; |
| 66 |
| 67 BASE_EXPORT void AddRapporCallback(const RapporCallback& callback); |
| 68 |
| 58 } // namespace base | 69 } // namespace base |
| 59 | 70 |
| 60 #endif // BASE_METRICS_USER_METRICS_H_ | 71 #endif // BASE_METRICS_USER_METRICS_H_ |
| OLD | NEW |