Chromium Code Reviews| Index: content/browser/user_metrics.cc |
| diff --git a/content/browser/user_metrics.cc b/content/browser/user_metrics.cc |
| index b3596543154ca076b686a1093775c84493cf709d..c7a9cfc2159a45000ec9b5f50a3a28de7129c582 100644 |
| --- a/content/browser/user_metrics.cc |
| +++ b/content/browser/user_metrics.cc |
| @@ -2,27 +2,28 @@ |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| -#include "content/browser/user_metrics.h" |
| +#include "content/public/browser/user_metrics.h" |
| #include "base/bind.h" |
| #include "content/public/browser/browser_thread.h" |
| #include "content/public/browser/notification_service.h" |
| #include "content/public/browser/notification_types.h" |
| +#include "content/public/browser/user_metrics.h" |
|
jam
2011/12/14 01:18:38
nit: redundant
|
| -using content::BrowserThread; |
| +namespace { |
| -void UserMetrics::RecordAction(const UserMetricsAction& action) { |
| - Record(action.str_); |
| -} |
| +using content::BrowserThread; |
| +using content::UserMetricsAction; |
| -void UserMetrics::RecordComputedAction(const std::string& action) { |
| - Record(action.c_str()); |
| -} |
| +// Forward declare because of circular dependency. |
| +void CallRecordOnUI(const std::string& action); |
| -void UserMetrics::Record(const char *action) { |
| +void Record(const char *action) { |
| if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) { |
| - BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, |
| - base::Bind(&UserMetrics::CallRecordOnUI, action)); |
| + BrowserThread::PostTask( |
| + BrowserThread::UI, |
| + FROM_HERE, |
| + base::Bind(&CallRecordOnUI, action)); |
| return; |
| } |
| @@ -32,6 +33,20 @@ void UserMetrics::Record(const char *action) { |
| content::Details<const char*>(&action)); |
| } |
| -void UserMetrics::CallRecordOnUI(const std::string& action) { |
| +void CallRecordOnUI(const std::string& action) { |
| Record(action.c_str()); |
| } |
| + |
| +} // namespace |
| + |
| +namespace content { |
| + |
| +void RecordAction(const UserMetricsAction& action) { |
| + Record(action.str_); |
| +} |
| + |
| +void RecordComputedAction(const std::string& action) { |
| + Record(action.c_str()); |
| +} |
| + |
| +} // namespace content |