Bug 389565 - Remove nsIExternalProtocolService::LoadUrl. r?paolo draft
authorMasatoshi Kimura <VYV03354@nifty.ne.jp>
Sun, 06 Aug 2017 11:25:42 +0900
changeset 641157 0941ebd4496dc63927234b73d0eb3ee3c848ee06
parent 641156 58c7ea51712d28382aca4cb3045a9c2909f85d03
child 641158 2cc119e5745b8c0d161642491beaf3b35a8d3f41
child 641159 a71bace942d0c7b17107146969919160e36b4422
child 641167 8bd1e47eab46189733735aa434bff30cf78530ca
push id72460
push userVYV03354@nifty.ne.jp
push dateSun, 06 Aug 2017 02:26:06 +0000
reviewerspaolo
bugs389565
milestone57.0a1
Bug 389565 - Remove nsIExternalProtocolService::LoadUrl. r?paolo MozReview-Commit-ID: lMq06cPWYB
browser/base/content/browser.js
browser/components/downloads/DownloadsCommon.jsm
toolkit/components/jsdownloads/src/DownloadIntegration.jsm
toolkit/content/contentAreaUtils.js
toolkit/content/widgets/text.xml
uriloader/exthandler/nsExternalHelperAppService.cpp
uriloader/exthandler/nsIExternalProtocolService.idl
--- a/browser/base/content/browser.js
+++ b/browser/base/content/browser.js
@@ -6769,17 +6769,17 @@ var MailIntegration = {
   // a generic method which can be used to pass arbitrary urls to the operating
   // system.
   // aURL --> a nsIURI which represents the url to launch
   _launchExternalUrl(aURL) {
     var extProtocolSvc =
        Cc["@mozilla.org/uriloader/external-protocol-service;1"]
          .getService(Ci.nsIExternalProtocolService);
     if (extProtocolSvc)
-      extProtocolSvc.loadUrl(aURL);
+      extProtocolSvc.loadURI(aURL);
   }
 };
 
 function BrowserOpenAddonsMgr(aView) {
   return new Promise(resolve => {
     let emWindow;
     let browserWindow;
 
--- a/browser/components/downloads/DownloadsCommon.jsm
+++ b/browser/components/downloads/DownloadsCommon.jsm
@@ -453,17 +453,17 @@ this.DownloadsCommon = {
       // attempt to launch the file directly.
       try {
         aFile.launch();
       } catch (ex) {
         // If launch fails, try sending it through the system's external "file:"
         // URL handler.
         Cc["@mozilla.org/uriloader/external-protocol-service;1"]
           .getService(Ci.nsIExternalProtocolService)
-          .loadUrl(NetUtil.newURI(aFile));
+          .loadURI(NetUtil.newURI(aFile));
       }
     }).catch(Cu.reportError);
   },
 
   /**
    * Show a downloaded file in the system file manager.
    *
    * @param aFile
@@ -498,17 +498,17 @@ this.DownloadsCommon = {
     }
     try {
       aDirectory.launch();
     } catch (ex) {
       // If launch fails (probably because it's not implemented), let
       // the OS handler try to open the directory.
       Cc["@mozilla.org/uriloader/external-protocol-service;1"]
         .getService(Ci.nsIExternalProtocolService)
-        .loadUrl(NetUtil.newURI(aDirectory));
+        .loadURI(NetUtil.newURI(aDirectory));
     }
   },
 
   /**
    * Displays an alert message box which asks the user if they want to
    * unblock the downloaded file or not.
    *
    * @param options
--- a/toolkit/components/jsdownloads/src/DownloadIntegration.jsm
+++ b/toolkit/components/jsdownloads/src/DownloadIntegration.jsm
@@ -660,17 +660,17 @@ this.DownloadIntegration = {
     // let's try to directly launch the file.
     try {
       this.launchFile(file);
       return;
     } catch (ex) { }
 
     // If our previous attempts failed, try sending it through
     // the system's external "file:" URL handler.
-    gExternalProtocolService.loadUrl(NetUtil.newURI(file));
+    gExternalProtocolService.loadURI(NetUtil.newURI(file));
   },
 
   /**
    * Asks for confirmation for launching the specified executable file. This
    * can be overridden by regression tests to avoid the interactive prompt.
    */
   async confirmLaunchExecutable(path) {
     // We don't anchor the prompt to a specific window intentionally, not
@@ -725,17 +725,17 @@ this.DownloadIntegration = {
     try {
       // Open the parent directory to show where the file should be.
       parent.launch();
       return;
     } catch (ex) { }
 
     // If launch also fails (probably because it's not implemented), let
     // the OS handler try to open the parent.
-    gExternalProtocolService.loadUrl(NetUtil.newURI(parent));
+    gExternalProtocolService.loadURI(NetUtil.newURI(parent));
   },
 
   /**
    * Calls the directory service, create a downloads directory and returns an
    * nsIFile for the downloads directory.
    *
    * @return {Promise}
    * @resolves The directory string path.
--- a/toolkit/content/contentAreaUtils.js
+++ b/toolkit/content/contentAreaUtils.js
@@ -1219,17 +1219,17 @@ function getCharsetforSave(aDocument) {
 function openURL(aURL) {
   var uri = makeURI(aURL);
 
   var protocolSvc = Components.classes["@mozilla.org/uriloader/external-protocol-service;1"]
                               .getService(Components.interfaces.nsIExternalProtocolService);
 
   if (!protocolSvc.isExposedProtocol(uri.scheme)) {
     // If we're not a browser, use the external protocol service to load the URI.
-    protocolSvc.loadUrl(uri);
+    protocolSvc.loadURI(uri);
   } else {
     var recentWindow = Services.wm.getMostRecentWindow("navigator:browser");
     if (recentWindow) {
       recentWindow.openUILinkIn(uri.spec, "tab");
       return;
     }
 
     var loadgroup = Components.classes["@mozilla.org/network/load-group;1"]
--- a/toolkit/content/widgets/text.xml
+++ b/toolkit/content/widgets/text.xml
@@ -330,17 +330,17 @@
 
             const cID = "@mozilla.org/uriloader/external-protocol-service;1";
             const nsIEPS = Components.interfaces.nsIExternalProtocolService;
             var protocolSvc = Components.classes[cID].getService(nsIEPS);
 
             // if the scheme is not an exposed protocol, then opening this link
             // should be deferred to the system's external protocol handler
             if (!protocolSvc.isExposedProtocol(uri.scheme)) {
-              protocolSvc.loadUrl(uri);
+              protocolSvc.loadURI(uri);
               aEvent.preventDefault()
               return;
             }
 
           } catch (ex) {
             Components.utils.reportError(ex);
           }
 
--- a/uriloader/exthandler/nsExternalHelperAppService.cpp
+++ b/uriloader/exthandler/nsExternalHelperAppService.cpp
@@ -937,21 +937,16 @@ NS_IMETHODIMP nsExternalHelperAppService
   // go through the external protocol service.  most applications override this
   // default behavior.
   *aResult =
     Preferences::GetBool("network.protocol-handler.expose-all", false);
 
   return NS_OK;
 }
 
-NS_IMETHODIMP nsExternalHelperAppService::LoadUrl(nsIURI * aURL)
-{
-  return LoadURI(aURL, nullptr);
-}
-
 static const char kExternalProtocolPrefPrefix[]  = "network.protocol-handler.external.";
 static const char kExternalProtocolDefaultPref[] = "network.protocol-handler.external-default";
 
 NS_IMETHODIMP 
 nsExternalHelperAppService::LoadURI(nsIURI *aURI,
                                     nsIInterfaceRequestor *aWindowContext)
 {
   NS_ENSURE_ARG_POINTER(aURI);
--- a/uriloader/exthandler/nsIExternalProtocolService.idl
+++ b/uriloader/exthandler/nsIExternalProtocolService.idl
@@ -84,25 +84,16 @@ interface nsIExternalProtocolService : n
    *                          OS default handler?  This is generally the
    *                          value of the aFound out param from
    *                          getProtocolHandlerInfoFromOS.
    */
   void setProtocolHandlerDefaults(in nsIHandlerInfo aHandlerInfo,
                                   in boolean aOSHandlerExists);
 
   /**
-   * Used to load a url via an external protocol handler (if one exists)
-   *
-   * @param aURL The url to load
-   *
-   * @deprecated Use LoadURI instead (See Bug 389565 for removal)
-   */
-   [deprecated] void loadUrl(in nsIURI aURL);
-
-  /**
    * Used to load a URI via an external application. Might prompt the user for
    * permission to load the external application.
    *
    * @param aURI
    *        The URI to load
    *
    * @param aWindowContext 
    *        The window to parent the dialog against, and, if a web handler