mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-30 08:12:05 +00:00
Bug 1120957 - fix the source of searches made with paste & search, r=gijs,bwinton
This commit is contained in:
parent
38f4b946f2
commit
37b9df3be3
@ -3490,6 +3490,12 @@ const BrowserSearch = {
|
||||
}
|
||||
},
|
||||
|
||||
pasteAndSearch: function (event) {
|
||||
BrowserSearch.searchBar.select();
|
||||
goDoCommand("cmd_paste");
|
||||
BrowserSearch.searchBar.handleSearchCommand(event);
|
||||
},
|
||||
|
||||
/**
|
||||
* Returns the search bar element if it is present in the toolbar, null otherwise.
|
||||
*/
|
||||
|
@ -521,6 +521,11 @@
|
||||
target.parentNode.classList.contains("search-panel-header")) {
|
||||
source = "header";
|
||||
}
|
||||
} else if (aEvent instanceof XULCommandEvent) {
|
||||
if (target.getAttribute("anonid") == "paste-and-search") {
|
||||
aEngine = this.currentEngine;
|
||||
source = "paste";
|
||||
}
|
||||
}
|
||||
|
||||
BrowserSearch.recordOneoffSearchInTelemetry(aEngine, source, type, where);
|
||||
@ -837,8 +842,7 @@
|
||||
label = this._stringBundle.getString("cmd_pasteAndSearch");
|
||||
element.setAttribute("label", label);
|
||||
element.setAttribute("anonid", "paste-and-search");
|
||||
element.setAttribute("oncommand",
|
||||
"BrowserSearch.searchBar.select(); goDoCommand('cmd_paste'); BrowserSearch.searchBar.handleSearchCommand();");
|
||||
element.setAttribute("oncommand", "BrowserSearch.pasteAndSearch(event)");
|
||||
cxmenu.insertBefore(element, insertLocation.nextSibling);
|
||||
pasteAndSearch = element;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user