зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1007130 - Add UI telemetry for 'Adding a new search engine' button. r=mfinkle
This commit is contained in:
Родитель
75d3a5ce57
Коммит
102272d0f3
|
@ -13,9 +13,9 @@ import java.util.List;
|
|||
import java.util.Locale;
|
||||
import java.util.Vector;
|
||||
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
|
||||
import org.mozilla.gecko.DynamicToolbar.PinReason;
|
||||
import org.mozilla.gecko.DynamicToolbar.VisibilityTransition;
|
||||
import org.mozilla.gecko.GeckoProfileDirectories.NoMozillaDirectoryException;
|
||||
|
@ -790,6 +790,7 @@ public class BrowserApp extends GeckoApp
|
|||
}
|
||||
|
||||
if (itemId == R.id.add_search_engine) {
|
||||
// This can be selected from either the browser menu or the contextmenu, depending on the size and version (v11+) of the phone.
|
||||
Tab tab = Tabs.getInstance().getSelectedTab();
|
||||
if (tab != null && tab.hasOpenSearch()) {
|
||||
JSONObject args = new JSONObject();
|
||||
|
@ -800,6 +801,10 @@ public class BrowserApp extends GeckoApp
|
|||
return true;
|
||||
}
|
||||
GeckoAppShell.sendEventToGecko(GeckoEvent.createBroadcastEvent("SearchEngines:Add", args.toString()));
|
||||
|
||||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) {
|
||||
Telemetry.sendUIEvent(TelemetryContract.Event.ACTION, TelemetryContract.Method.CONTEXT_MENU, "add_search_engine");
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -6820,6 +6820,7 @@ var SearchEngines = {
|
|||
icon: "drawable://ab_add_search_engine",
|
||||
selector: filter,
|
||||
action: function(aElement) {
|
||||
UITelemetry.addEvent("action.1", "actionbar", null, "add_search_engine");
|
||||
SearchEngines.addEngine(aElement);
|
||||
}
|
||||
});
|
||||
|
|
Загрузка…
Ссылка в новой задаче