Backed out changeset 4a07d8bd97c8 (bug 1162372) for causing bug 1189957.
authorRyan VanderMeulen <ryanvm@gmail.com>
Tue, 04 Aug 2015 08:20:29 -0400
changeset 291364 073a16641001062097927ddef4893228e752c89b
parent 291363 692d9f3fe5a8183cc45282d772c41fc593e63fe7
child 291365 9a114caf7a2932f25b5a854818bf7907d86fbbc4
push id5246
push usermozilla@noorenberghe.ca
push dateWed, 09 Sep 2015 21:17:14 +0000
bugs1162372, 1189957
milestone40.0
backs out4a07d8bd97c8bf7dc0681534ca39a045197e8837
Backed out changeset 4a07d8bd97c8 (bug 1162372) for causing bug 1189957.
mobile/android/components/ContentDispatchChooser.js
--- a/mobile/android/components/ContentDispatchChooser.js
+++ b/mobile/android/components/ContentDispatchChooser.js
@@ -45,18 +45,32 @@ ContentDispatchChooser.prototype =
     aHandler = this.protoSvc.getProtocolHandlerInfoFromOS(aURI.spec, {});
 
     // The first handler in the set is the Android Application Chooser (which will fall back to a default if one is set)
     // If we have more than one option, let the OS handle showing a list (if needed).
     if (aHandler.possibleApplicationHandlers.length > 1) {
       aHandler.launchWithURI(aURI, aWindowContext);
     } else {
       let win = this._getChromeWin();
-      if (win && win.BrowserApp) {
-        const UNKNOWN_PROTOCOL_URI_PREFIX = "about:neterror?e=unknownProtocolFound&u=";
-        let errorUri = UNKNOWN_PROTOCOL_URI_PREFIX + aURI.spec; // TODO: Is this encoded? Does it need to be?
-        win.BrowserApp.selectedTab.browser.loadURI(errorUri, null, null);
+      if (win && win.NativeWindow) {
+        let bundle = Services.strings.createBundle("chrome://browser/locale/handling.properties");
+        let failedText = bundle.GetStringFromName("protocol.failed");
+        let searchText = bundle.GetStringFromName("protocol.toast.search");
+
+        win.NativeWindow.toast.show(failedText, "long", {
+          button: {
+            label: searchText,
+            callback: function() {
+              let message = {
+                type: "Intent:Open",
+                url: "market://search?q=" + aURI.scheme,
+              };
+
+              Messaging.sendRequest(message);
+            }
+          }
+        });
       }
     }
   },
 };
 
 this.NSGetFactory = XPCOMUtils.generateNSGetFactory([ContentDispatchChooser]);