Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(31)

Side by Side Diff: content/browser/user_metrics.cc

Issue 8340028: Salient parts of http://codereview.chromium.org/8392042/ (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 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 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 #include "content/browser/user_metrics.h" 5 #include "content/browser/user_metrics.h"
6 6
7 #include "content/browser/browser_thread.h" 7 #include "content/public/browser/browser_thread.h"
8 #include "content/public/browser/notification_service.h" 8 #include "content/public/browser/notification_service.h"
9 #include "content/public/browser/notification_types.h" 9 #include "content/public/browser/notification_types.h"
10 10
11 void UserMetrics::RecordAction(const UserMetricsAction& action) { 11 void UserMetrics::RecordAction(const UserMetricsAction& action) {
12 Record(action.str_); 12 Record(action.str_);
13 } 13 }
14 14
15 void UserMetrics::RecordComputedAction(const std::string& action) { 15 void UserMetrics::RecordComputedAction(const std::string& action) {
16 Record(action.c_str()); 16 Record(action.c_str());
17 } 17 }
18 18
19 void UserMetrics::Record(const char *action) { 19 void UserMetrics::Record(const char *action) {
20 if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) { 20 if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) {
21 BrowserThread::PostTask( 21 BrowserThread::PostTask(
22 BrowserThread::UI, FROM_HERE, 22 BrowserThread::UI, FROM_HERE,
23 NewRunnableFunction(&UserMetrics::CallRecordOnUI, action)); 23 NewRunnableFunction(&UserMetrics::CallRecordOnUI, action));
24 return; 24 return;
25 } 25 }
26 26
27 content::NotificationService::current()->Notify( 27 content::NotificationService::current()->Notify(
28 content::NOTIFICATION_USER_ACTION, 28 content::NOTIFICATION_USER_ACTION,
29 content::NotificationService::AllSources(), 29 content::NotificationService::AllSources(),
30 content::Details<const char*>(&action)); 30 content::Details<const char*>(&action));
31 } 31 }
32 32
33 void UserMetrics::CallRecordOnUI(const std::string& action) { 33 void UserMetrics::CallRecordOnUI(const std::string& action) {
34 Record(action.c_str()); 34 Record(action.c_str());
35 } 35 }
OLDNEW
« no previous file with comments | « content/browser/tab_contents/web_drag_source_mac.mm ('k') | content/browser/utility_process_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698