ozone: evdev: Sync caps lock LED state to evdev
[chromium-blink-merge.git] / chrome / browser / android / metrics / uma_bridge.cc
blob9577106e2e2c9415a9ce6885a652535fb48148da
1 // Copyright 2013 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.
5 #include "chrome/browser/android/metrics/uma_bridge.h"
7 #include <jni.h>
9 #include "base/metrics/histogram.h"
10 #include "content/public/browser/user_metrics.h"
11 #include "jni/UmaBridge_jni.h"
13 using base::UserMetricsAction;
14 using content::RecordAction;
15 using content::RecordComputedAction;
17 static void RecordMenuShow(JNIEnv*, jclass) {
18 RecordAction(UserMetricsAction("MobileMenuShow"));
21 static void RecordUsingMenu(JNIEnv*,
22 jclass,
23 jboolean is_by_hw_button,
24 jboolean is_dragging) {
25 if (is_by_hw_button) {
26 if (is_dragging) {
27 NOTREACHED() << "We do not support dragging for hardware menu button.";
28 } else {
29 RecordAction(UserMetricsAction("MobileUsingMenuByHwButtonTap"));
31 } else {
32 if (is_dragging) {
33 RecordAction(UserMetricsAction("MobileUsingMenuBySwButtonDragging"));
34 } else {
35 RecordAction(UserMetricsAction("MobileUsingMenuBySwButtonTap"));
40 // Android Beam
42 static void RecordBeamCallbackSuccess(JNIEnv*, jclass) {
43 RecordAction(UserMetricsAction("MobileBeamCallbackSuccess"));
46 static void RecordBeamInvalidAppState(JNIEnv*, jclass) {
47 RecordAction(UserMetricsAction("MobileBeamInvalidAppState"));
50 // Data Saver
52 static void RecordDataReductionProxyTurnedOn(JNIEnv*, jclass) {
53 RecordAction(UserMetricsAction("DataReductionProxy_TurnedOn"));
56 static void RecordDataReductionProxyTurnedOff(JNIEnv*, jclass) {
57 RecordAction(UserMetricsAction("DataReductionProxy_TurnedOff"));
60 static void RecordDataReductionProxyTurnedOnFromPromo(JNIEnv*, jclass) {
61 RecordAction(UserMetricsAction("DataReductionProxy_TurnedOnFromPromo"));
64 static void RecordDataReductionProxyPromoAction(
65 JNIEnv*, jclass, jint action, jint boundary) {
66 UMA_HISTOGRAM_ENUMERATION("DataReductionProxy.PromoAction",
67 action,
68 boundary);
71 static void RecordDataReductionProxyPromoDisplayed(JNIEnv*, jclass) {
72 RecordAction(UserMetricsAction("DataReductionProxy_PromoDisplayed"));
75 static void RecordDataReductionProxySettings(
76 JNIEnv*, jclass, jint notification, jint boundary) {
77 UMA_HISTOGRAM_ENUMERATION("DataReductionProxy.SettingsConversion",
78 notification,
79 boundary);
82 namespace chrome {
83 namespace android {
85 // Register native methods
86 bool RegisterUmaBridge(JNIEnv* env) {
87 return RegisterNativesImpl(env);
90 } // namespace android
91 } // namespace chrome