Bug 1590450 - Remove the contextual tip API. r=adw
authorHarry Twyford <htwyford@mozilla.com>
Fri, 13 Dec 2019 22:58:21 +0000
changeset 507023 f13b550aabf245e14cdee95bfd8b8d2b4307b8c3
parent 507022 4478cd379335a7e46d158929fa5de72c045f4680
child 507027 73e3c93400685b35afaa980751c5c9137d2756d9
push id103217
push userhtwyford@mozilla.com
push dateSat, 14 Dec 2019 20:50:39 +0000
treeherderautoland@f13b550aabf2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersadw
bugs1590450
milestone73.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 1590450 - Remove the contextual tip API. r=adw Differential Revision: https://phabricator.services.mozilla.com/D57133
browser/base/content/browser.css
browser/components/extensions/ext-browser.json
browser/components/extensions/parent/ext-urlbar.js
browser/components/extensions/schemas/urlbar.json
browser/components/extensions/test/browser/browser.ini
browser/components/extensions/test/browser/browser_ext_urlbar_contextual_tip.js
browser/components/urlbar/UrlbarContextualTip.jsm
browser/components/urlbar/UrlbarInput.jsm
browser/components/urlbar/UrlbarView.jsm
browser/components/urlbar/moz.build
browser/themes/shared/urlbar-autocomplete.inc.css
--- a/browser/base/content/browser.css
+++ b/browser/base/content/browser.css
@@ -390,52 +390,16 @@ toolbarpaletteitem {
 :root[inFullscreen] .global-notificationbox {
   visibility: collapse;
 }
 
 #navigator-toolbox[fullscreenShouldAnimate] {
   transition: 0.8s margin-top ease-out;
 }
 
-/* Rule for hiding urlbar's contextual tip and its children */
-
-#urlbar-contextual-tip.hidden,
-#urlbar-contextual-tip-button.hidden,
-#urlbar-contextual-tip-link.hidden {
-  display: none;
-}
-
-/* Rules for the urlbar's contextual tip's icon. */
-
-#urlbar-contextual-tip-icon {
-  background-image: var(--webextension-contextual-tip-icon);
-}
-
-:root[lwt-popup-brighttext] #urlbar-contextual-tip-icon {
-  background-image: var(--webextension-contextual-tip-icon-light);
-}
-
-:root[lwt-popup-darktext] #urlbar-contextual-tip-icon {
-  background-image: var(--webextension-contextual-tip-icon-dark);
-}
-
-@media (min-resolution: 1.1dppx) {
-  #urlbar-contextual-tip-icon {
-    background-image: var(--webextension-contextual-tip-icon-2x);
-  }
-
-  :root[lwt-popup-brighttext] #urlbar-contextual-tip-icon {
-    background-image: var(--webextension-contextual-tip-icon-2x-light);
-  }
-
-  :root[lwt-popup-darktext] #urlbar-contextual-tip-icon {
-    background-image: var(--webextension-contextual-tip-icon-2x-dark);
-  }
-}
-
 /* Rules to help integrate WebExtension buttons */
 
 .webextension-browser-action > .toolbarbutton-badge-stack > .toolbarbutton-icon {
   height: 16px;
   width: 16px;
 }
 
 @media not all and (min-resolution: 1.1dppx) {
--- a/browser/components/extensions/ext-browser.json
+++ b/browser/components/extensions/ext-browser.json
@@ -208,18 +208,17 @@
     ]
   },
   "urlbar": {
     "url": "chrome://browser/content/parent/ext-urlbar.js",
     "schema": "chrome://browser/content/schemas/urlbar.json",
     "scopes": ["addon_parent"],
     "settings": true,
     "paths": [
-      ["urlbar"],
-      ["urlbar", "contextualTip"]
+      ["urlbar"]
     ]
   },
   "urlOverrides": {
     "url": "chrome://browser/content/parent/ext-url-overrides.js",
     "schema": "chrome://browser/content/schemas/url_overrides.json",
     "scopes": ["addon_parent"],
     "events": ["update", "uninstall", "disable", "enabling"],
     "manifest": ["chrome_url_overrides"],
--- a/browser/components/extensions/parent/ext-urlbar.js
+++ b/browser/components/extensions/parent/ext-urlbar.js
@@ -1,142 +1,39 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 XPCOMUtils.defineLazyModuleGetters(this, {
-  UrlbarContextualTip: "resource:///modules/UrlbarContextualTip.jsm",
   UrlbarPrefs: "resource:///modules/UrlbarPrefs.jsm",
   UrlbarProviderExtension: "resource:///modules/UrlbarProviderExtension.jsm",
 });
 
 var { ExtensionPreferencesManager } = ChromeUtils.import(
   "resource://gre/modules/ExtensionPreferencesManager.jsm"
 );
 var { getSettingsAPI } = ExtensionPreferencesManager;
 
-var { ExtensionParent } = ChromeUtils.import(
-  "resource://gre/modules/ExtensionParent.jsm"
-);
-var { IconDetails } = ExtensionParent;
-
 ExtensionPreferencesManager.addSetting("openViewOnFocus", {
   prefNames: ["browser.urlbar.openViewOnFocus"],
   setCallback(value) {
     return { [this.prefNames[0]]: value };
   },
 });
 
 ExtensionPreferencesManager.addSetting("engagementTelemetry", {
   prefNames: ["browser.urlbar.eventTelemetry.enabled"],
   setCallback(value) {
     return { [this.prefNames[0]]: value };
   },
 });
 
-// Keeps track of the id of the extension using the contextual tip.
-// Only one extension is allowed to use the contextual tip.
-// If another extension attempts to use the contextual tip,
-// then an error is thrown.
-let idOfExtUsingContextualTip = null;
-
 this.urlbar = class extends ExtensionAPI {
-  onShutdown() {
-    if (idOfExtUsingContextualTip === this.extension.id) {
-      for (let w of windowTracker.browserWindows()) {
-        w.gURLBar.view.removeContextualTip();
-      }
-      idOfExtUsingContextualTip = null;
-    }
-  }
-
-  /**
-   * Produces the styles to add to the icon element.
-   * These styles dictate the background images to use by default,
-   * for light/dark themes, and for low/high resolution screens.
-   *
-   * @param {object} icons
-   *   Object obtained from calling `IconDetails.normalize`.
-   *   It's a map of the icon size (e.g. 16) to the actual path of the icon.
-   *   The map can contain multiple size-to-path entries (one entry per icon).
-   * @returns {string} iconStyle
-   */
-  _getStyleFromIconsObject(icons) {
-    let getIcon = (icon, theme) => {
-      if (typeof icon === "object") {
-        return IconDetails.escapeUrl(icon[theme]);
-      }
-      return IconDetails.escapeUrl(icon);
-    };
-
-    let getStyle = (name, icon) => {
-      return `
-        --webextension-${name}: url("${getIcon(icon, "default")}");
-        --webextension-${name}-light: url("${getIcon(icon, "light")}");
-        --webextension-${name}-dark: url("${getIcon(icon, "dark")}");
-      `;
-    };
-
-    let icon16 = IconDetails.getPreferredIcon(icons, this.extension, 16).icon;
-    let icon32 = IconDetails.getPreferredIcon(icons, this.extension, 32).icon;
-    return `
-      ${getStyle("contextual-tip-icon", icon16)}
-      ${getStyle("contextual-tip-icon-2x", icon32)}
-    `;
-  }
-
-  /**
-   * If no extension is using the contextual tip then the current extension
-   * will own the contextual tip. If the contextual tip is already being used
-   * by another extension then an error is thrown.
-   */
-  _registerExtensionToUseContextualTip() {
-    if (idOfExtUsingContextualTip == null) {
-      idOfExtUsingContextualTip = this.extension.id;
-    }
-
-    if (idOfExtUsingContextualTip !== this.extension.id) {
-      throw new Error(
-        "There was an attempt to use the contextual tip API but " +
-          "another extension is already using the contextual tip API."
-      );
-    }
-  }
-
-  /**
-   * Given either a "button" or "link" string, returns a function to
-   * register click listeners on the contextual tip's button or link element.
-   *
-   * See the `urlbar.contextualTip.onButtonClicked` and
-   * `urlbar.contextualTip.onLinkClicked` events for usage.
-   *
-   * @param {string} type
-   *   Represents the type of element to register a click listener on.
-   *   Must be either "button" or "link".
-   * @returns {function} Returns a function to register on the EventManager.
-   */
-  _registerClickListener(type) {
-    return fire => {
-      this._registerExtensionToUseContextualTip();
-
-      const listener = window => {
-        const windowId = this.extension.windowManager.wrapWindow(window).id;
-        fire.async(windowId);
-      };
-
-      UrlbarContextualTip.addClickListener(type, listener);
-
-      return () => {
-        UrlbarContextualTip.removeClickListener(type, listener);
-      };
-    };
-  }
-
   getAPI(context) {
     return {
       urlbar: {
         closeView() {
           let window = windowTracker.getTopNormalWindow(context);
           window.gURLBar.view.close();
         },
 
@@ -252,97 +149,12 @@ this.urlbar = class extends ExtensionAPI
           callback: () => UrlbarPrefs.get("openViewOnFocus"),
         }),
 
         engagementTelemetry: getSettingsAPI({
           context,
           name: "engagementTelemetry",
           callback: () => UrlbarPrefs.get("eventTelemetry.enabled"),
         }),
-
-        contextualTip: {
-          /**
-           * Sets the contextual tip's icon,
-           * title, button title, and link title.
-           *
-           * @param {object} details
-           *   If null, then the contextual tip will be hidden.
-           * @param {string} details.title
-           *   Main title on the contextual tip.
-           * @param {string} [details.buttonTitle]
-           *   If not given, no button is shown.
-           * @param {string} [details.linkTitle]
-           *   If not given, no link is shown.
-           * @param {object} [details.icon]
-           * @param {string} [details.icon.defaultIcon]
-           *   Path to an image file to be used as the default icon.
-           * @param {object} [details.icon.themeIcons]
-           * @param {string} [details.icon.themeIcons.light]
-           *   Path to an image file to be used as the icon for light themes.
-           * @param {string} [details.icon.themeIcons.dark]
-           *   Path to an image file to be used as the icon for dark themes.
-           * @param {integer} [details.icon.themeIcons.size]
-           *   Indicates the size of the icons.
-           */
-          set: details => {
-            this._registerExtensionToUseContextualTip();
-
-            const mostRecentWindow = windowTracker.getTopNormalWindow(context);
-
-            const iconPathFromDetails = details.icon
-              ? details.icon.defaultIcon
-              : null;
-            const iconPathFromExtensionManifest =
-              context.extension.manifest.icons;
-            const icons = IconDetails.normalize(
-              {
-                path: iconPathFromDetails || iconPathFromExtensionManifest,
-                iconType: "contextualTip",
-                themeIcons: details.icon ? details.icon.themeIcons : null,
-              },
-              context.extension
-            );
-
-            const iconStyle = this._getStyleFromIconsObject(icons);
-
-            mostRecentWindow.gURLBar.view.setContextualTip({
-              iconStyle,
-              title: details.title,
-              buttonTitle: details.buttonTitle,
-              linkTitle: details.linkTitle,
-            });
-          },
-
-          /**
-           * Hides the contextual tip.
-           */
-          remove: () => {
-            this._registerExtensionToUseContextualTip();
-            const mostRecentWindow = windowTracker.getTopNormalWindow(context);
-            mostRecentWindow.gURLBar.view.hideContextualTip();
-          },
-
-          /*
-           * Fired when the user clicks the contextual tip's button.
-           * The listener is passed the id of the window where
-           * the contextual tip was clicked.
-           */
-          onButtonClicked: new EventManager({
-            context,
-            name: "urlbar.contextualTip.onButtonClicked",
-            register: this._registerClickListener("button"),
-          }).api(),
-
-          /**
-           * Fired when the user clicks the contextual tip's link.
-           * The listener is passed the id of the window where
-           * the contextual tip was clicked.
-           */
-          onLinkClicked: new EventManager({
-            context,
-            name: "urlbar.contextualTip.onLinkClicked",
-            register: this._registerClickListener("link"),
-          }).api(),
-        },
       },
     };
   }
 };
--- a/browser/components/extensions/schemas/urlbar.json
+++ b/browser/components/extensions/schemas/urlbar.json
@@ -272,112 +272,10 @@
             "name": "providerName",
             "type": "string",
             "pattern": "^[a-zA-Z0-9_-]+$",
             "description": "The listener will be called for the results of the provider with this name."
           }
         ]
       }
     ]
-  },
-  {
-    "namespace": "urlbar.contextualTip",
-    "description": "A contextual tip appears in the urlbar's view (its search results panel) and has an icon, text, optional button, and an optional link. Use the <code>browser.urlbar.contextualTip</code> API to experiment with the contextual tip. Restricted to Mozilla privileged WebExtensions.",
-    "types": [
-      {
-        "id": "ContextualTip",
-        "type": "object",
-        "description": "An object containing the path to an icon, the title, button title, and link title to set on the contextual tip.",
-        "properties": {
-          "icon": {
-            "type": "object",
-            "optional": true,
-            "description": "Specifies the default icon and theme icons",
-            "properties": {
-              "defaultIcon": {
-                "choices": [
-                  {
-                    "type": "string",
-                    "description": "A URL to an image (e.g. favicon's URL)"
-                  },
-                  {
-                    "$ref": "manifest.IconPath"
-                  }
-                ],
-                "description": "Specifies the default icon to use in the contextual tip."
-              },
-              "themeIcons": {
-                "type": "array",
-                "optional": true,
-                "minItems": 1,
-                "items": { "$ref": "manifest.ThemeIcons" },
-                "description": "Specifies icons to use for dark and light themes. Each item in the array is for a specified icon size."
-              }
-            }
-          },
-          "title": {
-            "type": "string",
-            "minLength": 1,
-            "description": "A string to be used as the contextual tip's title."
-          },
-          "buttonTitle": {
-            "type": "string",
-            "minLength": 1,
-            "description": "A string to be used as the contextual tip's button's title.",
-            "optional": true
-          },
-          "linkTitle": {
-            "type": "string",
-            "minLength": 1,
-            "description": "A string to be used as the contextual tip's link's title.",
-            "optional": true
-          }
-        }
-      }
-    ],
-    "functions": [
-      {
-        "name": "set",
-        "type": "function",
-        "description": "Sets the contextual tip in the most recent browser winodw with the given icon, title, button title, and link title. If the urlbar's view is not already open, then it will be opened so the contextual tip will be visible. Note that when the urlbar's view is closed, the contextual tip is hidden and will not appear again. `browser.urlbar.contextualTip.set` must be called each time a contextual tip should appear.",
-        "parameters": [
-          {
-            "name": "details",
-            "$ref": "ContextualTip",
-            "description": "Specifies the contextual tip's texts."
-          }
-        ]
-      },
-      {
-        "name": "remove",
-        "type": "function",
-        "description": "Hides the contextual tip (it will still be in the DOM).",
-        "parameters": []
-      }
-    ],
-    "events": [
-      {
-        "name": "onButtonClicked",
-        "type": "function",
-        "description": "Fired when the user clicks the contextual tip's button.",
-        "parameters": [
-          {
-            "name": "windowId",
-            "type": "integer",
-            "description": "The id of the window where the contextual tip's button was clicked."
-          }
-        ]
-      },
-      {
-        "name": "onLinkClicked",
-        "type": "function",
-        "description": "Fired when the user clicks the contextual tip's link.",
-        "parameters": [
-          {
-            "name": "windowId",
-            "type": "integer",
-            "description": "The id of the window where the contextual tip's link was clicked."
-          }
-        ]
-      }
-    ]
   }
 ]
--- a/browser/components/extensions/test/browser/browser.ini
+++ b/browser/components/extensions/test/browser/browser.ini
@@ -265,17 +265,16 @@ skip-if = os == 'mac' # Save as PDF not 
 [browser_ext_tabs_update.js]
 [browser_ext_tabs_update_highlighted.js]
 [browser_ext_tabs_update_url.js]
 [browser_ext_tabs_zoom.js]
 [browser_ext_themes_validation.js]
 [browser_ext_topSites.js]
 [browser_ext_url_overrides_newtab.js]
 [browser_ext_urlbar.js]
-[browser_ext_urlbar_contextual_tip.js]
 [browser_ext_user_events.js]
 [browser_ext_webRequest.js]
 [browser_ext_webrtc.js]
 skip-if = os == 'mac' # Bug 1565738
 [browser_ext_webNavigation_frameId0.js]
 [browser_ext_webNavigation_getFrames.js]
 [browser_ext_webNavigation_onCreatedNavigationTarget.js]
 [browser_ext_webNavigation_onCreatedNavigationTarget_contextmenu.js]
deleted file mode 100644
--- a/browser/components/extensions/test/browser/browser_ext_urlbar_contextual_tip.js
+++ /dev/null
@@ -1,927 +0,0 @@
-"use strict";
-
-const { UrlbarTestUtils } = ChromeUtils.import(
-  "resource://testing-common/UrlbarTestUtils.jsm"
-);
-
-const {
-  Management: {
-    global: { windowTracker },
-  },
-} = ChromeUtils.import("resource://gre/modules/Extension.jsm", null);
-
-/**
- * The two tests below test that the urlbar permission
- * is required to use the contextual tip API.
- */
-add_task(async function test_contextual_tip_without_urlbar_permission() {
-  let ext = ExtensionTestUtils.loadExtension({
-    isPrivileged: true,
-    background() {
-      browser.test.assertEq(
-        browser.urlbar,
-        undefined,
-        "'urlbar' permission is required"
-      );
-    },
-  });
-  await ext.startup();
-  await ext.unload();
-});
-
-add_task(async function test_contextual_tip_with_urlbar_permission() {
-  let ext = ExtensionTestUtils.loadExtension({
-    isPrivileged: true,
-    manifest: {
-      permissions: ["urlbar"],
-    },
-    background() {
-      browser.test.assertTrue(!!browser.urlbar.contextualTip);
-    },
-  });
-  await ext.startup();
-  await ext.unload();
-});
-
-/**
- * Tests that calling `set` with a details object will
- * cause the urlbar's view to open,
- * the contextual tip's texts will be updated,
- * and the contextual tip will be hidden when the view closes.
- * It also tests that the contextual tip's texts can be updated
- * when the view is already open and a tip is already displayed.
- */
-add_task(async function set_contextual_tip_and_set_contextual_tip_again() {
-  let win = await BrowserTestUtils.openNewBrowserWindow();
-
-  let ext = ExtensionTestUtils.loadExtension({
-    isPrivileged: true,
-    manifest: {
-      permissions: ["urlbar"],
-    },
-    background() {
-      browser.urlbar.contextualTip.set({
-        title: "Contextual tip's title",
-        buttonTitle: "Button",
-        linkTitle: "Link",
-      });
-
-      browser.test.onMessage.addListener(() => {
-        browser.urlbar.contextualTip.set({
-          title: "Updated title",
-          buttonTitle: "Updated button title",
-          linkTitle: "Updated link title",
-        });
-        browser.test.sendMessage("updated");
-      });
-    },
-  });
-
-  await ext.startup();
-  await BrowserTestUtils.waitForCondition(() =>
-    UrlbarTestUtils.isPopupOpen(win)
-  );
-
-  Assert.equal(
-    win.gURLBar.view.contextualTip._elements.title.textContent,
-    "Contextual tip's title"
-  );
-  Assert.equal(
-    win.gURLBar.view.contextualTip._elements.button.textContent,
-    "Button"
-  );
-  Assert.equal(
-    win.gURLBar.view.contextualTip._elements.link.textContent,
-    "Link"
-  );
-
-  ext.sendMessage("update tip's texts");
-  await ext.awaitMessage("updated");
-
-  // Checks the tip's texts were updated while the urlbar view is open
-  Assert.equal(
-    win.gURLBar.view.contextualTip._elements.title.textContent,
-    "Updated title"
-  );
-  Assert.equal(
-    win.gURLBar.view.contextualTip._elements.button.textContent,
-    "Updated button title"
-  );
-  Assert.equal(
-    win.gURLBar.view.contextualTip._elements.link.textContent,
-    "Updated link title"
-  );
-
-  await UrlbarTestUtils.promisePopupClose(win);
-  Assert.ok(
-    BrowserTestUtils.is_hidden(
-      win.gURLBar.view.contextualTip._elements.container
-    )
-  );
-  await UrlbarTestUtils.promiseAutocompleteResultPopup({
-    window: win,
-    waitForFocus,
-    value: " ",
-  });
-  Assert.ok(
-    BrowserTestUtils.is_hidden(
-      win.gURLBar.view.contextualTip._elements.container
-    )
-  );
-  await UrlbarTestUtils.promisePopupClose(win);
-
-  await ext.unload();
-  await BrowserTestUtils.closeWindow(win);
-});
-
-/**
- * Tests that calling `browser.urlbar.contextualTip.remove` will
- * hide the contextual tip and close the popup panel if a contextual tip
- * is present and if there's no search suggestions in the popup panel.
- * In this test, the urlbar input field is not in focus and there's no text
- * in the field so we assume that there's no search suggestions.
- */
-add_task(async function hiding_contextual_tip_closing_popup_panel() {
-  let win = await BrowserTestUtils.openNewBrowserWindow();
-
-  let ext = ExtensionTestUtils.loadExtension({
-    isPrivileged: true,
-    manifest: {
-      permissions: ["urlbar"],
-    },
-    background() {
-      browser.urlbar.contextualTip.set({
-        title: "Contextual tip's title",
-        buttonTitle: "Button",
-        linkTitle: "Link",
-      });
-
-      browser.test.onMessage.addListener(async msg => {
-        browser.urlbar.contextualTip.remove();
-        browser.test.sendMessage("next-test");
-      });
-    },
-  });
-
-  await ext.startup();
-  await BrowserTestUtils.waitForCondition(() =>
-    UrlbarTestUtils.isPopupOpen(win)
-  );
-
-  ext.sendMessage("hide-contextual-tip");
-  await ext.awaitMessage("next-test");
-
-  Assert.ok(
-    BrowserTestUtils.is_hidden(
-      win.gURLBar.view.contextualTip._elements.container
-    )
-  );
-  Assert.ok(!UrlbarTestUtils.isPopupOpen(win));
-  await UrlbarTestUtils.promiseAutocompleteResultPopup({
-    window: win,
-    waitForFocus,
-    value: " ",
-  });
-  Assert.ok(
-    BrowserTestUtils.is_hidden(
-      win.gURLBar.view.contextualTip._elements.container
-    )
-  );
-  await UrlbarTestUtils.promisePopupClose(win);
-
-  await ext.unload();
-  await BrowserTestUtils.closeWindow(win);
-});
-
-/**
- * Tests that calling `browser.urlbar.contextualTip.remove` will
- * hide the contextual tip and leave the popup open if a contextual tip
- * is present and if there are search suggestions in the popup panel.
- * In this test, we enter "hello world" in the urlbar input field and assume
- * there will be at least one search suggestion.
- */
-add_task(async function hiding_contextual_tip_and_leaving_popup_panel_open() {
-  let win = await BrowserTestUtils.openNewBrowserWindow();
-
-  let ext = ExtensionTestUtils.loadExtension({
-    isPrivileged: true,
-    manifest: {
-      permissions: ["urlbar"],
-    },
-    background() {
-      browser.urlbar.contextualTip.set({
-        title: "Contextual tip's title",
-        buttonTitle: "Button",
-        linkTitle: "Link",
-      });
-
-      browser.test.onMessage.addListener(async msg => {
-        browser.urlbar.contextualTip.remove();
-        browser.test.sendMessage("next-test");
-      });
-    },
-  });
-
-  await ext.startup();
-  await BrowserTestUtils.waitForCondition(() =>
-    UrlbarTestUtils.isPopupOpen(win)
-  );
-  Assert.equal(
-    win.gURLBar.view.contextualTip._elements.title.textContent,
-    "Contextual tip's title"
-  );
-  Assert.equal(
-    win.gURLBar.view.contextualTip._elements.button.textContent,
-    "Button"
-  );
-  Assert.equal(
-    win.gURLBar.view.contextualTip._elements.link.textContent,
-    "Link"
-  );
-
-  await UrlbarTestUtils.promiseAutocompleteResultPopup({
-    window: win,
-    waitForFocus,
-    value: "hello world",
-  });
-
-  ext.sendMessage("hide-contextual-tip");
-  await ext.awaitMessage("next-test");
-
-  Assert.ok(
-    BrowserTestUtils.is_hidden(
-      win.gURLBar.view.contextualTip._elements.container
-    )
-  );
-  Assert.ok(UrlbarTestUtils.isPopupOpen(win));
-
-  await ext.unload();
-  await BrowserTestUtils.closeWindow(win);
-});
-
-/**
- * Tests that setting the button title or link title to null will
- * hide the button or link (respectively).
- */
-add_task(async function hide_button_and_link() {
-  let win = await BrowserTestUtils.openNewBrowserWindow();
-
-  let ext = ExtensionTestUtils.loadExtension({
-    isPrivileged: true,
-    manifest: {
-      permissions: ["urlbar"],
-    },
-    background() {
-      browser.urlbar.contextualTip.set({
-        title: "contextual tip's title",
-        buttonTitle: "contextual tip's button title",
-        linkTitle: "contextual tip's link title",
-      });
-      browser.test.onMessage.addListener(msg => {
-        browser.urlbar.contextualTip.set({
-          title: "contextual tip's title",
-        });
-        browser.test.sendMessage("next-test");
-      });
-    },
-  });
-
-  await ext.startup();
-  await BrowserTestUtils.waitForCondition(() =>
-    UrlbarTestUtils.isPopupOpen(win)
-  );
-
-  Assert.equal(
-    win.gURLBar.view.contextualTip._elements.title.textContent,
-    "contextual tip's title"
-  );
-  Assert.equal(
-    win.gURLBar.view.contextualTip._elements.button.textContent,
-    "contextual tip's button title"
-  );
-  Assert.equal(
-    win.gURLBar.view.contextualTip._elements.link.textContent,
-    "contextual tip's link title"
-  );
-
-  ext.sendMessage("hide button and link");
-  await ext.awaitMessage("next-test");
-
-  Assert.ok(
-    BrowserTestUtils.is_hidden(win.gURLBar.view.contextualTip._elements.button)
-  );
-  Assert.ok(
-    BrowserTestUtils.is_hidden(win.gURLBar.view.contextualTip._elements.link)
-  );
-
-  await ext.unload();
-  await BrowserTestUtils.closeWindow(win);
-});
-
-/**
- * Tests that if there's no `title` property in the argument for
- * `set` then a type error is thrown.
- */
-add_task(async function test_showing_contextual_tip() {
-  let ext = ExtensionTestUtils.loadExtension({
-    isPrivileged: true,
-    manifest: {
-      permissions: ["urlbar"],
-    },
-    background() {
-      browser.test.assertThrows(
-        () =>
-          browser.urlbar.contextualTip.set({
-            buttonTitle: "button title",
-            linkTitle: "link title",
-          }),
-        /Type error for parameter/,
-        "Throws error because there's no title property in the argument"
-      );
-    },
-  });
-  await ext.startup();
-  await ext.unload();
-});
-
-/**
- * Tests that when the extension is removed, `onShutdown` will remove
- * the contextual_tip from the DOM.
- */
-add_task(async function contextual_tip_removed_onShutdown() {
-  let win = await BrowserTestUtils.openNewBrowserWindow();
-
-  let ext = ExtensionTestUtils.loadExtension({
-    isPrivileged: true,
-    manifest: {
-      permissions: ["urlbar"],
-    },
-    background() {
-      browser.urlbar.contextualTip.set({
-        title: "Hello World!",
-        buttonTitle: "Click Me",
-        linkTitle: "Link",
-      });
-    },
-  });
-
-  await ext.startup();
-  await BrowserTestUtils.waitForCondition(
-    () => !!win.gURLBar.view.contextualTip._elements
-  );
-  Assert.ok(win.document.getElementById("urlbar-contextual-tip"));
-  await ext.unload();
-
-  // There should be no contextual tip in the DOM after onShutdown
-
-  Assert.ok(!win.document.getElementById("urlbar-contextual-tip"));
-
-  await BrowserTestUtils.closeWindow(win);
-});
-
-/**
- * The following tests for the contextual tip's
- * `onLinkClicked` and `onButtonClicked` events.
- */
-
-/**
- * Tests that a click listener can be set on the given type of element.
- * @param {string} elementType Either "button" or "link"
- * @param {boolean} shouldAddListenerBeforeTip
- *   Indicates whether the click listener should be added before or after
- *   the setting the contextual tip.
- */
-async function add_onclick_to_element(elementType, shouldAddListenerBeforeTip) {
-  let win = await BrowserTestUtils.openNewBrowserWindow();
-  const windowId = windowTracker.getId(win);
-
-  let ext = ExtensionTestUtils.loadExtension({
-    isPrivileged: true,
-    manifest: {
-      permissions: ["urlbar"],
-    },
-    background() {
-      browser.test.onMessage.addListener(
-        (msg, elementType, shouldAddListenerBeforeTip) => {
-          if (msg == "elementType") {
-            const capitalizedElementType =
-              elementType[0].toUpperCase() + elementType.substring(1);
-
-            const addListener = () => {
-              browser.urlbar.contextualTip[
-                `on${capitalizedElementType}Clicked`
-              ].addListener(windowId => {
-                browser.test.sendMessage(`on-${elementType}-clicked`, windowId);
-              });
-            };
-
-            if (shouldAddListenerBeforeTip) {
-              addListener();
-            }
-
-            browser.urlbar.contextualTip.set({
-              title: "Title",
-              [`${elementType}Title`]: "Click Me!",
-            });
-
-            if (!shouldAddListenerBeforeTip) {
-              addListener();
-            }
-
-            browser.test.sendMessage("next-test");
-          }
-        }
-      );
-    },
-  });
-
-  await ext.startup();
-
-  ext.sendMessage("elementType", elementType, shouldAddListenerBeforeTip);
-  await ext.awaitMessage("next-test");
-
-  await BrowserTestUtils.waitForCondition(
-    () => !!win.gURLBar.view.contextualTip._elements
-  );
-
-  win.gURLBar.view.contextualTip._elements[elementType].click();
-  const windowIdFromExtension = await ext.awaitMessage(
-    `on-${elementType}-clicked`
-  );
-
-  Assert.equal(windowId, windowIdFromExtension);
-
-  await ext.unload();
-  await BrowserTestUtils.closeWindow(win);
-}
-
-/**
- * Tests that a click listener can be added to the button
- * through `onButtonClicked` and to the link through `onLinkClicked`.
- */
-add_task(async () => {
-  await add_onclick_to_element("button");
-});
-add_task(async () => {
-  await add_onclick_to_element("link");
-});
-
-/**
- * Tests that a click listener can be added to the button
- * through `onButtonClicked` and to the link through `onLinkClicked`
- * before a contextual tip has been created.
- */
-add_task(async () => {
-  await add_onclick_to_element("button", true);
-});
-add_task(async () => {
-  await add_onclick_to_element("link", true);
-});
-
-/**
- * The tests for below are for the contextual_tip's icon support.
- */
-
-/**
- * Tests that the contextual tip's default theme icon can be set
- * to a favicon's url.
- */
-add_task(async function test_set_icon_given_favicon() {
-  let win = await BrowserTestUtils.openNewBrowserWindow();
-
-  let ext = ExtensionTestUtils.loadExtension({
-    isPrivileged: true,
-    manifest: {
-      permissions: ["urlbar"],
-    },
-    background() {
-      browser.urlbar.contextualTip.set({
-        icon: { defaultIcon: "data:image/png;base64,SFRUUCBpY29uIGRhdGE=" },
-        title: "the title is required",
-      });
-      browser.test.sendMessage(
-        "ready",
-        browser.runtime.getURL("data:image/png;base64,SFRUUCBpY29uIGRhdGE=")
-      );
-    },
-  });
-
-  await ext.startup();
-  await BrowserTestUtils.waitForCondition(() =>
-    UrlbarTestUtils.isPopupOpen(win)
-  );
-  const iconURL = await ext.awaitMessage("ready");
-  const backgroundImageProperty = `url("${iconURL}")`;
-  const iconElement = win.gURLBar.view.contextualTip._elements.icon;
-  Assert.equal(
-    backgroundImageProperty,
-    win.getComputedStyle(iconElement).backgroundImage
-  );
-
-  await ext.unload();
-  await BrowserTestUtils.closeWindow(win);
-});
-
-/**
- * Tests that the contextual tip's default theme icon can be set
- * to the relative path of an icon.
- */
-add_task(async function test_set_icon_given_path() {
-  let win = await BrowserTestUtils.openNewBrowserWindow();
-
-  let ext = ExtensionTestUtils.loadExtension({
-    isPrivileged: true,
-    manifest: {
-      permissions: ["urlbar"],
-    },
-    background() {
-      browser.urlbar.contextualTip.set({
-        icon: { defaultIcon: "icons/icon.png" },
-        title: "the title is required",
-      });
-      browser.test.sendMessage(
-        "ready",
-        browser.runtime.getURL("icons/icon.png")
-      );
-    },
-  });
-
-  await ext.startup();
-  await BrowserTestUtils.waitForCondition(() =>
-    UrlbarTestUtils.isPopupOpen(win)
-  );
-  const iconURL = await ext.awaitMessage("ready");
-  const backgroundImageProperty = `url("${iconURL}")`;
-  const iconElement = win.gURLBar.view.contextualTip._elements.icon;
-  Assert.equal(
-    backgroundImageProperty,
-    win.getComputedStyle(iconElement).backgroundImage
-  );
-
-  await ext.unload();
-  await BrowserTestUtils.closeWindow(win);
-});
-
-/**
- * Tests that when a call to `set` is made and
- * the `icon` is omitted from its arguments, then
- * the contexual tip will use the icon path specified in the
- * extension's `icons` manifest property.
- */
-add_task(async function test_set_icon_given_path() {
-  let win = await BrowserTestUtils.openNewBrowserWindow();
-
-  let ext = ExtensionTestUtils.loadExtension({
-    isPrivileged: true,
-    manifest: {
-      permissions: ["urlbar"],
-      icons: {
-        "19": "extension_icon.png",
-      },
-    },
-    background() {
-      browser.urlbar.contextualTip.set({
-        title: "the title is required",
-      });
-      browser.test.sendMessage(
-        "ready",
-        browser.runtime.getURL("extension_icon.png")
-      );
-    },
-  });
-
-  await ext.startup();
-  await BrowserTestUtils.waitForCondition(() =>
-    UrlbarTestUtils.isPopupOpen(win)
-  );
-  const iconURL = await ext.awaitMessage("ready");
-  const backgroundImageProperty = `url("${iconURL}")`;
-  const iconElement = win.gURLBar.view.contextualTip._elements.icon;
-  Assert.equal(
-    backgroundImageProperty,
-    win.getComputedStyle(iconElement).backgroundImage
-  );
-  await ext.unload();
-  await BrowserTestUtils.closeWindow(win);
-});
-
-/**
- * Tests that the contextual tip will set the appropriate theme icon when
- * there's a `icon.themeIcons` array in the argument passed into a call to
- * `set` where the `icon.themeIcons` array contains one
- * theme icon object of size 19.
- */
-add_task(async function test_themeIcons() {
-  let win = await BrowserTestUtils.openNewBrowserWindow();
-
-  let ext = ExtensionTestUtils.loadExtension({
-    isPrivileged: true,
-    manifest: {
-      permissions: ["urlbar"],
-    },
-    background() {
-      browser.urlbar.contextualTip.set({
-        icon: {
-          defaultIcon: "icons/default.png",
-          themeIcons: [
-            {
-              light: "icons/light.png",
-              dark: "icons/dark.png",
-              size: 19,
-            },
-          ],
-        },
-        title: "the title is required",
-      });
-      browser.test.sendMessage("ready", {
-        expectedDefaultIconURL: browser.runtime.getURL("icons/default.png"),
-        expectedLightIconURL: browser.runtime.getURL("icons/light.png"),
-        expectedDarkIconURL: browser.runtime.getURL("icons/dark.png"),
-      });
-    },
-  });
-
-  await ext.startup();
-  await BrowserTestUtils.waitForCondition(() =>
-    UrlbarTestUtils.isPopupOpen(win)
-  );
-  const {
-    expectedDefaultIconURL,
-    expectedLightIconURL,
-    expectedDarkIconURL,
-  } = await ext.awaitMessage("ready");
-
-  // Tests that the default icon appears.
-  let iconElement = win.gURLBar.view.contextualTip._elements.icon;
-  Assert.equal(
-    `url("${expectedDefaultIconURL}")`,
-    win.getComputedStyle(iconElement).backgroundImage
-  );
-
-  // Tests that the dark icon appears on a light theme.
-  // This test uses popup colors from
-  // `browser/themes/addons/light/manifest.json`.
-  let lightThemeExt = ExtensionTestUtils.loadExtension({
-    manifest: {
-      theme: {
-        colors: {
-          popup: "#fff",
-          popup_text: "#0c0c0d",
-          popup_border: "#ccc",
-        },
-      },
-    },
-  });
-  await lightThemeExt.startup();
-  iconElement = win.gURLBar.view.contextualTip._elements.icon;
-  Assert.equal(
-    `url("${expectedDarkIconURL}")`,
-    win.getComputedStyle(iconElement).backgroundImage
-  );
-  await lightThemeExt.unload();
-
-  // Tests that the light icon appears on a dark theme.
-  // This test uses popup colors from `browser/themes/addons/dark/manifest.json`
-  let darkThemeExt = ExtensionTestUtils.loadExtension({
-    manifest: {
-      theme: {
-        colors: {
-          popup: "#4a4a4f",
-          popup_text: "rgb(249, 249, 250)",
-          popup_border: "#27272b",
-        },
-      },
-    },
-  });
-  await darkThemeExt.startup();
-  iconElement = win.gURLBar.view.contextualTip._elements.icon;
-  Assert.equal(
-    `url("${expectedLightIconURL}")`,
-    win.getComputedStyle(iconElement).backgroundImage
-  );
-  await darkThemeExt.unload();
-
-  await ext.unload();
-  await BrowserTestUtils.closeWindow(win);
-});
-
-const RESOLUTION_PREF = "layout.css.devPixelsPerPx";
-
-/**
- * Tests that the contextual_tip will use icons of size 16 for
- * low-resolution screens when there's a `icon.themeIcons` array in
- * the argument passed into a call to `set` where the
- * `icon.themeIcons` array contains two theme icon objects of sizes 16 and 32.
- */
-add_task(async function test_themeIcons_size_16() {
-  let win = await BrowserTestUtils.openNewBrowserWindow();
-
-  let ext = ExtensionTestUtils.loadExtension({
-    isPrivileged: true,
-    manifest: {
-      permissions: ["urlbar"],
-    },
-    background() {
-      browser.urlbar.contextualTip.set({
-        icon: {
-          defaultIcon: "icons/default.png",
-          themeIcons: [
-            {
-              light: "icons/light-16.png",
-              dark: "icons/dark-16.png",
-              size: 16,
-            },
-            {
-              light: "icons/light-32.png",
-              dark: "icons/dark-32.png",
-              size: 32,
-            },
-          ],
-        },
-        title: "the title is required",
-      });
-      browser.test.sendMessage("ready", {
-        expectedDefaultIconURL: browser.runtime.getURL("icons/default.png"),
-        expectedLightIconURL: browser.runtime.getURL("icons/light-16.png"),
-        expectedDarkIconURL: browser.runtime.getURL("icons/dark-16.png"),
-      });
-    },
-  });
-
-  // Testing for icons of size 16 on a low-resolution display.
-  await SpecialPowers.pushPrefEnv({ set: [[RESOLUTION_PREF, 1]] });
-
-  await ext.startup();
-  await BrowserTestUtils.waitForCondition(() =>
-    UrlbarTestUtils.isPopupOpen(win)
-  );
-
-  const {
-    expectedDefaultIconURL,
-    expectedLightIconURL,
-    expectedDarkIconURL,
-  } = await ext.awaitMessage("ready");
-
-  // Tests that the default icon appears.
-  let iconElement = win.gURLBar.view.contextualTip._elements.icon;
-  Assert.equal(
-    `url("${expectedDefaultIconURL}")`,
-    win.getComputedStyle(iconElement).backgroundImage
-  );
-
-  // Tests that the dark icon appears on a light theme.
-  // This test uses popup colors from
-  // `browser/themes/addons/light/manifest.json`.
-  let lightThemeExt = ExtensionTestUtils.loadExtension({
-    manifest: {
-      theme: {
-        colors: {
-          popup: "#fff",
-          popup_text: "#0c0c0d",
-          popup_border: "#ccc",
-        },
-      },
-    },
-  });
-  await lightThemeExt.startup();
-  iconElement = win.gURLBar.view.contextualTip._elements.icon;
-  Assert.equal(
-    `url("${expectedDarkIconURL}")`,
-    win.getComputedStyle(iconElement).backgroundImage
-  );
-  await lightThemeExt.unload();
-
-  // Tests that the light icon appears on a dark theme.
-  // This test uses popup colors from `browser/themes/addons/dark/manifest.json`
-  let darkThemeExt = ExtensionTestUtils.loadExtension({
-    manifest: {
-      theme: {
-        colors: {
-          popup: "#4a4a4f",
-          popup_text: "rgb(249, 249, 250)",
-          popup_border: "#27272b",
-        },
-      },
-    },
-  });
-  await darkThemeExt.startup();
-  iconElement = win.gURLBar.view.contextualTip._elements.icon;
-  Assert.equal(
-    `url("${expectedLightIconURL}")`,
-    win.getComputedStyle(iconElement).backgroundImage
-  );
-  await darkThemeExt.unload();
-
-  await SpecialPowers.popPrefEnv();
-  await ext.unload();
-  await BrowserTestUtils.closeWindow(win);
-});
-
-/**
- * Tests that the contextual_tip will use icons of size 32 for
- * high-resolution screens when there's a `icon.themeIcons` array in
- * the argument passed into a call to `set` where the
- * `icon.themeIcons` array contains two theme icon objects of sizes 16 and 32.
- */
-add_task(async function test_themeIcons_size_32() {
-  let win = await BrowserTestUtils.openNewBrowserWindow();
-
-  let ext = ExtensionTestUtils.loadExtension({
-    isPrivileged: true,
-    manifest: {
-      permissions: ["urlbar"],
-    },
-    background() {
-      browser.urlbar.contextualTip.set({
-        icon: {
-          defaultIcon: "icons/default.png",
-          themeIcons: [
-            {
-              light: "icons/light-16.png",
-              dark: "icons/dark-16.png",
-              size: 16,
-            },
-            {
-              light: "icons/light-32.png",
-              dark: "icons/dark-32.png",
-              size: 32,
-            },
-          ],
-        },
-        title: "the title is required",
-      });
-      browser.test.sendMessage("ready", {
-        expectedDefaultIconURL: browser.runtime.getURL("icons/default.png"),
-        expectedLightIconURL: browser.runtime.getURL("icons/light-32.png"),
-        expectedDarkIconURL: browser.runtime.getURL("icons/dark-32.png"),
-      });
-    },
-  });
-
-  // Testing for icons of size 32 on a high-resolution display.
-  await SpecialPowers.pushPrefEnv({ set: [[RESOLUTION_PREF, 2]] });
-
-  await ext.startup();
-  await BrowserTestUtils.waitForCondition(() =>
-    UrlbarTestUtils.isPopupOpen(win)
-  );
-  const {
-    expectedDefaultIconURL,
-    expectedLightIconURL,
-    expectedDarkIconURL,
-  } = await ext.awaitMessage("ready");
-
-  // Tests that the default icon appears.
-  let iconElement = win.gURLBar.view.contextualTip._elements.icon;
-  Assert.equal(
-    `url("${expectedDefaultIconURL}")`,
-    win.getComputedStyle(iconElement).backgroundImage
-  );
-
-  // Tests that the dark icon appears on a light theme.
-  // This test uses popup colors from
-  // `browser/themes/addons/light/manifest.json`.
-  let lightThemeExt = ExtensionTestUtils.loadExtension({
-    manifest: {
-      theme: {
-        colors: {
-          popup: "#fff",
-          popup_text: "#0c0c0d",
-          popup_border: "#ccc",
-        },
-      },
-    },
-  });
-  await lightThemeExt.startup();
-  iconElement = win.gURLBar.view.contextualTip._elements.icon;
-  Assert.equal(
-    `url("${expectedDarkIconURL}")`,
-    win.getComputedStyle(iconElement).backgroundImage
-  );
-  await lightThemeExt.unload();
-
-  // Tests that the light icon appears on a dark theme.
-  // This test uses popup colors from `browser/themes/addons/dark/manifest.json`
-  let darkThemeExt = ExtensionTestUtils.loadExtension({
-    manifest: {
-      theme: {
-        colors: {
-          popup: "#4a4a4f",
-          popup_text: "rgb(249, 249, 250)",
-          popup_border: "#27272b",
-        },
-      },
-    },
-  });
-  await darkThemeExt.startup();
-  iconElement = win.gURLBar.view.contextualTip._elements.icon;
-  Assert.equal(
-    `url("${expectedLightIconURL}")`,
-    win.getComputedStyle(iconElement).backgroundImage
-  );
-  await darkThemeExt.unload();
-
-  await SpecialPowers.popPrefEnv();
-  await ext.unload();
-  await BrowserTestUtils.closeWindow(win);
-});
deleted file mode 100644
--- a/browser/components/urlbar/UrlbarContextualTip.jsm
+++ /dev/null
@@ -1,165 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-"use strict";
-
-var EXPORTED_SYMBOLS = ["UrlbarContextualTip"];
-
-// These are global listeners; all instances of the contextual tip will
-// have click listeners executed when their button or link is clicked.
-let clickListeners = new Map([["button", new Set()], ["link", new Set()]]);
-
-/**
- * Calls all the click listeners for the specified element.
- *
- * @param {string} element Either "button" or "link"
- *   Corresponds to the button or link on the contextual tip.
- * @param {object} window The window
- */
-function callClickListeners(element, window) {
-  for (let clickListener of clickListeners.get(element)) {
-    clickListener(window);
-  }
-}
-
-/**
- * Consumers of this class can create, set, remove, and hide a contextual tip.
- */
-class UrlbarContextualTip {
-  /**
-   * Creates the contextual tip and sets it in the urlbar's view.
-   *
-   * @param {object} view The urlbar's view
-   */
-  constructor(view) {
-    this.document = view.document;
-    this.view = view;
-    this._create();
-  }
-
-  /**
-   * Creates an empty contextual tip in the DOM.
-   */
-  _create() {
-    this._elements = {};
-
-    const fragment = this.document.createDocumentFragment();
-
-    this._elements.container = this.document.createElement("div");
-    this._elements.container.id = "urlbar-contextual-tip";
-
-    this._elements.icon = this.document.createElement("div");
-    this._elements.icon.id = "urlbar-contextual-tip-icon";
-
-    this._elements.title = this.document.createElement("div");
-    this._elements.title.id = "urlbar-contextual-tip-title";
-
-    this._elements.button = this.document.createElement("button");
-    this._elements.button.id = "urlbar-contextual-tip-button";
-
-    this._elements.link = this.document.createElement("a");
-    this._elements.link.id = "urlbar-contextual-tip-link";
-
-    this._elements.container.appendChild(this._elements.icon);
-    this._elements.container.appendChild(this._elements.title);
-    this._elements.container.appendChild(this._elements.button);
-    this._elements.container.appendChild(this._elements.link);
-
-    fragment.appendChild(this._elements.container);
-    this.view.panel.prepend(fragment);
-
-    this._elements.button.addEventListener("click", () => {
-      callClickListeners("button", this.document.ownerGlobal);
-    });
-
-    this._elements.link.addEventListener("click", () => {
-      callClickListeners("link", this.document.ownerGlobal);
-    });
-  }
-
-  /**
-   * Removes the contextual tip from the DOM.
-   */
-  remove() {
-    this._elements.container.remove();
-    this._elements = null;
-  }
-
-  /**
-   * Sets the icon, title, button's title, and link's title
-   * for the contextual tip.
-   *
-   * @param {object} details
-   * @param {string} details.title
-   *   Main title displayed by the contextual tip.
-   * @param {string} [details.buttonTitle]
-   *   Title of the button on the contextual tip.
-   *   If omitted then the button will be hidden.
-   * @param {string} [details.linkTitle]
-   *   Title of the link on the contextual tip.
-   *   If omitted then the link will be hidden.
-   * @param {string} [details.iconStyle]
-   *   A non-empty string of styles to add to the icon's style attribute.
-   *   These styles set CSS variables to URLs of images;
-   *   the CSS variables responsible for the icon's background image are
-   *   the variable names containing `--webextension-contextual-tip-icon`
-   *   in `browser/base/content/browser.css`.
-   *   If ommited, no changes are made to the icon.
-   */
-  set(details) {
-    let { iconStyle, title, buttonTitle, linkTitle } = details;
-
-    if (iconStyle) {
-      this._elements.icon.setAttribute("style", iconStyle);
-    }
-
-    this._elements.title.textContent = title;
-
-    this._elements.button.textContent = buttonTitle;
-    this._elements.button.classList.toggle("hidden", !buttonTitle);
-
-    this._elements.link.textContent = linkTitle;
-    this._elements.link.classList.toggle("hidden", !linkTitle);
-
-    // If the contextual tip is not visible, then we'll make it visible
-    this._elements.container.classList.remove("hidden");
-  }
-
-  /**
-   * Hides the contextual tip.
-   */
-  hide() {
-    if (!this._elements.container.classList.contains("hidden")) {
-      this._elements.container.classList.add("hidden");
-    }
-  }
-
-  /**
-   * Add a click listener to the specified element (either a button or link)
-   * on all windows (both existing and new windows).
-   *
-   * @param {string} element
-   *   The clickListener will be added to the specified element.
-   *   Must be either "button" or "link".
-   * @param {function} clickListener
-   *   The click listener to add to the specified element.
-   */
-  static addClickListener(element, clickListener) {
-    clickListeners.get(element).add(clickListener);
-  }
-
-  /**
-   * Remove a click listener from the specified element (either a button or
-   * link) on all windows (both existing and new windows).
-   *
-   * @param {string} element
-   *   The clickListener will be removed from the specified element.
-   *   Must be either "button" or "link".
-   * @param {function} clickListener
-   *   The click listener to remove from the specified element.
-   */
-  static removeClickListener(element, clickListener) {
-    clickListeners.get(element).delete(clickListener);
-  }
-}
--- a/browser/components/urlbar/UrlbarInput.jsm
+++ b/browser/components/urlbar/UrlbarInput.jsm
@@ -1658,17 +1658,17 @@ class UrlbarInput {
     // should not be recorded as an abandonment.
     this.controller.engagementEvent.discard();
   }
 
   _on_blur(event) {
     // We cannot count every blur events after a missed engagement as abandoment
     // because the user may have clicked on some view element that executes
     // a command causing a focus change. For example opening preferences from
-    // the oneoff settings button, or from a contextual tip button.
+    // the oneoff settings button.
     // For now we detect that case by discarding the event on command, but we
     // may want to figure out a more robust way to detect abandonment.
     this.controller.engagementEvent.record(event, {
       numChars: this._lastSearchString.length,
     });
 
     this.removeAttribute("focused");
     this.endLayoutExtend();
--- a/browser/components/urlbar/UrlbarView.jsm
+++ b/browser/components/urlbar/UrlbarView.jsm
@@ -5,17 +5,16 @@
 "use strict";
 
 var EXPORTED_SYMBOLS = ["UrlbarView"];
 
 const { XPCOMUtils } = ChromeUtils.import(
   "resource://gre/modules/XPCOMUtils.jsm"
 );
 XPCOMUtils.defineLazyModuleGetters(this, {
-  UrlbarContextualTip: "resource:///modules/UrlbarContextualTip.jsm",
   UrlbarPrefs: "resource:///modules/UrlbarPrefs.jsm",
   UrlbarTokenizer: "resource:///modules/UrlbarTokenizer.jsm",
   UrlbarUtils: "resource:///modules/UrlbarUtils.jsm",
 });
 
 // Stale rows are removed on a timer with this timeout.  Tests can override this
 // by setting UrlbarView.removeStaleRowsTimeout.
 const DEFAULT_REMOVE_STALE_ROWS_TIMEOUT = 400;
@@ -54,81 +53,16 @@ class UrlbarView {
     this._rows.addEventListener("underflow", this);
 
     this.window.gBrowser.tabContainer.addEventListener("TabSelect", this);
 
     this.controller.setView(this);
     this.controller.addQueryListener(this);
   }
 
-  /**
-   * Sets the icon, title, button's title, and link's title
-   * for the contextual tip. If a contextual tip has not
-   * been created, then it will be created.
-   *
-   * @param {object} details
-   * @param {string} details.title
-   *   Main title displayed by the contextual tip.
-   * @param {string} [details.buttonTitle]
-   *   Title of the button on the contextual tip.
-   *   If omitted then the button will be hidden.
-   * @param {string} [details.linkTitle]
-   *   Title of the link on the contextual tip.
-   *   If omitted then the link will be hidden.
-   * @param {string} [details.iconStyle]
-   *   A non-empty string of styles to add to the icon's style attribute.
-   *   These styles set CSS variables to URLs of images;
-   *   the CSS variables responsible for the icon's background image are
-   *   the variable names containing `--webextension-contextual-tip-icon`
-   *   in `browser/base/content/browser.css`.
-   *   If ommited, no changes are made to the icon.
-   */
-  setContextualTip(details) {
-    if (!this.contextualTip) {
-      this.contextualTip = new UrlbarContextualTip(this);
-    }
-    this.contextualTip.set(details);
-
-    // Disable one off search buttons from appearing if
-    // the contextual tip is the only item in the urlbar view.
-    if (this.visibleRowCount == 0) {
-      this._enableOrDisableOneOffSearches(false);
-    }
-
-    this._openPanel();
-  }
-
-  /**
-   * Hides the contextual tip.
-   */
-  hideContextualTip() {
-    if (this.contextualTip) {
-      this.contextualTip.hide();
-
-      // When the pending query has finished and there's 0 results then
-      // close the urlbar view.
-      this.input.lastQueryContextPromise.then(() => {
-        if (this.visibleRowCount == 0) {
-          this.close();
-        }
-      });
-    }
-  }
-
-  /**
-   * Removes the contextual tip from the DOM.
-   */
-  removeContextualTip() {
-    if (!this.contextualTip) {
-      return;
-    }
-    this.contextualTip.remove();
-    this.contextualTip = null;
-  }
-
   get oneOffSearchButtons() {
     if (!this._oneOffSearchButtons) {
       this._oneOffSearchButtons = new this.window.SearchOneOffs(
         this.panel.querySelector(".search-one-offs")
       );
       this._oneOffSearchButtons.addEventListener(
         "SelectedOneOffButtonChanged",
         this
@@ -421,19 +355,16 @@ class UrlbarView {
 
     if (!this.input.megabar && this.input._toolbar) {
       this.input._toolbar.removeAttribute("urlbar-exceeds-toolbar-bounds");
     }
 
     this.window.removeEventListener("resize", this);
 
     this.controller.notify(this.controller.NOTIFICATIONS.VIEW_CLOSE);
-    if (this.contextualTip) {
-      this.contextualTip.hide();
-    }
   }
 
   maybeReopen() {
     // Reopen if we have cached results and the input is focused, unless the
     // search string is empty or different. We don't restore the empty search
     // because this is supposed to restore the search status when the user
     // abandoned a search engagement, just opening the dropdown is not
     // considered a sufficient engagement.
--- a/browser/components/urlbar/moz.build
+++ b/browser/components/urlbar/moz.build
@@ -1,17 +1,16 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 with Files("**"):
     BUG_COMPONENT = ("Firefox", "Address Bar")
 
 EXTRA_JS_MODULES += [
-    'UrlbarContextualTip.jsm',
     'UrlbarController.jsm',
     'UrlbarEventBufferer.jsm',
     'UrlbarInput.jsm',
     'UrlbarMuxerUnifiedComplete.jsm',
     'UrlbarPrefs.jsm',
     'UrlbarProviderExtension.jsm',
     'UrlbarProviderOpenTabs.jsm',
     'UrlbarProviderPrivateSearch.jsm',
--- a/browser/themes/shared/urlbar-autocomplete.inc.css
+++ b/browser/themes/shared/urlbar-autocomplete.inc.css
@@ -69,59 +69,16 @@
   left: 0;
   right: 0;
   background: var(--autocomplete-popup-background);
   color: var(--autocomplete-popup-color);
   border-block: 1px solid var(--chrome-content-separator-color);
   box-shadow: 0 5px 18px rgba(0, 0, 0, .2);
 }
 
-#urlbar-contextual-tip {
-  align-items: center;
-  display: flex;
-  padding-top: 24px;
-  padding-bottom: 24px;
-  padding-inline: @urlbarViewItemInlinePadding@;
-}
-
-.urlbarView:not(.megabar) #urlbar-contextual-tip {
-  padding-inline-start: var(--item-padding-start, calc(5px + @urlbarViewFaviconOffset@));
-  padding-inline-end: var(--item-padding-end, 5px);
-}
-
-#urlbar-contextual-tip-title {
-  flex-grow: 1;
-  padding-inline-end: 75px;
-}
-
-#urlbar-contextual-tip-button {
-  height: 2.3em;
-  width: 9.15em;
-  border: none;
-  border-radius: 2px;
-  color: white;
-  background-color: var(--in-content-primary-button-background);
-}
-
-#urlbar-contextual-tip-button:hover {
-  background-color: var(--in-content-primary-button-background-hover);
-}
-
-#urlbar-contextual-tip-button:active {
-  background-color: var(--in-content-primary-button-background-active);
-}
-
-#urlbar-contextual-tip-button:-moz-focusring {
-  box-shadow: 0 0 0 1px #0a84ff inset, 0 0 0 1px #0a84ff, 0 0 0 4px rgba(10, 132, 255, 0.3);
-}
-
-#urlbar-contextual-tip-link {
-  text-align: end;
-}
-
 .urlbarView-results {
   padding-block: @urlbarViewPadding@;
   white-space: nowrap;
 }
 
 .urlbarView:not(.megabar) .urlbarView-results {
   padding-inline: @urlbarViewPadding@;
 }
@@ -281,29 +238,19 @@
 .urlbarView-tip-help:hover {
   background-color: var(--in-content-button-background-hover);
 }
 
 .urlbarView-tip-help:hover:active {
   background-color: var(--in-content-button-background-active);
 }
 
-#urlbar-contextual-tip-icon {
-  min-width: 24px;
-  height: 24px;
-  margin-inline-end: calc(@urlbarViewIconMarginEnd@);
-  background-repeat: no-repeat;
-  background-size: contain;
-  -moz-context-properties: fill, fill-opacity;
-}
-
 @media (min-resolution: 2dppx) {
   .urlbarView-type-icon,
-  .urlbarView-favicon,
-  #urlbar-contextual-tip-icon {
+  .urlbarView-favicon {
       transform: translateY(-1.5px);
   }
 }
 
 .urlbarView.megabar .urlbarView-row[type=bookmark] > .urlbarView-row-inner > .urlbarView-no-wrap > .urlbarView-type-icon {
   background-image: url(chrome://browser/skin/bookmark-12.svg);
   color: #0060df; /* Blue-60 */
   stroke: #fff;