Bug 1518031 - Update "Add Search Engine" page action image when search engine icon becomes available. r=mossop
authorDrew Willcoxon <adw@mozilla.com>
Thu, 17 Jan 2019 17:29:18 +0000
changeset 454304 8dbf2f4f7c53aac4a971aa5b94bad6d0b408dc5c
parent 454303 8fb54b5db199da787fa33b344d07f1fb7ef9bf3b
child 454305 98d21b0ac30eb2dd19b0dfeae12553e36ff9bc51
push id35392
push userncsoregi@mozilla.com
push dateThu, 17 Jan 2019 21:53:28 +0000
treeherdermozilla-central@24982570fc83 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmossop
bugs1518031
milestone66.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 1518031 - Update "Add Search Engine" page action image when search engine icon becomes available. r=mossop We can just add `onLinkIconAvailable` to `TabsProgressListener` in browser.js and update the search badge. Differential Revision: https://phabricator.services.mozilla.com/D16590
browser/base/content/browser.js
--- a/browser/base/content/browser.js
+++ b/browser/base/content/browser.js
@@ -5330,16 +5330,27 @@ var TabsProgressListener = {
       gBrowser.setBrowserSharing(aBrowser, {});
     }
     webrtcUI.forgetStreamsFromBrowser(aBrowser);
 
     gBrowser.getNotificationBox(aBrowser).removeTransientNotifications();
 
     FullZoom.onLocationChange(aLocationURI, false, aBrowser);
   },
+
+  onLinkIconAvailable(browser, dataURI, iconURI) {
+    if (!iconURI) {
+      return;
+    }
+    if (browser == gBrowser.selectedBrowser) {
+      // If the "Add Search Engine" page action is in the urlbar, its image
+      // needs to be set to the new icon, so call updateOpenSearchBadge.
+      BrowserSearch.updateOpenSearchBadge();
+    }
+  },
 };
 
 function nsBrowserAccess() { }
 
 nsBrowserAccess.prototype = {
   QueryInterface: ChromeUtils.generateQI([Ci.nsIBrowserDOMWindow]),
 
   _openURIInNewTab(aURI, aReferrer, aReferrerPolicy, aIsPrivate,