| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 CONTENT_PUBLIC_BROWSER_USER_METRICS_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_USER_METRICS_H_ |
| 6 #define CONTENT_PUBLIC_BROWSER_USER_METRICS_H_ | 6 #define CONTENT_PUBLIC_BROWSER_USER_METRICS_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 // out for review to be updated. | 44 // out for review to be updated. |
| 45 // | 45 // |
| 46 // For more complicated situations (like when there are many different | 46 // For more complicated situations (like when there are many different |
| 47 // possible actions), see RecordComputedAction. | 47 // possible actions), see RecordComputedAction. |
| 48 CONTENT_EXPORT void RecordAction(const UserMetricsAction& action); | 48 CONTENT_EXPORT void RecordAction(const UserMetricsAction& action); |
| 49 | 49 |
| 50 // This function has identical input and behavior to RecordAction, but is | 50 // This function has identical input and behavior to RecordAction, but is |
| 51 // not automatically found by the action-processing scripts. It can be used | 51 // not automatically found by the action-processing scripts. It can be used |
| 52 // when it's a pain to enumerate all possible actions, but if you use this | 52 // when it's a pain to enumerate all possible actions, but if you use this |
| 53 // you need to also update the rules for extracting known actions in | 53 // you need to also update the rules for extracting known actions in |
| 54 // chrome/tools/extract_actions.py. | 54 // tools/metrics/actions/extract_actions.py. |
| 55 CONTENT_EXPORT void RecordComputedAction(const std::string& action); | 55 CONTENT_EXPORT void RecordComputedAction(const std::string& action); |
| 56 | 56 |
| 57 // Called with the action string. | 57 // Called with the action string. |
| 58 typedef base::Callback<void(const std::string&)> ActionCallback; | 58 typedef base::Callback<void(const std::string&)> ActionCallback; |
| 59 | 59 |
| 60 // Add/remove action callbacks (see above). | 60 // Add/remove action callbacks (see above). |
| 61 CONTENT_EXPORT void AddActionCallback(const ActionCallback& callback); | 61 CONTENT_EXPORT void AddActionCallback(const ActionCallback& callback); |
| 62 CONTENT_EXPORT void RemoveActionCallback(const ActionCallback& callback); | 62 CONTENT_EXPORT void RemoveActionCallback(const ActionCallback& callback); |
| 63 | 63 |
| 64 } // namespace content | 64 } // namespace content |
| 65 | 65 |
| 66 #endif // CONTENT_PUBLIC_BROWSER_USER_METRICS_H_ | 66 #endif // CONTENT_PUBLIC_BROWSER_USER_METRICS_H_ |
| OLD | NEW |