Bug 1496476 - add tabContextChanged stub. r=standard8
authorDão Gottwald <dao@mozilla.com>
Fri, 05 Oct 2018 15:43:53 +0200
changeset 495551 1638774724799ea8eb692868a2c501d088839a2c
parent 495550 8dcf2e242b3aee77099c6370a0c25e009c5838ef
child 495552 e1fb734d457b2bbd0aadd9c981319809d4aae5fa
push id9984
push userffxbld-merge
push dateMon, 15 Oct 2018 21:07:35 +0000
treeherdermozilla-beta@183d27ea8570 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersstandard8
bugs1496476
milestone64.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1496476 - add tabContextChanged stub. r=standard8
browser/components/urlbar/UrlbarController.jsm
browser/components/urlbar/UrlbarInput.jsm
--- a/browser/components/urlbar/UrlbarController.jsm
+++ b/browser/components/urlbar/UrlbarController.jsm
@@ -142,16 +142,24 @@ class UrlbarController {
    *
    * @param {object} listener The listener to add.
    */
   removeQueryListener(listener) {
     this._listeners.delete(listener);
   }
 
   /**
+   * When switching tabs, clear some internal caches to handle cases like
+   * backspace, autofill or repeated searches.
+   */
+  tabContextChanged() {
+    // TODO: implementation needed (bug 1496685)
+  }
+
+  /**
    * Internal function to notify listeners of results.
    *
    * @param {string} name Name of the notification.
    * @param {object} params Parameters to pass with the notification.
    */
   _notify(name, ...params) {
     for (let listener of this._listeners) {
       try {
--- a/browser/components/urlbar/UrlbarInput.jsm
+++ b/browser/components/urlbar/UrlbarInput.jsm
@@ -409,16 +409,20 @@ class UrlbarInput {
     this._updateTextOverflow();
 
     this._updateUrlTooltip();
   }
 
   _on_scrollend(event) {
     this._updateTextOverflow();
   }
+
+  _on_TabSelect(event) {
+    this.controller.tabContextChanged();
+  }
 }
 
 /**
  * Handles copy and cut commands for the urlbar.
  */
 class CopyCutController {
   /**
    * @param {UrlbarInput} urlbar