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/uma_bridge.h"
9 #include "content/public/browser/user_metrics.h"
10 #include "jni/UmaBridge_jni.h"
12 using base::UserMetricsAction
;
13 using content::RecordAction
;
14 using content::RecordComputedAction
;
16 static void RecordMenuShow(JNIEnv
*, jclass
) {
17 RecordAction(UserMetricsAction("MobileMenuShow"));
20 static void RecordUsingMenu(JNIEnv
*,
22 jboolean is_by_hw_button
,
23 jboolean is_dragging
) {
24 if (is_by_hw_button
) {
26 NOTREACHED() << "We do not support dragging for hardware menu button.";
28 RecordAction(UserMetricsAction("MobileUsingMenuByHwButtonTap"));
32 RecordAction(UserMetricsAction("MobileUsingMenuBySwButtonDragging"));
34 RecordAction(UserMetricsAction("MobileUsingMenuBySwButtonTap"));
40 static void RecordBeamCallbackSuccess(JNIEnv
*, jclass
) {
41 RecordAction(UserMetricsAction("MobileBeamCallbackSuccess"));
44 static void RecordBeamInvalidAppState(JNIEnv
*, jclass
) {
45 RecordAction(UserMetricsAction("MobileBeamInvalidAppState"));
51 // Register native methods
52 bool RegisterUmaBridge(JNIEnv
* env
) {
53 return RegisterNativesImpl(env
);
56 } // namespace android