Bug 1510936 - Port bug 1453264 - nsIBrowserSearchService::currentEngine replaced with defaultEngine; rs=bustage-fix DONTBUILD
authorGeoff Lankow <geoff@darktrojan.net>
Thu, 29 Nov 2018 21:37:02 +1300
changeset 33809 f5c224fa2c5f37bd2ee63aeb71e150dd44ee86d0
parent 33808 8709d04aee9295aea108b7e20823b550d5d74017
child 33810 41b13e00133eb904f64c8fd675c987243b4610be
push id388
push userclokep@gmail.com
push dateMon, 28 Jan 2019 20:54:56 +0000
reviewersbustage-fix
bugs1510936, 1453264
Bug 1510936 - Port bug 1453264 - nsIBrowserSearchService::currentEngine replaced with defaultEngine; rs=bustage-fix DONTBUILD
mail/base/content/nsContextMenu.js
mail/base/content/utilityOverlay.js
mail/components/newmailaccount/content/accountProvisioner.js
mail/components/preferences/general.js
mail/test/mozmill/newmailaccount/test-newmailaccount.js
--- a/mail/base/content/nsContextMenu.js
+++ b/mail/base/content/nsContextMenu.js
@@ -196,17 +196,17 @@ nsContextMenu.prototype = {
       if (selection.length > 15) {
         key += ".truncated";
         abbrSelection = selection.slice(0, 15);
       } else {
         abbrSelection = selection;
       }
 
       searchTheWeb.label = bundle.getFormattedString(key, [
-        Services.search.currentEngine.name, abbrSelection,
+        Services.search.defaultEngine.name, abbrSelection,
       ]);
       searchTheWeb.value = selection;
     }
   },
   initMediaPlayerItems() {
     let onMedia = this.onVideo || this.onAudio;
     // Several mutually exclusive items.... play/pause, mute/unmute, show/hide
     this.showItem("mailContext-media-play", onMedia && this.target.paused);
--- a/mail/base/content/utilityOverlay.js
+++ b/mail/base/content/utilityOverlay.js
@@ -194,17 +194,17 @@ function openWhatsNew() {
  *
  * @param query the string to search for
  * @param engine (optional) the search engine to use
  */
 function openWebSearch(query, engine) {
   Services.search.init({
     onInitComplete() {
       if (!engine)
-        engine = Services.search.currentEngine;
+        engine = Services.search.defaultEngine;
       openLinkExternally(engine.getSubmission(query).uri.spec);
     },
   });
 }
 
 /**
  * Open the specified tab type (possibly in a new window)
  *
--- a/mail/components/newmailaccount/content/accountProvisioner.js
+++ b/mail/components/newmailaccount/content/accountProvisioner.js
@@ -415,17 +415,17 @@ var EmailAccountProvisioner = {
     for (let node of document.querySelectorAll("button.close")) {
       node.addEventListener("click", () => window.close());
     }
 
     window.addEventListener("unload", function() {
       let searchEngineCheck = document.getElementById("search_engine_check");
       if (window.arguments[0].search_engine && searchEngineCheck.checked) {
         let engine = Services.search.getEngineByName(window.arguments[0].search_engine);
-        Services.search.currentEngine = engine;
+        Services.search.defaultEngine = engine;
       }
     });
 
     if (window.arguments[0].success) {
       // Show the success page which lets a user compose mail, find add-ons,
       // set a signature, etc.
       gLog.info("Looks like we just finished ordering an address - showing the success page...");
       EmailAccountProvisioner.showSuccessPage();
--- a/mail/components/preferences/general.js
+++ b/mail/components/preferences/general.js
@@ -179,19 +179,19 @@ var gGeneralPane = {
         for (let engine of Services.search.getVisibleEngines()) {
           let item = engineList.appendItem(engine.name);
           item.engine = engine;
           item.className = "menuitem-iconic";
           item.setAttribute(
             "image", engine.iconURI ? engine.iconURI.spec :
                      "resource://gre-resources/broken-image.png"
           );
-          if (engine == Services.search.currentEngine)
+          if (engine == Services.search.defaultEngine)
             engineList.selectedItem = item;
         }
 
         engineList.addEventListener("command", function() {
-          Services.search.currentEngine = engineList.selectedItem.engine;
+          Services.search.defaultEngine = engineList.selectedItem.engine;
         });
       },
     });
   },
 };
--- a/mail/test/mozmill/newmailaccount/test-newmailaccount.js
+++ b/mail/test/mozmill/newmailaccount/test-newmailaccount.js
@@ -93,17 +93,17 @@ function nAccounts() {
  * three functions are "test_get_an_account", "subtest_get_an_account",
  * and "subtest_get_an_account_part_2".
  *
  * @param aCloseAndRestore a boolean for whether or not we should close and
  *                         restore the Account Provisioner tab before filling
  *                         in the form. Defaults to false.
  */
 function test_get_an_account(aCloseAndRestore) {
-  let originalEngine = Services.search.currentEngine;
+  let originalEngine = Services.search.defaultEngine;
   // Open the provisioner - once opened, let subtest_get_an_account run.
   plan_for_modal_dialog("AccountCreation", subtest_get_an_account);
   open_provisioner_window();
   wait_for_modal_dialog("AccountCreation");
 
   // Once we're here, subtest_get_an_account has completed, and we're waiting
   // for a content tab to load for the account order form.
 
@@ -141,31 +141,31 @@ function test_get_an_account(aCloseAndRe
   let ac = wait_for_new_window("AccountCreation");
 
   plan_for_window_close(ac);
   subtest_get_an_account_part_2(ac);
   wait_for_window_close();
 
   // Make sure we set the default search engine
   let engine = Services.search.getEngineByName("bar");
-  assert_equals(engine, Services.search.currentEngine);
+  assert_equals(engine, Services.search.defaultEngine);
 
   // Restore the original search engine.
-  Services.search.currentEngine = originalEngine;
+  Services.search.defaultEngine = originalEngine;
   remove_email_account("green@example.com");
 }
 
 /**
  * This is a subtest for test_get_an_account, and runs the first time the
  * account provisioner window is opened.
  */
 function subtest_get_an_account(w) {
   // Make sure we don't have bar as the default engine yet.
   let engine = Services.search.getEngineByName("bar");
-  assert_not_equals(engine, Services.search.currentEngine);
+  assert_not_equals(engine, Services.search.defaultEngine);
 
   wait_for_provider_list_loaded(w);
   wait_for_search_ready(w);
 
   // Fill in some data
   type_in_search_name(w, "Green Llama");
 
   w.click(w.eid("searchSubmit"));