Sort out search service

master
Fedor 2019-07-08 13:07:17 +03:00
parent e785197598
commit e423a8527f
17 changed files with 43 additions and 65 deletions

View File

@ -4,4 +4,6 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
DIRS += ['service']
JAR_MANIFESTS += ['jar.mn']

View File

@ -4,28 +4,21 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
DIST_SUBDIR = ''
DEFINES['HAVE_SIDEBAR'] = True
EXTRA_COMPONENTS += [
'nsSearchSuggestions.js',
'nsSidebar.js',
]
EXTRA_PP_COMPONENTS += [
'nsSearchService.js',
]
if CONFIG['MOZ_PHOENIX'] or CONFIG['MOZ_FENNEC'] or CONFIG['MOZ_XULRUNNER']:
DEFINES['HAVE_SIDEBAR'] = True
EXTRA_COMPONENTS += [
'nsSidebar.js',
]
EXTRA_JS_MODULES += [
'SearchSuggestionController.jsm',
]
EXTRA_PP_COMPONENTS += [
'toolkitsearch.manifest',
]
EXTRA_JS_MODULES += [
'SearchStaticData.jsm',
'SearchSuggestionController.jsm',
]

View File

@ -75,7 +75,6 @@ const SEARCH_ENGINE_CHANGED = "engine-changed";
const SEARCH_ENGINE_LOADED = "engine-loaded";
const SEARCH_ENGINE_CURRENT = "engine-current";
const SEARCH_ENGINE_DEFAULT = "engine-default";
const SEARCH_ENGINE_RENAMED = "engine-renamed";
// The following constants are left undocumented in nsIBrowserSearchService.idl
// For the moment, they are meant for testing/debugging purposes only.
@ -4153,20 +4152,6 @@ SearchService.prototype = {
// Invalidate the map used to parse URLs to search engines.
this._parseSubmissionMap = null;
break;
case SEARCH_ENGINE_RENAMED:
if (aEngine && ("wrappedJSObject" in aEngine)) {
let wjo = aEngine.wrappedJSObject;
if (wjo && ("__old_name" in wjo)) {
delete this._engines[wjo.__old_name];
this._engines[wjo._name] = wjo;
delete wjo.__old_name;
this.batchTask.disarm();
this.batchTask.arm();
// Invalidate the map used to parse URLs to search engines.
this._parseSubmissionMap = null;
}
}
break;
}
break;

View File

@ -89,7 +89,9 @@ if CONFIG['MOZ_XUL']:
if 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT']:
DIRS += ['filepicker']
if CONFIG['MOZ_TOOLKIT_SEARCH']:
if CONFIG['MOZ_TOOLKIT_SEARCH'] and not CONFIG['MC_BASILISK'] \
and not CONFIG['HYPE_ICEWEASEL'] \
and not CONFIG['HYPE_ICEDOVE']:
DIRS += ['search']
if CONFIG['MOZ_URL_CLASSIFIER']:

View File

@ -1,31 +0,0 @@
# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
# vim: set filetype=python:
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
EXTRA_COMPONENTS += [
'nsSearchSuggestions.js',
]
EXTRA_PP_COMPONENTS += [
'nsSearchService.js',
]
if CONFIG['MOZ_PHOENIX'] or CONFIG['MOZ_FENNEC'] or CONFIG['MOZ_XULRUNNER']:
DEFINES['HAVE_SIDEBAR'] = True
EXTRA_COMPONENTS += [
'nsSidebar.js',
]
EXTRA_JS_MODULES += [
'SearchSuggestionController.jsm',
]
EXTRA_PP_COMPONENTS += [
'toolkitsearch.manifest',
]
EXTRA_JS_MODULES += [
'SearchStaticData.jsm',
]

View File

@ -4,7 +4,19 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
if CONFIG['MC_BASILISK'] or CONFIG['HYPE_ICEWEASEL'] or CONFIG['HYPE_ICEDOVE']:
DIRS += ['current']
else:
DIRS += ['orginal']
EXTRA_COMPONENTS += ['nsSearchSuggestions.js']
EXTRA_PP_COMPONENTS += [
'nsSearchService.js',
'toolkitsearch.manifest',
]
if CONFIG['MOZ_PHOENIX'] or CONFIG['MOZ_FENNEC'] or CONFIG['MOZ_XULRUNNER']:
DEFINES['HAVE_SIDEBAR'] = True
EXTRA_COMPONENTS += ['nsSidebar.js']
EXTRA_JS_MODULES += [
'SearchStaticData.jsm',
'SearchSuggestionController.jsm',
]

View File

@ -76,6 +76,7 @@ const SEARCH_ENGINE_CHANGED = "engine-changed";
const SEARCH_ENGINE_LOADED = "engine-loaded";
const SEARCH_ENGINE_CURRENT = "engine-current";
const SEARCH_ENGINE_DEFAULT = "engine-default";
const SEARCH_ENGINE_RENAMED = "engine-renamed";
// The following constants are left undocumented in nsIBrowserSearchService.idl
// For the moment, they are meant for testing/debugging purposes only.
@ -4144,6 +4145,20 @@ SearchService.prototype = {
// Invalidate the map used to parse URLs to search engines.
this._parseSubmissionMap = null;
break;
case SEARCH_ENGINE_RENAMED:
if (aEngine && ("wrappedJSObject" in aEngine)) {
let wjo = aEngine.wrappedJSObject;
if (wjo && ("__old_name" in wjo)) {
delete this._engines[wjo.__old_name];
this._engines[wjo._name] = wjo;
delete wjo.__old_name;
this.batchTask.disarm();
this.batchTask.arm();
// Invalidate the map used to parse URLs to search engines.
this._parseSubmissionMap = null;
}
}
break;
}
break;
@ -4556,4 +4571,4 @@ var engineUpdateService = {
this.NSGetFactory = XPCOMUtils.generateNSGetFactory([SearchService]);
#include ../../../../toolkit/modules/debug.js
#include ../../../toolkit/modules/debug.js