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

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

Issue 7327007: Moving notification types which are chrome specific to a new header file chrome_notification_type... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 5 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_view.cc ('k') | content/common/child_process_host.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/common/notification_service.h"
9 9
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(NotificationType::USER_ACTION, 27 NotificationService::current()->Notify(content::NOTIFICATION_USER_ACTION,
28 NotificationService::AllSources(), 28 NotificationService::AllSources(),
29 Details<const char*>(&action)); 29 Details<const char*>(&action));
30 } 30 }
31 31
32 void UserMetrics::CallRecordOnUI(const std::string& action) { 32 void UserMetrics::CallRecordOnUI(const std::string& action) {
33 Record(action.c_str()); 33 Record(action.c_str());
34 } 34 }
OLDNEW
« no previous file with comments | « content/browser/tab_contents/tab_contents_view.cc ('k') | content/common/child_process_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698