Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
1 /* -*- Mode: Java; c-basic-offset: 4; tab-width: 20; indent-tabs-mode: nil; -*-
2 * This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 package org.mozilla.gecko;
8 /**
9 * Holds data definitions for our UI Telemetry implementation.
10 */
11 public interface TelemetryContract {
13 /**
14 * Holds event names. Intended for use with
15 * Telemetry.sendUIEvent() as the "action" parameter.
16 */
17 public interface Event {
18 // Cancel a state, action, etc.
19 public static final String CANCEL = "cancel.1";
21 // Outcome of data policy notification: can be true or false.
22 public static final String POLICY_NOTIFICATION_SUCCESS = "policynotification.success.1:";
24 // Top site pinned.
25 public static final String TOP_SITES_PIN = "pin.1";
27 // Top site un-pinned.
28 public static final String TOP_SITES_UNPIN = "unpin.1";
30 // Top site edited.
31 public static final String TOP_SITES_EDIT = "edit.1";
33 // Set default panel.
34 public static final String PANEL_SET_DEFAULT = "setdefault.1";
36 // Sharing content.
37 public static final String SHARE = "share.1";
39 // Sanitizing private data.
40 public static final String SANITIZE = "sanitize.1";
42 // Saving a resource (reader, bookmark, etc) for viewing later.
43 // Note: Only used in JavaScript for now, but here for completeness.
44 public static final String SAVE = "save.1";
46 // Stop holding a resource (reader, bookmark, etc) for viewing later.
47 // Note: Only used in JavaScript for now, but here for completeness.
48 public static final String UNSAVE = "unsave.1";
50 // Loading a URL.
51 public static final String LOAD_URL = "loadurl.1";
53 // Generic action, usually for tracking menu and toolbar actions.
54 public static final String ACTION = "action.1";
56 // Launching (opening) an external application
57 // Note: Only used in JavaScript for now, but here for completeness.
58 public static final String LAUNCH = "launch.1";
59 }
61 /**
62 * Holds event methods. Intended for use in
63 * Telemetry.sendUIEvent() as the "method" parameter.
64 */
65 public interface Method {
66 // Action triggered from a list.
67 public static final String LIST = "list";
69 // Action triggered from the action bar (including the toolbar).
70 public static final String ACTIONBAR = "actionbar";
72 // Action triggered by hitting the Android back button.
73 public static final String BACK = "back";
75 // Action triggered from a button.
76 public static final String BUTTON = "button";
78 // Action triggered from a dialog.
79 public static final String DIALOG = "dialog";
81 // Action occurred via an intent.
82 public static final String INTENT = "intent";
84 // Action occurred via the main menu.
85 public static final String MENU = "menu";
87 // Action occurred via a context menu.
88 public static final String CONTEXT_MENU = "contextmenu";
90 // Action triggered from a view grid item, like a thumbnail.
91 public static final String GRID_ITEM = "griditem";
93 // Action triggered from a view list item, like a row of a list.
94 public static final String LIST_ITEM = "listitem";
96 // Action triggered from a suggestion provided to the user.
97 public static final String SUGGESTION = "suggestion";
99 // Action triggered from a pageaction in the URLBar.
100 // Note: Only used in JavaScript for now, but here for completeness.
101 public static final String PAGEACTION = "pageaction";
102 }
104 /**
105 * Holds session names. Intended for use with
106 * Telemetry.startUISession() as the "sessionName" parameter.
107 */
108 public interface Session {
109 // Awesomescreen (including frecency search) is active.
110 public static final String AWESOMESCREEN = "awesomescreen.1";
112 // Started when a user enters about:home.
113 public static final String HOME = "home.1";
115 // Started when a user enters a given home panel.
116 // Session name is dynamic, encoded as "homepanel.1:<panel_id>"
117 public static final String HOME_PANEL = "homepanel.1:";
119 // Started when a Reader viewer becomes active in the foreground.
120 // Note: Only used in JavaScript for now, but here for completeness.
121 public static final String READER = "reader.1";
123 // Awesomescreen frecency search is active.
124 public static final String FRECENCY = "frecency.1";
126 // Started the very first time we believe the application has been launched.
127 public static final String FIRSTRUN = "firstrun.1";
128 }
130 /**
131 * Holds reasons for stopping a session. Intended for use in
132 * Telemetry.stopUISession() as the "reason" parameter.
133 */
134 public interface Reason {
135 // Changes were committed.
136 public static final String COMMIT = "commit";
137 }
138 }