mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1061409: Telemetry for share overlays. r=rnewman
This commit is contained in:
parent
bbbe482310
commit
dae8f3bf40
@ -79,6 +79,9 @@ public interface TelemetryContract {
|
|||||||
// Sharing content.
|
// Sharing content.
|
||||||
SHARE("share.1"),
|
SHARE("share.1"),
|
||||||
|
|
||||||
|
// Show a UI element.
|
||||||
|
SHOW("show.1"),
|
||||||
|
|
||||||
// Undoing a user action.
|
// Undoing a user action.
|
||||||
// Note: Only used in JavaScript for now, but here for completeness.
|
// Note: Only used in JavaScript for now, but here for completeness.
|
||||||
UNDO("undo.1"),
|
UNDO("undo.1"),
|
||||||
@ -161,6 +164,9 @@ public interface TelemetryContract {
|
|||||||
// Action triggered from a settings screen.
|
// Action triggered from a settings screen.
|
||||||
SETTINGS("settings"),
|
SETTINGS("settings"),
|
||||||
|
|
||||||
|
// Actions triggered from the share overlay.
|
||||||
|
SHARE_OVERLAY("shareoverlay"),
|
||||||
|
|
||||||
// Action triggered from a suggestion provided to the user.
|
// Action triggered from a suggestion provided to the user.
|
||||||
SUGGESTION("suggestion"),
|
SUGGESTION("suggestion"),
|
||||||
|
|
||||||
|
@ -12,6 +12,8 @@ import java.util.Arrays;
|
|||||||
|
|
||||||
import org.mozilla.gecko.Assert;
|
import org.mozilla.gecko.Assert;
|
||||||
import org.mozilla.gecko.R;
|
import org.mozilla.gecko.R;
|
||||||
|
import org.mozilla.gecko.Telemetry;
|
||||||
|
import org.mozilla.gecko.TelemetryContract;
|
||||||
import org.mozilla.gecko.overlays.service.sharemethods.ParcelableClientRecord;
|
import org.mozilla.gecko.overlays.service.sharemethods.ParcelableClientRecord;
|
||||||
|
|
||||||
import android.app.AlertDialog;
|
import android.app.AlertDialog;
|
||||||
@ -143,6 +145,12 @@ public class SendTabList extends ListView {
|
|||||||
public void onClick(DialogInterface dialog, int index) {
|
public void onClick(DialogInterface dialog, int index) {
|
||||||
listener.onSendTabTargetSelected(records[index].guid);
|
listener.onSendTabTargetSelected(records[index].guid);
|
||||||
}
|
}
|
||||||
|
})
|
||||||
|
.setOnCancelListener(new DialogInterface.OnCancelListener() {
|
||||||
|
@Override
|
||||||
|
public void onCancel(DialogInterface dialogInterface) {
|
||||||
|
Telemetry.sendUIEvent(TelemetryContract.Event.CANCEL, TelemetryContract.Method.SHARE_OVERLAY, "device_selection_cancel");
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
return builder.create();
|
return builder.create();
|
||||||
|
@ -12,6 +12,8 @@ import org.mozilla.gecko.Assert;
|
|||||||
import org.mozilla.gecko.GeckoProfile;
|
import org.mozilla.gecko.GeckoProfile;
|
||||||
import org.mozilla.gecko.LocaleAware;
|
import org.mozilla.gecko.LocaleAware;
|
||||||
import org.mozilla.gecko.R;
|
import org.mozilla.gecko.R;
|
||||||
|
import org.mozilla.gecko.Telemetry;
|
||||||
|
import org.mozilla.gecko.TelemetryContract;
|
||||||
import org.mozilla.gecko.db.LocalBrowserDB;
|
import org.mozilla.gecko.db.LocalBrowserDB;
|
||||||
import org.mozilla.gecko.overlays.OverlayConstants;
|
import org.mozilla.gecko.overlays.OverlayConstants;
|
||||||
import org.mozilla.gecko.overlays.service.OverlayActionService;
|
import org.mozilla.gecko.overlays.service.OverlayActionService;
|
||||||
@ -147,12 +149,17 @@ public class ShareDialog extends LocaleAware.LocaleAwareActivity implements Send
|
|||||||
|
|
||||||
// If provided, we use the subject text to give us something nice to display.
|
// If provided, we use the subject text to give us something nice to display.
|
||||||
// If not, we wing it with the URL.
|
// If not, we wing it with the URL.
|
||||||
|
|
||||||
// TODO: Consider polling Fennec databases to find better information to display.
|
// TODO: Consider polling Fennec databases to find better information to display.
|
||||||
String subjectText = intent.getStringExtra(Intent.EXTRA_SUBJECT);
|
String subjectText = intent.getStringExtra(Intent.EXTRA_SUBJECT);
|
||||||
|
|
||||||
|
String telemetryExtras = "title=" + (subjectText != null);
|
||||||
if (subjectText != null) {
|
if (subjectText != null) {
|
||||||
((TextView) findViewById(R.id.title)).setText(subjectText);
|
((TextView) findViewById(R.id.title)).setText(subjectText);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Telemetry.sendUIEvent(TelemetryContract.Event.SHOW, TelemetryContract.Method.SHARE_OVERLAY, telemetryExtras);
|
||||||
|
|
||||||
title = subjectText;
|
title = subjectText;
|
||||||
url = pageUrl;
|
url = pageUrl;
|
||||||
|
|
||||||
@ -321,16 +328,22 @@ public class ShareDialog extends LocaleAware.LocaleAwareActivity implements Send
|
|||||||
|
|
||||||
startService(serviceIntent);
|
startService(serviceIntent);
|
||||||
slideOut();
|
slideOut();
|
||||||
|
|
||||||
|
Telemetry.sendUIEvent(TelemetryContract.Event.SHARE, TelemetryContract.Method.SHARE_OVERLAY, "sendtab");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addToReadingList() {
|
public void addToReadingList() {
|
||||||
startService(getServiceIntent(ShareMethod.Type.ADD_TO_READING_LIST));
|
startService(getServiceIntent(ShareMethod.Type.ADD_TO_READING_LIST));
|
||||||
slideOut();
|
slideOut();
|
||||||
|
|
||||||
|
Telemetry.sendUIEvent(TelemetryContract.Event.SAVE, TelemetryContract.Method.SHARE_OVERLAY, "reading_list");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addBookmark() {
|
public void addBookmark() {
|
||||||
startService(getServiceIntent(ShareMethod.Type.ADD_BOOKMARK));
|
startService(getServiceIntent(ShareMethod.Type.ADD_BOOKMARK));
|
||||||
slideOut();
|
slideOut();
|
||||||
|
|
||||||
|
Telemetry.sendUIEvent(TelemetryContract.Event.SAVE, TelemetryContract.Method.SHARE_OVERLAY, "bookmark");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void launchBrowser() {
|
public void launchBrowser() {
|
||||||
@ -386,6 +399,7 @@ public class ShareDialog extends LocaleAware.LocaleAwareActivity implements Send
|
|||||||
@Override
|
@Override
|
||||||
public void onBackPressed() {
|
public void onBackPressed() {
|
||||||
slideOut();
|
slideOut();
|
||||||
|
Telemetry.sendUIEvent(TelemetryContract.Event.CANCEL, TelemetryContract.Method.SHARE_OVERLAY);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -394,6 +408,7 @@ public class ShareDialog extends LocaleAware.LocaleAwareActivity implements Send
|
|||||||
@Override
|
@Override
|
||||||
public boolean onTouchEvent(MotionEvent event) {
|
public boolean onTouchEvent(MotionEvent event) {
|
||||||
slideOut();
|
slideOut();
|
||||||
|
Telemetry.sendUIEvent(TelemetryContract.Event.CANCEL, TelemetryContract.Method.SHARE_OVERLAY);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user