Bug 731942 - Replace old synchronous favicons calls in the Toolkit external content handler dialog. r=mak
authorPaolo Amadini <paolo.mozmail@amadzone.org>
Mon, 19 Mar 2012 20:24:41 +0100
changeset 89769 a94264d93205bdc40c647809764dfd9af11f8d16
parent 89768 7c85ad7fd3e67ceb2261f977b85e4dbfcf367f94
child 89770 063352a44541410ba76d1e6cc97bb6c6cee7cd31
push id22282
push usermlamouri@mozilla.com
push dateTue, 20 Mar 2012 10:40:32 +0000
treeherdermozilla-central@ee554888d071 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmak
bugs731942
milestone14.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 731942 - Replace old synchronous favicons calls in the Toolkit external content handler dialog. r=mak
browser/components/preferences/applications.js
toolkit/mozapps/handling/content/dialog.js
--- a/browser/components/preferences/applications.js
+++ b/browser/components/preferences/applications.js
@@ -1828,21 +1828,21 @@ var gApplicationsPane = {
 
     return "moz-icon://" + urlSpec + "?size=16";
   },
 
   _getIconURLForWebApp: function(aWebAppURITemplate) {
     var uri = this._ioSvc.newURI(aWebAppURITemplate, null, null);
 
     // Unfortunately we can't use the favicon service to get the favicon,
-    // because the service looks in the annotations table for a record with
-    // the exact URL we give it, and users won't have such records for URLs
-    // they don't visit, and users won't visit the web app's URL template,
-    // they'll only visit URLs derived from that template (i.e. with %s
-    // in the template replaced by the URL of the content being handled).
+    // because the service looks for a record with the exact URL we give it, and
+    // users won't have such records for URLs they don't visit, and users won't
+    // visit the handler's URL template, they'll only visit URLs derived from
+    // that template (i.e. with %s in the template replaced by the URL of the
+    // content being handled).
 
     if (/^https?/.test(uri.scheme) && this._prefSvc.getBoolPref("browser.chrome.favicons"))
       return uri.prePath + "/favicon.ico";
 
     return "";
   },
 
   _getIconURLForSystemDefault: function(aHandlerInfo) {
--- a/toolkit/mozapps/handling/content/dialog.js
+++ b/toolkit/mozapps/handling/content/dialog.js
@@ -142,27 +142,23 @@ var dialog = {
       if (app instanceof Ci.nsILocalHandlerApp) {
         // See if we have an nsILocalHandlerApp and set the icon
         let uri = ios.newFileURI(app.executable);
         elm.setAttribute("image", "moz-icon://" + uri.spec + "?size=32");
       }
       else if (app instanceof Ci.nsIWebHandlerApp) {
         let uri = ios.newURI(app.uriTemplate, null, null);
         if (/^https?/.test(uri.scheme)) {
-          let iconURI;
-          try {
-            iconURI = Cc["@mozilla.org/browser/favicon-service;1"].
-                      getService(Ci.nsIFaviconService).
-                      getFaviconForPage(ios.newURI(uri.prePath, null, null)).
-                      spec;
-          }
-          catch (e) {
-            iconURI = uri.prePath + "/favicon.ico";
-          }
-          elm.setAttribute("image", iconURI);
+          // Unfortunately we can't use the favicon service to get the favicon,
+          // because the service looks for a record with the exact URL we give
+          // it, and users won't have such records for URLs they don't visit,
+          // and users won't visit the handler's URL template, they'll only
+          // visit URLs derived from that template (i.e. with %s in the template
+          // replaced by the URL of the content being handled).
+          elm.setAttribute("image", uri.prePath + "/favicon.ico");
         }
         elm.setAttribute("description", uri.prePath);
       }
       else if (app instanceof Ci.nsIDBusHandlerApp){
 	  elm.setAttribute("description", app.method);  
       }
       else
         throw "unknown handler type";