26 Components.utils.import(
"resource://gre/modules/XPCOMUtils.jsm");
27 Components.utils.import(
"resource://app/jsmodules/DebugUtils.jsm");
29 const LOG = DebugUtils.generateLogFunction(
"ngInternalSearchService", 2);
41 XPCOMUtils.defineLazyServiceGetter(
this,
"searchService",
"@mozilla.org/browser/search-service;1",
"nsIBrowserSearchService");
46 classID: Components.ID(
"{738e3a66-d7b3-4c7d-94ec-a158eb753203}"),
47 contractID:
"@getnightingale.com/Nightingale/internal-search-service;1",
48 QueryInterface: XPCOMUtils.generateQI([Components.interfaces.ngIInternalSearchEnginesService]),
61 registerInternalSearchEngine :
function(searchEngineName,
contractID, liveSearch) {
63 Components.classes[
"@songbirdnest.com/Songbird/"+contractID+
";1"].createInstance(Components.interfaces.sbISearchEngine);
66 throw Components.results.NS_ERROR_ILLEGAL_VALUE;
69 var engine = this.searchService.getEngineByName(searchEngineName);
72 if(!this.internalEngines.hasOwnProperty(searchEngineName)&&engine) {
74 if(liveSearch === undefined)
77 this.internalEngines[searchEngineName] =
78 {
'liveSearch':liveSearch,
'contractID':
contractID,
79 'wasHidden':engine.hidden};
83 engine.hidden =
false;
87 LOG(
"\n\nCouldn't register a search engine handler for \"" + searchEngineName +
88 "\".There either is already a handler for the search engine with this name or there is no engine with this name registered.\n");
96 unregisterInternalSearchEngine :
97 function SearchHandler_unregisterInternalSearchEngine(searchEngineName) {
98 if(this.internalEngines.hasOwnProperty(searchEngineName)) {
100 if(this.internalEngines[searchEngineName].wasHidden)
101 this.searchService.getEngineByName(searchEngineName).hidden =
false;
103 delete this.internalEngines[searchEngineName];
105 LOG(
"\n\nThere is no internal search engine for the name \""
106 + searchEngineName +
"\" registered.\n");
109 getInternalSearchEngine:
function(searchEngineName) {
110 if(this.internalEngines.hasOwnProperty(searchEngineName))
111 return this.internalEngines[searchEngineName];
sbDeviceFirmwareAutoCheckForUpdate prototype contractID
sbOSDControlService prototype QueryInterface
sbDeviceFirmwareAutoCheckForUpdate prototype classDescription
Manager class for internal search engines.
function ngInternalSearchService()
sbDeviceFirmwareAutoCheckForUpdate prototype classID