OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_BROWSER_UI_WEBUI_NTP_METRICS_HANDLER_H_ |
| 6 #define CHROME_BROWSER_UI_WEBUI_NTP_METRICS_HANDLER_H_ |
| 7 |
| 8 #include "content/browser/webui/web_ui.h" |
| 9 |
| 10 /////////////////////////////////////////////////////////////////////////////// |
| 11 // MetricsHandler |
| 12 |
| 13 // 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 // 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 // dashboard with the action names you use, as our processor won't catch that |
| 18 // information (treat it as RecordComputedMetrics) |
| 19 |
| 20 namespace base { |
| 21 class ListValue; |
| 22 } |
| 23 |
| 24 class MetricsHandler : public WebUIMessageHandler { |
| 25 public: |
| 26 MetricsHandler(); |
| 27 virtual ~MetricsHandler(); |
| 28 |
| 29 // WebUIMessageHandler implementation. |
| 30 virtual void RegisterMessages() OVERRIDE; |
| 31 |
| 32 // Callback for the "metricsHandler:recordAction" message. This records a |
| 33 // user action. |
| 34 void HandleRecordAction(const base::ListValue* args); |
| 35 |
| 36 // Callback for the "metricsHandler:recordInHistogram" message. This records |
| 37 // into a histogram. |args| contains the histogram name, the value to record, |
| 38 // and the maximum allowed value, which can be at most 4000. The histogram |
| 39 // will use at most 100 buckets, one for each 1, 10, or 100 different values, |
| 40 // depending on the maximum value. |
| 41 void HandleRecordInHistogram(const base::ListValue* args); |
| 42 |
| 43 // Callback for the "metricsHandler:logEventTime" message. |
| 44 void HandleLogEventTime(const base::ListValue* args); |
| 45 |
| 46 private: |
| 47 DISALLOW_COPY_AND_ASSIGN(MetricsHandler); |
| 48 }; |
| 49 |
| 50 #endif // CHROME_BROWSER_UI_WEBUI_NTP_METRICS_HANDLER_H_ |
OLD | NEW |