Add ENABLE_MEDIA_ROUTER define to builds other than Android and iOS.
[chromium-blink-merge.git] / chrome / browser / android / metrics / uma_bridge.cc
blobbdfe849126f769ddff1eae82b63b9d3c6fa0ff6f
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;
16 static void RecordMenuShow(JNIEnv*, jclass) {
17 RecordAction(UserMetricsAction("MobileMenuShow"));
20 static void RecordUsingMenu(JNIEnv*,
21 jclass,
22 jboolean is_by_hw_button,
23 jboolean is_dragging) {
24 if (is_by_hw_button) {
25 if (is_dragging) {
26 NOTREACHED() << "We do not support dragging for hardware menu button.";
27 } else {
28 RecordAction(UserMetricsAction("MobileUsingMenuByHwButtonTap"));
30 } else {
31 if (is_dragging) {
32 RecordAction(UserMetricsAction("MobileUsingMenuBySwButtonDragging"));
33 } else {
34 RecordAction(UserMetricsAction("MobileUsingMenuBySwButtonTap"));
39 // Android Beam
41 static void RecordBeamCallbackSuccess(JNIEnv*, jclass) {
42 RecordAction(UserMetricsAction("MobileBeamCallbackSuccess"));
45 static void RecordBeamInvalidAppState(JNIEnv*, jclass) {
46 RecordAction(UserMetricsAction("MobileBeamInvalidAppState"));
49 // First Run Experience
50 static void RecordFreSignInShown(JNIEnv*, jclass) {
51 RecordAction(UserMetricsAction("MobileFre.SignInShown"));
54 namespace chrome {
55 namespace android {
57 // Register native methods
58 bool RegisterUmaBridge(JNIEnv* env) {
59 return RegisterNativesImpl(env);
62 } // namespace android
63 } // namespace chrome