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

Side by Side Diff: content/public/browser/user_metrics.h

Issue 12039079: content: convert user action notification to observer usage (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 10 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/public/browser/notification_types.h ('k') | no next file » | 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #ifndef CONTENT_PUBLIC_BROWSER_USER_METRICS_H_ 5 #ifndef CONTENT_PUBLIC_BROWSER_USER_METRICS_H_
6 #define CONTENT_PUBLIC_BROWSER_USER_METRICS_H_ 6 #define CONTENT_PUBLIC_BROWSER_USER_METRICS_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/callback.h"
10 #include "content/common/content_export.h" 11 #include "content/common/content_export.h"
11 12
12 namespace content { 13 namespace content {
13 14
14 // This module provides some helper functions for logging actions tracked by 15 // This module provides some helper functions for logging actions tracked by
15 // the user metrics system. 16 // the user metrics system.
16 17
17 18
18 // UserMetricsAction exist purely to standardize on the paramters passed to 19 // UserMetricsAction exist purely to standardize on the paramters passed to
19 // UserMetrics. That way, our toolset can scan the sourcecode reliable for 20 // UserMetrics. That way, our toolset can scan the sourcecode reliable for
(...skipping 23 matching lines...) Expand all
43 // possible actions), see RecordComputedAction. 44 // possible actions), see RecordComputedAction.
44 CONTENT_EXPORT void RecordAction(const UserMetricsAction& action); 45 CONTENT_EXPORT void RecordAction(const UserMetricsAction& action);
45 46
46 // This function has identical input and behavior to RecordAction, but is 47 // This function has identical input and behavior to RecordAction, but is
47 // not automatically found by the action-processing scripts. It can be used 48 // not automatically found by the action-processing scripts. It can be used
48 // when it's a pain to enumerate all possible actions, but if you use this 49 // when it's a pain to enumerate all possible actions, but if you use this
49 // you need to also update the rules for extracting known actions in 50 // you need to also update the rules for extracting known actions in
50 // chrome/tools/extract_actions.py. 51 // chrome/tools/extract_actions.py.
51 CONTENT_EXPORT void RecordComputedAction(const std::string& action); 52 CONTENT_EXPORT void RecordComputedAction(const std::string& action);
52 53
54 // Called with the action string.
55 typedef base::Callback<void(const std::string&)> ActionCallback;
56
57 // Add/remove action callbacks (see above).
58 CONTENT_EXPORT void AddActionCallback(const ActionCallback& callback);
59 CONTENT_EXPORT void RemoveActionCallback(const ActionCallback& callback);
60
53 } // namespace content 61 } // namespace content
54 62
55 #endif // CONTENT_PUBLIC_BROWSER_USER_METRICS_H_ 63 #endif // CONTENT_PUBLIC_BROWSER_USER_METRICS_H_
OLDNEW
« no previous file with comments | « content/public/browser/notification_types.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698