michael@0: /* -*- Mode: Java; c-basic-offset: 4; tab-width: 20; indent-tabs-mode: nil; -*- michael@0: * This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: package org.mozilla.gecko; michael@0: michael@0: /** michael@0: * Holds data definitions for our UI Telemetry implementation. michael@0: */ michael@0: public interface TelemetryContract { michael@0: michael@0: /** michael@0: * Holds event names. Intended for use with michael@0: * Telemetry.sendUIEvent() as the "action" parameter. michael@0: */ michael@0: public interface Event { michael@0: // Cancel a state, action, etc. michael@0: public static final String CANCEL = "cancel.1"; michael@0: michael@0: // Outcome of data policy notification: can be true or false. michael@0: public static final String POLICY_NOTIFICATION_SUCCESS = "policynotification.success.1:"; michael@0: michael@0: // Top site pinned. michael@0: public static final String TOP_SITES_PIN = "pin.1"; michael@0: michael@0: // Top site un-pinned. michael@0: public static final String TOP_SITES_UNPIN = "unpin.1"; michael@0: michael@0: // Top site edited. michael@0: public static final String TOP_SITES_EDIT = "edit.1"; michael@0: michael@0: // Set default panel. michael@0: public static final String PANEL_SET_DEFAULT = "setdefault.1"; michael@0: michael@0: // Sharing content. michael@0: public static final String SHARE = "share.1"; michael@0: michael@0: // Sanitizing private data. michael@0: public static final String SANITIZE = "sanitize.1"; michael@0: michael@0: // Saving a resource (reader, bookmark, etc) for viewing later. michael@0: // Note: Only used in JavaScript for now, but here for completeness. michael@0: public static final String SAVE = "save.1"; michael@0: michael@0: // Stop holding a resource (reader, bookmark, etc) for viewing later. michael@0: // Note: Only used in JavaScript for now, but here for completeness. michael@0: public static final String UNSAVE = "unsave.1"; michael@0: michael@0: // Loading a URL. michael@0: public static final String LOAD_URL = "loadurl.1"; michael@0: michael@0: // Generic action, usually for tracking menu and toolbar actions. michael@0: public static final String ACTION = "action.1"; michael@0: michael@0: // Launching (opening) an external application michael@0: // Note: Only used in JavaScript for now, but here for completeness. michael@0: public static final String LAUNCH = "launch.1"; michael@0: } michael@0: michael@0: /** michael@0: * Holds event methods. Intended for use in michael@0: * Telemetry.sendUIEvent() as the "method" parameter. michael@0: */ michael@0: public interface Method { michael@0: // Action triggered from a list. michael@0: public static final String LIST = "list"; michael@0: michael@0: // Action triggered from the action bar (including the toolbar). michael@0: public static final String ACTIONBAR = "actionbar"; michael@0: michael@0: // Action triggered by hitting the Android back button. michael@0: public static final String BACK = "back"; michael@0: michael@0: // Action triggered from a button. michael@0: public static final String BUTTON = "button"; michael@0: michael@0: // Action triggered from a dialog. michael@0: public static final String DIALOG = "dialog"; michael@0: michael@0: // Action occurred via an intent. michael@0: public static final String INTENT = "intent"; michael@0: michael@0: // Action occurred via the main menu. michael@0: public static final String MENU = "menu"; michael@0: michael@0: // Action occurred via a context menu. michael@0: public static final String CONTEXT_MENU = "contextmenu"; michael@0: michael@0: // Action triggered from a view grid item, like a thumbnail. michael@0: public static final String GRID_ITEM = "griditem"; michael@0: michael@0: // Action triggered from a view list item, like a row of a list. michael@0: public static final String LIST_ITEM = "listitem"; michael@0: michael@0: // Action triggered from a suggestion provided to the user. michael@0: public static final String SUGGESTION = "suggestion"; michael@0: michael@0: // Action triggered from a pageaction in the URLBar. michael@0: // Note: Only used in JavaScript for now, but here for completeness. michael@0: public static final String PAGEACTION = "pageaction"; michael@0: } michael@0: michael@0: /** michael@0: * Holds session names. Intended for use with michael@0: * Telemetry.startUISession() as the "sessionName" parameter. michael@0: */ michael@0: public interface Session { michael@0: // Awesomescreen (including frecency search) is active. michael@0: public static final String AWESOMESCREEN = "awesomescreen.1"; michael@0: michael@0: // Started when a user enters about:home. michael@0: public static final String HOME = "home.1"; michael@0: michael@0: // Started when a user enters a given home panel. michael@0: // Session name is dynamic, encoded as "homepanel.1:" michael@0: public static final String HOME_PANEL = "homepanel.1:"; michael@0: michael@0: // Started when a Reader viewer becomes active in the foreground. michael@0: // Note: Only used in JavaScript for now, but here for completeness. michael@0: public static final String READER = "reader.1"; michael@0: michael@0: // Awesomescreen frecency search is active. michael@0: public static final String FRECENCY = "frecency.1"; michael@0: michael@0: // Started the very first time we believe the application has been launched. michael@0: public static final String FIRSTRUN = "firstrun.1"; michael@0: } michael@0: michael@0: /** michael@0: * Holds reasons for stopping a session. Intended for use in michael@0: * Telemetry.stopUISession() as the "reason" parameter. michael@0: */ michael@0: public interface Reason { michael@0: // Changes were committed. michael@0: public static final String COMMIT = "commit"; michael@0: } michael@0: }