Battery Status API: add UMA logging for Linux.
[chromium-blink-merge.git] / content / browser / user_metrics.cc
blob200c851ccb170a20d8e51486b7bcd286fc70ec98
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "content/public/browser/user_metrics.h"
7 #include <vector>
9 #include "base/bind.h"
10 #include "base/metrics/user_metrics.h"
11 #include "content/public/browser/browser_thread.h"
13 namespace content {
15 void RecordAction(const base::UserMetricsAction& action) {
16 if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) {
17 BrowserThread::PostTask(
18 BrowserThread::UI,
19 FROM_HERE,
20 base::Bind(&RecordAction, action));
21 return;
24 base::RecordAction(action);
27 void RecordComputedAction(const std::string& action) {
28 if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) {
29 BrowserThread::PostTask(
30 BrowserThread::UI,
31 FROM_HERE,
32 base::Bind(&RecordComputedAction, action));
33 return;
36 base::RecordComputedAction(action);
39 } // namespace content