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

Side by Side Diff: chrome/browser/ui/webui/metrics_handler.h

Issue 8986007: Move WebUIMessageHandler to its own file in the public directory and put it in the content namesp... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 8 years, 11 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
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 #ifndef CHROME_BROWSER_UI_WEBUI_METRICS_HANDLER_H_ 5 #ifndef CHROME_BROWSER_UI_WEBUI_METRICS_HANDLER_H_
6 #define CHROME_BROWSER_UI_WEBUI_METRICS_HANDLER_H_ 6 #define CHROME_BROWSER_UI_WEBUI_METRICS_HANDLER_H_
7 7
8 #include "content/browser/webui/web_ui.h" 8 #include "base/compiler_specific.h"
9 #include "content/public/browser/web_ui_message_handler.h"
9 10
10 /////////////////////////////////////////////////////////////////////////////// 11 ///////////////////////////////////////////////////////////////////////////////
11 // MetricsHandler 12 // MetricsHandler
12 13
13 // Let the page contents record UMA actions. Only use when you can't do it from 14 // Let the page contents record UMA actions. Only use when you can't do it from
14 // C++. For example, we currently use it to let the NTP log the postion of the 15 // C++. For example, we currently use it to let the NTP log the postion of the
15 // Most Visited or Bookmark the user clicked on, as we don't get that 16 // Most Visited or Bookmark the user clicked on, as we don't get that
16 // information through RequestOpenURL. You will need to update the metrics 17 // information through RequestOpenURL. You will need to update the metrics
17 // dashboard with the action names you use, as our processor won't catch that 18 // dashboard with the action names you use, as our processor won't catch that
18 // information (treat it as RecordComputedMetrics) 19 // information (treat it as RecordComputedMetrics)
19 20
20 namespace base { 21 namespace base {
21 class ListValue; 22 class ListValue;
22 } 23 }
23 24
24 class MetricsHandler : public WebUIMessageHandler { 25 class MetricsHandler : public content::WebUIMessageHandler {
25 public: 26 public:
26 MetricsHandler(); 27 MetricsHandler();
27 virtual ~MetricsHandler(); 28 virtual ~MetricsHandler();
28 29
29 // WebUIMessageHandler implementation. 30 // WebUIMessageHandler implementation.
30 virtual void RegisterMessages() OVERRIDE; 31 virtual void RegisterMessages() OVERRIDE;
31 32
32 // Callback for the "metricsHandler:recordAction" message. This records a 33 // Callback for the "metricsHandler:recordAction" message. This records a
33 // user action. 34 // user action.
34 void HandleRecordAction(const base::ListValue* args); 35 void HandleRecordAction(const base::ListValue* args);
35 36
36 // TODO(dbeam): http://crbug.com/104338 37 // TODO(dbeam): http://crbug.com/104338
37 38
38 // Callback for the "metricsHandler:recordInHistogram" message. This records 39 // Callback for the "metricsHandler:recordInHistogram" message. This records
39 // into a histogram. |args| contains the histogram name, the value to record, 40 // into a histogram. |args| contains the histogram name, the value to record,
40 // and the maximum allowed value, which can be at most 4000. The histogram 41 // and the maximum allowed value, which can be at most 4000. The histogram
41 // will use at most 100 buckets, one for each 1, 10, or 100 different values, 42 // will use at most 100 buckets, one for each 1, 10, or 100 different values,
42 // depending on the maximum value. 43 // depending on the maximum value.
43 void HandleRecordInHistogram(const base::ListValue* args); 44 void HandleRecordInHistogram(const base::ListValue* args);
44 45
45 // Callback for the "metricsHandler:logEventTime" message. 46 // Callback for the "metricsHandler:logEventTime" message.
46 void HandleLogEventTime(const base::ListValue* args); 47 void HandleLogEventTime(const base::ListValue* args);
47 48
48 private: 49 private:
49 DISALLOW_COPY_AND_ASSIGN(MetricsHandler); 50 DISALLOW_COPY_AND_ASSIGN(MetricsHandler);
50 }; 51 };
51 52
52 #endif // CHROME_BROWSER_UI_WEBUI_METRICS_HANDLER_H_ 53 #endif // CHROME_BROWSER_UI_WEBUI_METRICS_HANDLER_H_
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/media/media_internals_proxy.cc ('k') | chrome/browser/ui/webui/metrics_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698