Bug 968308 - Part 2: Session for about:home. r=liuche

This commit is contained in:
Sola Ogunsakin 2014-03-26 18:19:40 -07:00
parent 3b02cef620
commit c18999c012
3 changed files with 44 additions and 0 deletions

View File

@ -0,0 +1,39 @@
/* -*- Mode: Java; c-basic-offset: 4; tab-width: 20; indent-tabs-mode: nil; -*-
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
package org.mozilla.gecko;
/**
* Holds data definitions for our UI Telemetry implementation.
*/
public interface TelemetryContract {
/**
* Holds event names. Intended for use with
* Telemetry.sendUIEvent() as the "action" parameter.
*/
public interface Event {}
/**
* Holds event methods. Intended for use in
* Telemetry.sendUIEvent() as the "method" parameter.
*/
public interface Method {}
/**
* Holds session names. Intended for use with
* Telemetry.startUISession() as the "sessionName" parameter.
*/
public interface Session {
// Started when a user enters about:home.
public static final String HOME = "home.v1";
}
/**
* Holds reasons for stopping a session. Intended for use in
* Telemetry.stopUISession() as the "reason" parameter.
*/
public interface Reason {}
}

View File

@ -10,6 +10,8 @@ import java.util.EnumSet;
import java.util.List;
import org.mozilla.gecko.R;
import org.mozilla.gecko.Telemetry;
import org.mozilla.gecko.TelemetryContract;
import org.mozilla.gecko.animation.PropertyAnimator;
import org.mozilla.gecko.animation.ViewHelper;
import org.mozilla.gecko.home.HomeAdapter.OnAddPanelListener;
@ -195,6 +197,7 @@ public class HomePager extends ViewPager {
PropertyAnimator.Property.ALPHA,
1.0f);
}
Telemetry.startUISession(TelemetryContract.Session.HOME);
}
/**
@ -203,6 +206,7 @@ public class HomePager extends ViewPager {
public void unload() {
mLoaded = false;
setAdapter(null);
Telemetry.stopUISession(TelemetryContract.Session.HOME);
}
/**

View File

@ -342,6 +342,7 @@ gbjar.sources += [
'TabsPanel.java',
'TabsTray.java',
'Telemetry.java',
'TelemetryContract.java',
'TextSelection.java',
'TextSelectionHandle.java',
'ThumbnailHelper.java',