Bug 589613 - [SeaMonkey 2.1, mochitest-browser-chrome] browser_Services.js | Services.search exists

r=gavin a=NPOTB
This commit is contained in:
Ian Neal 2010-09-18 13:42:07 +01:00
parent 2785d60565
commit 1a7c1b888b
3 changed files with 12 additions and 1 deletions

View File

@ -48,6 +48,9 @@ LIBRARY_NAME = basedocshell_s
GRE_MODULE = 1
LIBXUL_LIBRARY = 1
ifdef MOZ_TOOLKIT_SEARCH
DEFINES += -DMOZ_TOOLKIT_SEARCH
endif
SDK_XPIDLSRCS = \
nsIGlobalHistory.idl \

View File

@ -48,7 +48,10 @@
#include "nsIPrefLocalizedString.h"
#include "nsIPlatformCharset.h"
#include "nsILocalFile.h"
#ifdef MOZ_TOOLKIT_SEARCH
#include "nsIBrowserSearchService.h"
#endif
#include "nsIURIFixup.h"
#include "nsDefaultURIFixup.h"
@ -399,6 +402,7 @@ NS_IMETHODIMP nsDefaultURIFixup::KeywordToURI(const nsACString& aKeyword,
return NS_NewURI(aURI, spec);
}
#ifdef MOZ_TOOLKIT_SEARCH
// Try falling back to the search service's default search engine
nsCOMPtr<nsIBrowserSearchService> searchSvc = do_GetService("@mozilla.org/browser/search-service;1");
if (searchSvc) {
@ -436,6 +440,7 @@ NS_IMETHODIMP nsDefaultURIFixup::KeywordToURI(const nsACString& aKeyword,
}
}
}
#endif
// out of options
return NS_ERROR_NOT_AVAILABLE;

View File

@ -141,9 +141,12 @@ XPIDLSRCS = \
nsIURIWithPrincipal.idl \
nsIURIClassifier.idl \
nsIRedirectResultListener.idl \
nsIBrowserSearchService.idl \
$(NULL)
ifdef MOZ_TOOLKIT_SEARCH
XPIDLSRCS += nsIBrowserSearchService.idl
endif
EXPORTS = \
netCore.h \
nsNetError.h \