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

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

Issue 8342048: Make NotificationService an interface in the content namespace, and switch callers to use it. Mov... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 2 months 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 | Annotate | Revision Log
« no previous file with comments | « content/browser/tab_contents/tab_contents.cc ('k') | content/common/child_thread.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/browser/browser_thread.h"
8 #include "content/common/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 NotificationService::current()->Notify( 27 content::NotificationService::current()->Notify(
28 content::NOTIFICATION_USER_ACTION, 28 content::NOTIFICATION_USER_ACTION,
29 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/tab_contents.cc ('k') | content/common/child_thread.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698