Bug 369180: override nsIAuthPromptProvider implementation on search suggestion callbacks to avoid proxy authentication dialog popping up while entering text in the search bar, r=mayhemer

--HG--
extra : rebase_source : e662bf239ad508f911f213ef9de61bdd0abbef8a
This commit is contained in:
Gavin Sharp 2013-03-29 13:07:14 -04:00
Родитель be171f1e4e
Коммит 9f70f78783
1 изменённых файлов: 26 добавлений и 0 удалений

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

@ -464,6 +464,7 @@ SuggestAutoComplete.prototype = {
this._suggestURI = submission.uri;
var method = (submission.postData ? "POST" : "GET");
this._request.open(method, this._suggestURI.spec, true);
this._request.channel.notificationCallbacks = new AuthPromptOverride();
if (this._request.channel instanceof Ci.nsIPrivateBrowsingChannel) {
this._request.channel.setPrivate(privacyMode);
}
@ -523,6 +524,31 @@ SuggestAutoComplete.prototype = {
Ci.nsIAutoCompleteObserver])
};
function AuthPromptOverride() {
}
AuthPromptOverride.prototype = {
// nsIAuthPromptProvider
getAuthPrompt: function (reason, iid) {
// Return a no-op nsIAuthPrompt2 implementation.
return {
promptAuth: function () {
throw Cr.NS_ERROR_NOT_IMPLEMENTED;
},
asyncPromptAuth: function () {
throw Cr.NS_ERROR_NOT_IMPLEMENTED;
}
};
},
// nsIInterfaceRequestor
getInterface: function SSLL_getInterface(iid) {
return this.QueryInterface(iid);
},
// nsISupports
QueryInterface: XPCOMUtils.generateQI([Ci.nsIAuthPromptProvider,
Ci.nsIInterfaceRequestor])
};
/**
* SearchSuggestAutoComplete is a service implementation that handles suggest
* results specific to web searches.