mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 823230 - (Part 1) Pass search term along with "keyword-search" notification. r=gavin
This commit is contained in:
parent
8bc89d2f03
commit
a6380edcac
@ -301,7 +301,8 @@ BrowserGlue.prototype = {
|
||||
|
||||
reporter.onInit().then(function record() {
|
||||
try {
|
||||
reporter.getProvider("org.mozilla.searches").recordSearch(data,
|
||||
let name = subject.QueryInterface(Ci.nsISearchEngine).name;
|
||||
reporter.getProvider("org.mozilla.searches").recordSearch(name,
|
||||
"urlbar");
|
||||
} catch (ex) {
|
||||
Cu.reportError(ex);
|
||||
|
@ -363,9 +363,7 @@ NS_IMETHODIMP nsDefaultURIFixup::KeywordToURI(const nsACString& aKeyword,
|
||||
// the search engine's name through various function calls.
|
||||
nsCOMPtr<nsIObserverService> obsSvc = mozilla::services::GetObserverService();
|
||||
if (obsSvc) {
|
||||
nsAutoString name;
|
||||
defaultEngine->GetName(name);
|
||||
obsSvc->NotifyObservers(nullptr, "keyword-search", name.get());
|
||||
obsSvc->NotifyObservers(defaultEngine, "keyword-search", NS_ConvertUTF8toUTF16(keyword).get());
|
||||
}
|
||||
|
||||
return submission->GetUri(aURI);
|
||||
|
@ -13,7 +13,8 @@ function test() {
|
||||
|
||||
let engine = Services.search.defaultEngine;
|
||||
ok(engine, "Have default search engine.");
|
||||
is(engine.name, data, "Notification data is engine name.");
|
||||
is(engine, subject, "Notification subject is engine.");
|
||||
is("firefox health report", data, "Notification data is search term.");
|
||||
|
||||
executeSoon(function cleanup() {
|
||||
gBrowser.removeTab(tab);
|
||||
|
Loading…
Reference in New Issue
Block a user