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

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

Issue 29329014: Issue 3128 - The default search engine is removed if it was one of those removed by issue 3047 (ABB… (Closed)
Patch Set: Created Oct. 9, 2015, 1:22 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 | « mobile/android/app/mobile.js ('k') | 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 Components.utils.import("resource://gre/modules/XPCOMUtils.jsm"); 10 Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
(...skipping 4526 matching lines...) Expand 10 before | Expand all | Expand 10 after
4537 LOG("getEngines: getting all engines"); 4537 LOG("getEngines: getting all engines");
4538 var engines = this._getSortedEngines(true); 4538 var engines = this._getSortedEngines(true);
4539 aCount.value = engines.length; 4539 aCount.value = engines.length;
4540 return engines; 4540 return engines;
4541 }, 4541 },
4542 4542
4543 getVisibleEngines: function SRCH_SVC_getVisible(aCount) { 4543 getVisibleEngines: function SRCH_SVC_getVisible(aCount) {
4544 this._ensureInitialized(); 4544 this._ensureInitialized();
4545 LOG("getVisibleEngines: getting all visible engines"); 4545 LOG("getVisibleEngines: getting all visible engines");
4546 var engines = this._getSortedEngines(false); 4546 var engines = this._getSortedEngines(false);
4547 // Capped visible engine count at 5 according to https://issues.adblockplus. org/ticket/3128
4548 engines = engines.slice(0, Math.min(engines.length, 5));
4547 aCount.value = engines.length; 4549 aCount.value = engines.length;
4548 return engines; 4550 return engines;
4549 }, 4551 },
4550 4552
4551 getDefaultEngines: function SRCH_SVC_getDefault(aCount) { 4553 getDefaultEngines: function SRCH_SVC_getDefault(aCount) {
4552 this._ensureInitialized(); 4554 this._ensureInitialized();
4553 function isDefault(engine) { 4555 function isDefault(engine) {
4554 return engine._isDefault; 4556 return engine._isDefault;
4555 }; 4557 };
4556 var engines = this._sortedEngines.filter(isDefault); 4558 var engines = this._sortedEngines.filter(isDefault);
(...skipping 997 matching lines...) Expand 10 before | Expand all | Expand 10 after
5554 // If we're updating the engine too, use the new engine object, 5556 // If we're updating the engine too, use the new engine object,
5555 // otherwise use the existing engine object. 5557 // otherwise use the existing engine object.
5556 (testEngine || engine)._setIcon(engine._iconUpdateURL, true); 5558 (testEngine || engine)._setIcon(engine._iconUpdateURL, true);
5557 } 5559 }
5558 } 5560 }
5559 }; 5561 };
5560 5562
5561 this.NSGetFactory = XPCOMUtils.generateNSGetFactory([SearchService]); 5563 this.NSGetFactory = XPCOMUtils.generateNSGetFactory([SearchService]);
5562 5564
5563 #include ../../../toolkit/modules/debug.js 5565 #include ../../../toolkit/modules/debug.js
OLDNEW
« no previous file with comments | « mobile/android/app/mobile.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld