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"
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
*,
23 jboolean is_by_hw_button
,
24 jboolean is_dragging
) {
25 if (is_by_hw_button
) {
27 NOTREACHED() << "We do not support dragging for hardware menu button.";
29 RecordAction(UserMetricsAction("MobileUsingMenuByHwButtonTap"));
33 RecordAction(UserMetricsAction("MobileUsingMenuBySwButtonDragging"));
35 RecordAction(UserMetricsAction("MobileUsingMenuBySwButtonTap"));
42 static void RecordBeamCallbackSuccess(JNIEnv
*, jclass
) {
43 RecordAction(UserMetricsAction("MobileBeamCallbackSuccess"));
46 static void RecordBeamInvalidAppState(JNIEnv
*, jclass
) {
47 RecordAction(UserMetricsAction("MobileBeamInvalidAppState"));
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",
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",
85 // Register native methods
86 bool RegisterUmaBridge(JNIEnv
* env
) {
87 return RegisterNativesImpl(env
);
90 } // namespace android