Chromium Code Reviews| Index: chrome/browser/chromeos/external_metrics.cc |
| diff --git a/chrome/browser/chromeos/external_metrics.cc b/chrome/browser/chromeos/external_metrics.cc |
| index 73e24d82a873bc6e35f688486e2144f6b3d6f70c..0a0e903840c264967d490304ed131f1c61a2f9b1 100644 |
| --- a/chrome/browser/chromeos/external_metrics.cc |
| +++ b/chrome/browser/chromeos/external_metrics.cc |
| @@ -21,63 +21,24 @@ |
| #include "chrome/browser/browser_thread.h" |
| #include "chrome/browser/metrics/user_metrics.h" |
| -// Steps to add an action. |
| -// |
| -// 1. Enter a helper function that calls UserMetrics::RecordAction. |
| -// |
| -// 2. Add a line for that function in InitializeUserActions. |
| -// |
| -// 3. Enjoy the recompilation. |
| -// |
| -// TODO(semenzato): should see if it is possible to avoid recompiling code |
| -// every time a new user action is added, and register it in some other way. |
| - |
| namespace chromeos { |
| // The interval between external metrics collections, in milliseconds. |
| static const int kExternalMetricsCollectionIntervalMs = 30 * 1000; |
| -// There is one of the following functions for every user action as we have to |
| -// call RecordAction in a way that gets picked up by the processing scripts. |
| -static void RecordTabOverviewKeystroke() { |
| - UserMetrics::RecordAction(UserMetricsAction("TabOverview_Keystroke")); |
| -} |
| - |
| -static void RecordTabOverviewExitMouse() { |
| - UserMetrics::RecordAction(UserMetricsAction("TabOverview_ExitMouse")); |
| -} |
| - |
| void ExternalMetrics::Start() { |
| - InitializeUserActions(); |
| ScheduleCollector(); |
| } |
| -void ExternalMetrics::DefineUserAction(const std::string& name, |
| - RecordFunctionType f) { |
| - DCHECK(action_recorders_.find(name) == action_recorders_.end()); |
| - action_recorders_[name] = f; |
| -} |
| - |
| -void ExternalMetrics::InitializeUserActions() { |
| - DefineUserAction("TabOverviewExitMouse", RecordTabOverviewExitMouse); |
|
Daniel Erat
2011/01/20 00:44:23
I don't think that these exist anymore, so I'm not
petkov
2011/01/20 01:00:53
I'm not sure these ever existed...
|
| - DefineUserAction("TabOverviewKeystroke", RecordTabOverviewKeystroke); |
| -} |
| - |
| void ExternalMetrics::RecordActionUI(std::string action_string) { |
| - base::hash_map<std::string, RecordFunctionType>::const_iterator iterator; |
| - iterator = action_recorders_.find(action_string); |
| - if (iterator == action_recorders_.end()) { |
| - LOG(ERROR) << "undefined UMA action: " << action_string; |
| - } else { |
| - iterator->second(); |
| - } |
| + UserMetrics::RecordComputedAction(action_string); |
| } |
| void ExternalMetrics::RecordAction(const char* action) { |
| std::string action_string(action); |
| BrowserThread::PostTask( |
| BrowserThread::UI, FROM_HERE, |
| - NewRunnableMethod(this, &ExternalMetrics::RecordActionUI, action)); |
| + NewRunnableMethod(this, &ExternalMetrics::RecordActionUI, action_string)); |
| } |
| void ExternalMetrics::RecordHistogram(const char* histogram_data) { |