Bug 572425 - nsISearchEngine.getSubmission reponseType should be an [optional] param. r=gavin

This commit is contained in:
Marco Bonardo 2010-06-16 18:54:29 +02:00
Родитель f07aa10050
Коммит edd3739d86
5 изменённых файлов: 10 добавлений и 8 удалений

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

@ -1968,7 +1968,7 @@ function getShortcutOrURI(aURL, aPostDataRef) {
var engine = Services.search.getEngineByAlias(keyword);
if (engine) {
var submission = engine.getSubmission(param, null);
var submission = engine.getSubmission(param);
aPostDataRef.value = submission.postData;
return submission.uri.spec;
}
@ -3143,7 +3143,7 @@ const BrowserSearch = {
else
engine = Services.search.defaultEngine;
var submission = engine.getSubmission(searchText, null); // HTML response
var submission = engine.getSubmission(searchText); // HTML response
// getSubmission can return null if the engine doesn't have a URL
// with a text/html response type. This is unlikely (since

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

@ -303,7 +303,7 @@ function doSearch(searchTerm, cmdLine) {
var ss = Components.classes["@mozilla.org/browser/search-service;1"]
.getService(nsIBrowserSearchService);
var submission = ss.defaultEngine.getSubmission(searchTerm, null);
var submission = ss.defaultEngine.getSubmission(searchTerm);
// fill our nsISupportsArray with uri-as-wstring, null, null, postData
var sa = Components.classes["@mozilla.org/supports-array;1"]

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

@ -489,7 +489,7 @@
<parameter name="aWhere"/>
<body><![CDATA[
// null parameter below specifies HTML response for search
var submission = this.currentEngine.getSubmission(aData, null);
var submission = this.currentEngine.getSubmission(aData);
openUILinkIn(submission.uri.spec, aWhere, null, submission.postData);
]]></body>
</method>

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

@ -509,7 +509,7 @@ searchBar.prototype = {
*/
checkSearchResultPage : function searchBar_checkSearchResultPage(searchTerm) {
// Retrieve the URL which is used for the currently selected search engine
var targetUrl = this._bss.currentEngine.getSubmission(searchTerm, null).uri;
var targetUrl = this._bss.currentEngine.getSubmission(searchTerm).uri;
var currentUrl = this._controller.tabs.activeTabWindow.document.location.href;
// Check if pure domain names are identical

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

@ -69,7 +69,7 @@ interface nsISearchEngine : nsISupports
* Data to add to the submission object.
* i.e. the search terms.
*
* @param responseType
* @param responseType [optional]
* The MIME type that we'd like to receive in response
* to this submission. If null, will default to "text/html".
*
@ -77,7 +77,8 @@ interface nsISearchEngine : nsISupports
* to send to the search engine. If no submission can be
* obtained for the given responseType, returns null.
*/
nsISearchSubmission getSubmission(in AString data, in AString responseType);
nsISearchSubmission getSubmission(in AString data,
[optional] in AString responseType);
/**
* Adds a parameter to the search engine's submission data. This should only
@ -126,7 +127,8 @@ interface nsISearchEngine : nsISupports
const unsigned long DATA_TEXT = 2;
/**
* The shortcut alias of the engine. This is a unique identifier.
* An optional shortcut alias for the engine.
* When non-null, this is a unique identifier.
*/
attribute AString alias;