Bug 1137234 - Make middle clicks on search suggestions on about:home, about:newtab open search results in a background tab. r=adw
authorKeita Mimura <k-mimura@onu.edu>
Tue, 07 Apr 2015 11:35:38 -0700
changeset 237857 af2151f856fbfe2391827c9d019dd661401bc4a5
parent 237856 ec70706deeec92c814353edb895258c91f20dcf0
child 237858 89e45c21e6314fde45ad73da2104cf70903c9155
push id12245
push userdwillcoxon@mozilla.com
push dateTue, 07 Apr 2015 18:35:56 +0000
treeherderfx-team@af2151f856fb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersadw
bugs1137234
milestone40.0a1
Bug 1137234 - Make middle clicks on search suggestions on about:home, about:newtab open search results in a background tab. r=adw
browser/modules/AboutHome.jsm
browser/modules/ContentSearch.jsm
--- a/browser/modules/AboutHome.jsm
+++ b/browser/modules/AboutHome.jsm
@@ -196,17 +196,17 @@ let AboutHome = {
 
           let engine = Services.search.currentEngine;
           if (AppConstants.MOZ_SERVICES_HEALTHREPORT) {
             window.BrowserSearch.recordSearchInHealthReport(engine, "abouthome", data.selection);
           }
 
           // Trigger a search through nsISearchEngine.getSubmission()
           let submission = engine.getSubmission(data.searchTerms, null, "homepage");
-          let where = data.useNewTab ? "tab" : "current";
+          let where = data.useNewTab ? "tabshifted" : "current";
           window.openUILinkIn(submission.uri.spec, where, false,
                               submission.postData);
 
           // Used for testing
           let mm = aMessage.target.messageManager;
           mm.sendAsyncMessage("AboutHome:SearchTriggered", aMessage.data.searchData);
         });
 
--- a/browser/modules/ContentSearch.jsm
+++ b/browser/modules/ContentSearch.jsm
@@ -221,19 +221,16 @@ this.ContentSearch = {
                                submission.postData);
     }
     catch (err) {
       // The browser may have been closed between the time its content sent the
       // message and the time we handle it.  In that case, trying to call any
       // method on it will throw.
       return Promise.resolve();
     }
-    if (data.useNewTab) {
-      browser.getTabBrowser().selectedTab = newTab;
-    }
     let win = browser.ownerDocument.defaultView;
     win.BrowserSearch.recordSearchInHealthReport(engine, data.whence,
                                                  data.selection || null);
     return Promise.resolve();
   },
 
   _onMessageSetCurrentEngine: function (msg, data) {
     Services.search.currentEngine = Services.search.getEngineByName(data);