OLD | NEW |
| (Empty) |
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. | |
4 | |
5 package org.chromium.chrome.browser; | |
6 | |
7 import org.chromium.chrome.browser.preferences.bandwidth.BandwidthReductionPrefe
rences; | |
8 import org.chromium.chrome.browser.preferences.bandwidth.DataReductionPromoScree
n; | |
9 | |
10 /** | |
11 * Static methods to record user actions. | |
12 * | |
13 * We have a different native method for each action as we want to use c++ code
to | |
14 * extract user command keys from code and show them in the dashboard. | |
15 * See: chromium/src/content/browser/user_metrics.h for more details. | |
16 */ | |
17 public class UmaBridge { | |
18 | |
19 /** | |
20 * Record that the user opened the menu. | |
21 */ | |
22 public static void menuShow() { | |
23 nativeRecordMenuShow(); | |
24 } | |
25 | |
26 /** | |
27 * Record that the user opened the menu through software menu button. | |
28 * @param isByHwButton | |
29 * @param isDragging | |
30 */ | |
31 public static void usingMenu(boolean isByHwButton, boolean isDragging) { | |
32 nativeRecordUsingMenu(isByHwButton, isDragging); | |
33 } | |
34 | |
35 // Android beam | |
36 | |
37 public static void beamCallbackSuccess() { | |
38 nativeRecordBeamCallbackSuccess(); | |
39 } | |
40 | |
41 public static void beamInvalidAppState() { | |
42 nativeRecordBeamInvalidAppState(); | |
43 } | |
44 | |
45 // Data Saver | |
46 | |
47 /** | |
48 * Record that Data Saver was turned on. | |
49 */ | |
50 public static void dataReductionProxyTurnedOn() { | |
51 nativeRecordDataReductionProxyTurnedOn(); | |
52 } | |
53 | |
54 /** | |
55 * Record that Data Saver was turned off. | |
56 */ | |
57 public static void dataReductionProxyTurnedOff() { | |
58 nativeRecordDataReductionProxyTurnedOff(); | |
59 } | |
60 | |
61 /** | |
62 * Record that Data Saver was turned on immediately after the user viewed th
e promo screen. | |
63 */ | |
64 public static void dataReductionProxyTurnedOnFromPromo() { | |
65 nativeRecordDataReductionProxyTurnedOnFromPromo(); | |
66 } | |
67 | |
68 /** | |
69 * Record the DataReductionProxy.PromoAction histogram. | |
70 * @param action User action at the promo screen | |
71 */ | |
72 public static void dataReductionProxyPromoAction(int action) { | |
73 assert action >= 0 && action < DataReductionPromoScreen.ACTION_INDEX_BOU
NDARY; | |
74 nativeRecordDataReductionProxyPromoAction( | |
75 action, DataReductionPromoScreen.ACTION_INDEX_BOUNDARY); | |
76 } | |
77 | |
78 /** | |
79 * Record that the Data Saver promo was displayed. | |
80 */ | |
81 public static void dataReductionProxyPromoDisplayed() { | |
82 nativeRecordDataReductionProxyPromoDisplayed(); | |
83 } | |
84 | |
85 /** | |
86 * Record the DataReductionProxy.SettingsConversion histogram. | |
87 * @param statusChange ON/OFF change at the data saver setting menu | |
88 */ | |
89 public static void dataReductionProxySettings(int statusChange) { | |
90 assert statusChange >= 0 | |
91 && statusChange < BandwidthReductionPreferences.DATA_REDUCTION_I
NDEX_BOUNDARY; | |
92 nativeRecordDataReductionProxySettings( | |
93 statusChange, BandwidthReductionPreferences.DATA_REDUCTION_INDEX
_BOUNDARY); | |
94 } | |
95 | |
96 private static native void nativeRecordMenuShow(); | |
97 private static native void nativeRecordUsingMenu(boolean isByHwButton, boole
an isDragging); | |
98 private static native void nativeRecordBeamInvalidAppState(); | |
99 private static native void nativeRecordBeamCallbackSuccess(); | |
100 private static native void nativeRecordDataReductionProxyTurnedOn(); | |
101 private static native void nativeRecordDataReductionProxyTurnedOff(); | |
102 private static native void nativeRecordDataReductionProxyTurnedOnFromPromo()
; | |
103 private static native void nativeRecordDataReductionProxyPromoAction(int act
ion, int boundary); | |
104 private static native void nativeRecordDataReductionProxyPromoDisplayed(); | |
105 private static native void nativeRecordDataReductionProxySettings(int status
Change, | |
106 int boundary); | |
107 } | |
OLD | NEW |