Bug 1177246 - Implement metrics for OS search query parsing. r=gfritzsche

--HG--
extra : rebase_source : d177d42711a5058e9051903f1687efcb8115af03
This commit is contained in:
Jared Wein 2015-08-26 13:28:13 -04:00
Родитель e9327aa06b
Коммит 9c7a1d51ad
1 изменённых файлов: 13 добавлений и 2 удалений

Просмотреть файл

@ -267,11 +267,20 @@ function getMostRecentWindow(aType) {
return wm.getMostRecentWindow(aType);
}
function logSystemBasedSearch(engine) {
var countId = (engine.identifier || ("other-" + engine.name)) + ".system";
var count = Services.telemetry.getKeyedHistogramById("SEARCH_COUNTS");
count.add(countId);
}
function doSearch(searchTerm, cmdLine) {
var ss = Components.classes["@mozilla.org/browser/search-service;1"]
.getService(nsIBrowserSearchService);
var submission = ss.defaultEngine.getSubmission(searchTerm, null, "system");
var engine = ss.defaultEngine;
logSystemBasedSearch(engine);
var submission = engine.getSubmission(searchTerm, null, "system");
// fill our nsISupportsArray with uri-as-wstring, null, null, postData
var sa = Components.classes["@mozilla.org/supports-array;1"]
@ -789,7 +798,9 @@ nsDefaultCommandLineHandler.prototype = {
var term = params.get("q");
var ss = Components.classes["@mozilla.org/browser/search-service;1"]
.getService(nsIBrowserSearchService);
var submission = ss.defaultEngine.getSubmission(term, null, "system");
var engine = ss.defaultEngine;
logSystemBasedSearch(engine);
var submission = engine.getSubmission(term, null, "system");
uri = submission.uri;
}
} catch (e) {