Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: toolkit/components/search/nsSearchService.js

Issue 29529787: Issue 4655 - Removing an installed search engine replaces it with a new search option (Closed)
Patch Set: Created Aug. 28, 2017, 8 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* This Source Code Form is subject to the terms of the Mozilla Public 1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this 2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
4 4
5 const Ci = Components.interfaces; 5 const Ci = Components.interfaces;
6 const Cc = Components.classes; 6 const Cc = Components.classes;
7 const Cr = Components.results; 7 const Cr = Components.results;
8 const Cu = Components.utils; 8 const Cu = Components.utils;
9 9
10 Cu.import("resource://gre/modules/XPCOMUtils.jsm"); 10 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
(...skipping 3923 matching lines...) Expand 10 before | Expand all | Expand 10 after
3934 LOG("getEngines: getting all engines"); 3934 LOG("getEngines: getting all engines");
3935 var engines = this._getSortedEngines(true); 3935 var engines = this._getSortedEngines(true);
3936 aCount.value = engines.length; 3936 aCount.value = engines.length;
3937 return engines; 3937 return engines;
3938 }, 3938 },
3939 3939
3940 getVisibleEngines: function SRCH_SVC_getVisible(aCount) { 3940 getVisibleEngines: function SRCH_SVC_getVisible(aCount) {
3941 this._ensureInitialized(); 3941 this._ensureInitialized();
3942 LOG("getVisibleEngines: getting all visible engines"); 3942 LOG("getVisibleEngines: getting all visible engines");
3943 var engines = this._getSortedEngines(false); 3943 var engines = this._getSortedEngines(false);
3944 // Capped visible engine count at 5 according to https://issues.adblockplus. org/ticket/3128
3945 engines = engines.slice(0, Math.min(engines.length, 5));
3946 aCount.value = engines.length; 3944 aCount.value = engines.length;
3947 return engines; 3945 return engines;
3948 }, 3946 },
3949 3947
3950 getDefaultEngines: function SRCH_SVC_getDefault(aCount) { 3948 getDefaultEngines: function SRCH_SVC_getDefault(aCount) {
3951 this._ensureInitialized(); 3949 this._ensureInitialized();
3952 function isDefault(engine) { 3950 function isDefault(engine) {
3953 return engine._isDefault; 3951 return engine._isDefault;
3954 } 3952 }
3955 var engines = this._sortedEngines.filter(isDefault); 3953 var engines = this._sortedEngines.filter(isDefault);
(...skipping 833 matching lines...) Expand 10 before | Expand all | Expand 10 after
4789 4787
4790 if (engine._iconUpdateURL) { 4788 if (engine._iconUpdateURL) {
4791 // If we're updating the engine too, use the new engine object, 4789 // If we're updating the engine too, use the new engine object,
4792 // otherwise use the existing engine object. 4790 // otherwise use the existing engine object.
4793 (testEngine || engine)._setIcon(engine._iconUpdateURL, true); 4791 (testEngine || engine)._setIcon(engine._iconUpdateURL, true);
4794 } 4792 }
4795 } 4793 }
4796 }; 4794 };
4797 4795
4798 this.NSGetFactory = XPCOMUtils.generateNSGetFactory([SearchService]); 4796 this.NSGetFactory = XPCOMUtils.generateNSGetFactory([SearchService]);
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld