Bug 981028 - Part 1: Probes for pinning, un-pinning & editing a top sites item. r=liuche

This commit is contained in:
Sola Ogunsakin 2014-04-02 15:16:47 -07:00
parent 6dc72dd029
commit 112ffd11e1
2 changed files with 15 additions and 0 deletions

View File

@ -17,6 +17,15 @@ public interface TelemetryContract {
public interface Event {
// Outcome of data policy notification: can be true or false.
public static final String POLICY_NOTIFICATION_SUCCESS = "policynotification.success.1:";
// Top site pinned.
public static final String TOP_SITES_PIN = "pin.1";
// Top site un-pinned.
public static final String TOP_SITES_UNPIN = "unpin.1";
// Top site edited.
public static final String TOP_SITES_EDIT = "edit.1";
}
/**

View File

@ -11,6 +11,8 @@ import java.util.HashMap;
import java.util.Map;
import org.mozilla.gecko.R;
import org.mozilla.gecko.Telemetry;
import org.mozilla.gecko.TelemetryContract;
import org.mozilla.gecko.db.BrowserContract.Combined;
import org.mozilla.gecko.db.BrowserContract.Thumbnails;
import org.mozilla.gecko.db.BrowserDB;
@ -327,6 +329,7 @@ public class TopSitesPanel extends HomeFragment {
}
});
Telemetry.sendUIEvent(TelemetryContract.Event.TOP_SITES_PIN);
return true;
}
@ -341,12 +344,15 @@ public class TopSitesPanel extends HomeFragment {
}
});
Telemetry.sendUIEvent(TelemetryContract.Event.TOP_SITES_UNPIN);
return true;
}
if (itemId == R.id.top_sites_edit) {
// Decode "user-entered" URLs before showing them.
mEditPinnedSiteListener.onEditPinnedSite(info.position, decodeUserEnteredUrl(info.url));
Telemetry.sendUIEvent(TelemetryContract.Event.TOP_SITES_EDIT);
return true;
}