Bug 1387800 - Remove [deprecated] nsIFilePicker.show(). r=qdot
authorMasatoshi Kimura <VYV03354@nifty.ne.jp>
Sun, 06 Aug 2017 13:15:31 +0900
changeset 374357 6dacffdd0ed1ea53f7e2a56d1f44e2c90b959144
parent 374356 ae888eb0e5a818f47c7714aeff2ce3402c9aeea0
child 374358 6cb26a4c377737cc905eef2cb5caf575f46c3c08
push id32320
push userarchaeopteryx@coole-files.de
push dateSat, 12 Aug 2017 21:35:10 +0000
treeherdermozilla-central@6062341662fc [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersqdot
bugs1387800
milestone57.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 1387800 - Remove [deprecated] nsIFilePicker.show(). r=qdot MozReview-Commit-ID: 81ZkeYdSPVW
security/manager/pki/resources/content/certManager.js
security/manager/pki/resources/content/pippki.js
testing/specialpowers/content/MockFilePicker.jsm
toolkit/content/aboutwebrtc/aboutWebrtc.js
toolkit/mozapps/downloads/nsHelperAppDlg.js
toolkit/profile/content/createProfileWizard.js
widget/cocoa/nsFilePicker.h
widget/cocoa/nsFilePicker.mm
widget/gtk/nsFilePicker.cpp
widget/gtk/nsFilePicker.h
widget/nsBaseFilePicker.cpp
widget/nsBaseFilePicker.h
widget/nsFilePickerProxy.cpp
widget/nsFilePickerProxy.h
widget/nsIFilePicker.idl
widget/windows/nsFilePicker.cpp
widget/windows/nsFilePicker.h
--- a/security/manager/pki/resources/content/certManager.js
+++ b/security/manager/pki/resources/content/certManager.js
@@ -394,21 +394,21 @@ function restoreCerts() {
     userTreeView.loadCertsFromCache(certcache, nsIX509Cert.USER_CERT);
     userTreeView.selection.clearSelection();
     caTreeView.loadCertsFromCache(certcache, nsIX509Cert.CA_CERT);
     caTreeView.selection.clearSelection();
     enableBackupAllButton();
   });
 }
 
-function exportCerts() {
+async function exportCerts() {
   getSelectedCerts();
 
   for (let cert of selected_certs) {
-    exportToFile(window, cert);
+    await exportToFile(window, cert);
   }
 }
 
 /**
  * Deletes the selected certs in the active tab.
  */
 function deleteCerts() {
   getSelectedTreeItems();
--- a/security/manager/pki/resources/content/pippki.js
+++ b/security/manager/pki/resources/content/pippki.js
@@ -91,93 +91,100 @@ function certToFilename(cert) {
 
   // nsIFilePicker.defaultExtension is more of a suggestion to some
   // implementations, so we include the extension in the file name as well. This
   // is what the documentation for nsIFilePicker.defaultString says we should do
   // anyways.
   return `${filename}.${DEFAULT_CERT_EXTENSION}`;
 }
 
-function exportToFile(parent, cert) {
+async function exportToFile(parent, cert) {
   var bundle = document.getElementById("pippki_bundle");
   if (!cert) {
-    return;
+    return undefined;
   }
 
   var nsIFilePicker = Components.interfaces.nsIFilePicker;
   var fp = Components.classes["@mozilla.org/filepicker;1"].
            createInstance(nsIFilePicker);
   fp.init(parent, bundle.getString("SaveCertAs"),
           nsIFilePicker.modeSave);
   fp.defaultString = certToFilename(cert);
   fp.defaultExtension = DEFAULT_CERT_EXTENSION;
   fp.appendFilter(bundle.getString("CertFormatBase64"), "*.crt; *.pem");
   fp.appendFilter(bundle.getString("CertFormatBase64Chain"), "*.crt; *.pem");
   fp.appendFilter(bundle.getString("CertFormatDER"), "*.der");
   fp.appendFilter(bundle.getString("CertFormatPKCS7"), "*.p7c");
   fp.appendFilter(bundle.getString("CertFormatPKCS7Chain"), "*.p7c");
   fp.appendFilters(nsIFilePicker.filterAll);
-  var res = fp.show();
-  if (res != nsIFilePicker.returnOK && res != nsIFilePicker.returnReplace) {
-    return;
-  }
+  return new Promise(resolve => {
+    fp.open(res => {
+      resolve(fpCallback(res));
+    });
+  });
+
+  function fpCallback(res) {
+    if (res != nsIFilePicker.returnOK && res != nsIFilePicker.returnReplace) {
+      return;
+    }
 
-  var content = "";
-  switch (fp.filterIndex) {
-    case 1:
-      content = getPEMString(cert);
-      var chain = cert.getChain();
-      for (let i = 1; i < chain.length; i++) {
-        content += getPEMString(chain.queryElementAt(i, Components.interfaces.nsIX509Cert));
-      }
-      break;
-    case 2:
-      content = getDERString(cert);
-      break;
-    case 3:
-      content = getPKCS7String(cert, Components.interfaces.nsIX509Cert.CMS_CHAIN_MODE_CertOnly);
-      break;
-    case 4:
-      content = getPKCS7String(cert, Components.interfaces.nsIX509Cert.CMS_CHAIN_MODE_CertChainWithRoot);
-      break;
-    case 0:
-    default:
-      content = getPEMString(cert);
-      break;
-  }
-  var msg;
-  var written = 0;
-  try {
-    var file = Components.classes["@mozilla.org/file/local;1"].
-               createInstance(Components.interfaces.nsIFile);
-    file.initWithPath(fp.file.path);
-    var fos = Components.classes["@mozilla.org/network/file-output-stream;1"].
-              createInstance(Components.interfaces.nsIFileOutputStream);
-    // flags: PR_WRONLY | PR_CREATE_FILE | PR_TRUNCATE
-    fos.init(file, 0x02 | 0x08 | 0x20, 0o0644, 0);
-    written = fos.write(content, content.length);
-    fos.close();
-  } catch (e) {
-    switch (e.result) {
-      case Components.results.NS_ERROR_FILE_ACCESS_DENIED:
-        msg = bundle.getString("writeFileAccessDenied");
+    var content = "";
+    switch (fp.filterIndex) {
+      case 1:
+        content = getPEMString(cert);
+        var chain = cert.getChain();
+        for (let i = 1; i < chain.length; i++) {
+          content += getPEMString(chain.queryElementAt(i, Components.interfaces.nsIX509Cert));
+        }
         break;
-      case Components.results.NS_ERROR_FILE_IS_LOCKED:
-        msg = bundle.getString("writeFileIsLocked");
+      case 2:
+        content = getDERString(cert);
+        break;
+      case 3:
+        content = getPKCS7String(cert, Components.interfaces.nsIX509Cert.CMS_CHAIN_MODE_CertOnly);
         break;
-      case Components.results.NS_ERROR_FILE_NO_DEVICE_SPACE:
-      case Components.results.NS_ERROR_FILE_DISK_FULL:
-        msg = bundle.getString("writeFileNoDeviceSpace");
+      case 4:
+        content = getPKCS7String(cert, Components.interfaces.nsIX509Cert.CMS_CHAIN_MODE_CertChainWithRoot);
         break;
+      case 0:
       default:
-        msg = e.message;
+        content = getPEMString(cert);
         break;
     }
-  }
-  if (written != content.length) {
-    if (msg.length == 0) {
-      msg = bundle.getString("writeFileUnknownError");
+    var msg;
+    var written = 0;
+    try {
+      var file = Components.classes["@mozilla.org/file/local;1"].
+                 createInstance(Components.interfaces.nsIFile);
+      file.initWithPath(fp.file.path);
+      var fos = Components.classes["@mozilla.org/network/file-output-stream;1"].
+                createInstance(Components.interfaces.nsIFileOutputStream);
+      // flags: PR_WRONLY | PR_CREATE_FILE | PR_TRUNCATE
+      fos.init(file, 0x02 | 0x08 | 0x20, 0o0644, 0);
+      written = fos.write(content, content.length);
+      fos.close();
+    } catch (e) {
+      switch (e.result) {
+        case Components.results.NS_ERROR_FILE_ACCESS_DENIED:
+          msg = bundle.getString("writeFileAccessDenied");
+          break;
+        case Components.results.NS_ERROR_FILE_IS_LOCKED:
+          msg = bundle.getString("writeFileIsLocked");
+          break;
+        case Components.results.NS_ERROR_FILE_NO_DEVICE_SPACE:
+        case Components.results.NS_ERROR_FILE_DISK_FULL:
+          msg = bundle.getString("writeFileNoDeviceSpace");
+          break;
+        default:
+          msg = e.message;
+          break;
+      }
     }
-    alertPromptService(bundle.getString("writeFileFailure"),
-                       bundle.getFormattedString("writeFileFailed",
-                       [fp.file.path, msg]));
+    if (written != content.length) {
+      if (msg.length == 0) {
+        msg = bundle.getString("writeFileUnknownError");
+      }
+      alertPromptService(bundle.getString("writeFileFailure"),
+                         bundle.getFormattedString("writeFileFailed",
+                         [fp.file.path, msg]));
+    }
   }
 }
--- a/testing/specialpowers/content/MockFilePicker.jsm
+++ b/testing/specialpowers/content/MockFilePicker.jsm
@@ -246,19 +246,16 @@ MockFilePickerInstance.prototype = {
         if (MockFilePicker.returnData[this.index].domDirectory) {
           return MockFilePicker.returnData[this.index++].domDirectory;
         }
 
         return null;
       }
     };
   },
-  show() {
-    throw "This is not implemented";
-  },
   open(aFilePickerShownCallback) {
     MockFilePicker.showing = true;
     this.window.setTimeout(() => {
       // Maybe all the pending promises are already resolved, but we want to be sure.
       Promise.all(MockFilePicker.pendingPromises).then(() => {
         return Ci.nsIFilePicker.returnOK;
       }, () => {
         return Ci.nsIFilePicker.returnCancel;
--- a/toolkit/content/aboutwebrtc/aboutWebrtc.js
+++ b/toolkit/content/aboutwebrtc/aboutWebrtc.js
@@ -167,39 +167,39 @@ SavePage.prototype.onClick = function() 
   let content = document.querySelector("#content");
 
   if (!content)
     return;
 
   FoldEffect.expandAll();
   FilePicker.init(window, getString("save_page_dialog_title"), FilePicker.modeSave);
   FilePicker.defaultString = LOGFILE_NAME_DEFAULT;
-  let rv = FilePicker.show();
-
-  if (rv == FilePicker.returnOK || rv == FilePicker.returnReplace) {
-    let fout = FileUtils.openAtomicFileOutputStream(
-      FilePicker.file, FileUtils.MODE_WRONLY | FileUtils.MODE_CREATE);
+  FilePicker.open(rv => {
+    if (rv == FilePicker.returnOK || rv == FilePicker.returnReplace) {
+      let fout = FileUtils.openAtomicFileOutputStream(
+        FilePicker.file, FileUtils.MODE_WRONLY | FileUtils.MODE_CREATE);
 
-    let nodes = content.querySelectorAll(".no-print");
-    let noPrintList = [];
-    for (let node of nodes) {
-      noPrintList.push(node);
-      node.style.setProperty("display", "none");
+      let nodes = content.querySelectorAll(".no-print");
+      let noPrintList = [];
+      for (let node of nodes) {
+        noPrintList.push(node);
+        node.style.setProperty("display", "none");
+      }
+
+      fout.write(content.outerHTML, content.outerHTML.length);
+      FileUtils.closeAtomicFileOutputStream(fout);
+
+      for (let node of noPrintList) {
+        node.style.removeProperty("display");
+      }
+
+      this._message = formatString("save_page_msg", [FilePicker.file.path], 1);
+      this.update();
     }
-
-    fout.write(content.outerHTML, content.outerHTML.length);
-    FileUtils.closeAtomicFileOutputStream(fout);
-
-    for (let node of noPrintList) {
-      node.style.removeProperty("display");
-    }
-
-    this._message = formatString("save_page_msg", [FilePicker.file.path], 1);
-    this.update();
-  }
+  });
 };
 
 function DebugMode() {
   Control.call(this);
   this._messageHeader = getString("debug_mode_msg_label");
 
   if (WebrtcGlobalInformation.debugLevel > 0) {
     this.onState();
--- a/toolkit/mozapps/downloads/nsHelperAppDlg.js
+++ b/toolkit/mozapps/downloads/nsHelperAppDlg.js
@@ -1091,24 +1091,29 @@ nsUnknownContentTypeDialog.prototype = {
       var fp = Components.classes["@mozilla.org/filepicker;1"]
                          .createInstance(nsIFilePicker);
       fp.init(this.mDialog,
               this.dialogElement("strings").getString("chooseAppFilePickerTitle"),
               nsIFilePicker.modeOpen);
 
       fp.appendFilters(nsIFilePicker.filterApps);
 
-      if (fp.show() == nsIFilePicker.returnOK && fp.file) {
-        // Remember the file they chose to run.
-        var localHandlerApp =
-          Components.classes["@mozilla.org/uriloader/local-handler-app;1"].
-                     createInstance(Components.interfaces.nsILocalHandlerApp);
-        localHandlerApp.executable = fp.file;
-        this.chosenApp = localHandlerApp;
-      }
+      fp.open(aResult => {
+        if (aResult == nsIFilePicker.returnOK && fp.file) {
+          // Remember the file they chose to run.
+          var localHandlerApp =
+            Components.classes["@mozilla.org/uriloader/local-handler-app;1"].
+                       createInstance(Components.interfaces.nsILocalHandlerApp);
+          localHandlerApp.executable = fp.file;
+          this.chosenApp = localHandlerApp;
+        }
+        this.finishChooseApp();
+      });
+      // The finishChooseApp is called from fp.open() callback
+      return;
     }
 
     this.finishChooseApp();
   },
 
   // Turn this on to get debugging messages.
   debug: false,
 
--- a/toolkit/profile/content/createProfileWizard.js
+++ b/toolkit/profile/content/createProfileWizard.js
@@ -81,26 +81,27 @@ function chooseProfileFolder() {
   var dirChooser = C["@mozilla.org/filepicker;1"].createInstance(I.nsIFilePicker);
   dirChooser.init(window, gProfileManagerBundle.getString("chooseFolder"),
                   I.nsIFilePicker.modeGetFolder);
   dirChooser.appendFilters(I.nsIFilePicker.filterAll);
 
   // default to the Profiles folder
   dirChooser.displayDirectory = gDefaultProfileParent;
 
-  dirChooser.show();
-  newProfileRoot = dirChooser.file;
+  dirChooser.open(() => {
+    newProfileRoot = dirChooser.file;
 
-  // Disable the "Default Folder..." button when the default profile folder
-  // was selected manually in the File Picker.
-  document.getElementById("useDefault").disabled =
-    (newProfileRoot.parent.equals(gDefaultProfileParent));
+    // Disable the "Default Folder..." button when the default profile folder
+    // was selected manually in the File Picker.
+    document.getElementById("useDefault").disabled =
+      (newProfileRoot.parent.equals(gDefaultProfileParent));
 
-  gProfileRoot = newProfileRoot;
-  updateProfileDisplay();
+    gProfileRoot = newProfileRoot;
+    updateProfileDisplay();
+  });
 }
 
 // Checks the current user input for validity and triggers an error message accordingly.
 function checkCurrentInput(currentInput) {
   var finishButton = document.documentElement.getButton("finish");
   var finishText = document.getElementById("finishText");
   var canAdvance;
 
--- a/widget/cocoa/nsFilePicker.h
+++ b/widget/cocoa/nsFilePicker.h
@@ -29,30 +29,30 @@ public:
   NS_IMETHOD SetDefaultString(const nsAString& aDefaultString) override;
   NS_IMETHOD GetDefaultExtension(nsAString& aDefaultExtension) override;
   NS_IMETHOD GetFilterIndex(int32_t *aFilterIndex) override;
   NS_IMETHOD SetFilterIndex(int32_t aFilterIndex) override;
   NS_IMETHOD SetDefaultExtension(const nsAString& aDefaultExtension) override;
   NS_IMETHOD GetFile(nsIFile * *aFile) override;
   NS_IMETHOD GetFileURL(nsIURI * *aFileURL) override;
   NS_IMETHOD GetFiles(nsISimpleEnumerator **aFiles) override;
-  NS_IMETHOD Show(int16_t *_retval) override; 
   NS_IMETHOD AppendFilter(const nsAString& aTitle, const nsAString& aFilter) override;
 
   /**
    * Returns the current filter list in the format used by Cocoa's NSSavePanel
    * and NSOpenPanel.
    * Returns nil if no filter currently apply.
    */
   NSArray* GetFilterList();
 
 protected:
   virtual ~nsFilePicker();
 
   virtual void InitNative(nsIWidget *aParent, const nsAString& aTitle) override;
+  nsresult Show(int16_t *_retval) override;
 
   // actual implementations of get/put dialogs using NSOpenPanel & NSSavePanel
   // aFile is an existing but unspecified file. These functions must specify it.
   //
   // will return |returnCancel| or |returnOK| as result.
   int16_t GetLocalFiles(const nsString& inTitle, bool inAllowMultiple, nsCOMArray<nsIFile>& outFiles);
   int16_t GetLocalFolder(const nsString& inTitle, nsIFile** outFile);
   int16_t PutLocalFile(const nsString& inTitle, const nsString& inDefaultName, nsIFile** outFile);
--- a/widget/cocoa/nsFilePicker.mm
+++ b/widget/cocoa/nsFilePicker.mm
@@ -184,17 +184,17 @@ NSView* nsFilePicker::GetAccessoryView()
   [accessoryView addSubview:textField];
   [accessoryView addSubview:popupButton];
   return accessoryView;
 
   NS_OBJC_END_TRY_ABORT_BLOCK_NIL;
 }
 
 // Display the file dialog
-NS_IMETHODIMP nsFilePicker::Show(int16_t *retval)
+nsresult nsFilePicker::Show(int16_t *retval)
 {
   NS_ENSURE_ARG_POINTER(retval);
 
   *retval = returnCancel;
 
   int16_t userClicksOK = returnCancel;
 
 // Random questions from DHH:
--- a/widget/gtk/nsFilePicker.cpp
+++ b/widget/gtk/nsFilePicker.cpp
@@ -347,17 +347,17 @@ nsFilePicker::GetFiles(nsISimpleEnumerat
 
   if (mMode == nsIFilePicker::modeOpenMultiple) {
     return NS_NewArrayEnumerator(aFiles, mFiles);
   }
 
   return NS_ERROR_FAILURE;
 }
 
-NS_IMETHODIMP
+nsresult
 nsFilePicker::Show(int16_t *aReturn)
 {
   NS_ENSURE_ARG_POINTER(aReturn);
 
   nsresult rv = Open(nullptr);
   if (NS_FAILED(rv))
     return rv;
 
--- a/widget/gtk/nsFilePicker.h
+++ b/widget/gtk/nsFilePicker.h
@@ -32,27 +32,27 @@ public:
   NS_IMETHOD GetDefaultString(nsAString& aString) override;
   NS_IMETHOD SetDefaultExtension(const nsAString& aExtension) override;
   NS_IMETHOD GetDefaultExtension(nsAString& aExtension) override;
   NS_IMETHOD GetFilterIndex(int32_t *aFilterIndex) override;
   NS_IMETHOD SetFilterIndex(int32_t aFilterIndex) override;
   NS_IMETHOD GetFile(nsIFile **aFile) override;
   NS_IMETHOD GetFileURL(nsIURI **aFileURL) override;
   NS_IMETHOD GetFiles(nsISimpleEnumerator **aFiles) override;
-  NS_IMETHOD Show(int16_t *aReturn) override;
 
   // nsBaseFilePicker
   virtual void InitNative(nsIWidget *aParent,
                           const nsAString& aTitle) override;
 
   static void Shutdown();
 
 protected:
   virtual ~nsFilePicker();
 
+  nsresult Show(int16_t *aReturn) override;
   void ReadValuesFromFileChooser(GtkWidget *file_chooser);
 
   static void OnResponse(GtkWidget* dialog, gint response_id,
                          gpointer user_data);
   static void OnDestroy(GtkWidget* dialog, gpointer user_data);
   void Done(GtkWidget* dialog, gint response_id);
 
   nsCOMPtr<nsIWidget>    mParentWidget;
--- a/widget/nsBaseFilePicker.cpp
+++ b/widget/nsBaseFilePicker.cpp
@@ -59,20 +59,20 @@ LocalFileToDirectoryOrBlob(nsPIDOMWindow
 }
 
 } // anonymous namespace
 
 /**
  * A runnable to dispatch from the main thread to the main thread to display
  * the file picker while letting the showAsync method return right away.
 */
-class AsyncShowFilePicker : public mozilla::Runnable
+class nsBaseFilePicker::AsyncShowFilePicker : public mozilla::Runnable
 {
 public:
-  AsyncShowFilePicker(nsIFilePicker* aFilePicker,
+  AsyncShowFilePicker(nsBaseFilePicker* aFilePicker,
                       nsIFilePickerShownCallback* aCallback)
     : mozilla::Runnable("AsyncShowFilePicker")
     , mFilePicker(aFilePicker)
     , mCallback(aCallback)
   {
   }
 
   NS_IMETHOD Run() override
@@ -91,17 +91,17 @@ public:
 
     if (mCallback) {
       mCallback->Done(result);
     }
     return NS_OK;
   }
 
 private:
-  RefPtr<nsIFilePicker> mFilePicker;
+  RefPtr<nsBaseFilePicker> mFilePicker;
   RefPtr<nsIFilePickerShownCallback> mCallback;
 };
 
 class nsBaseFilePickerEnumerator : public nsISimpleEnumerator
 {
 public:
   NS_DECL_ISUPPORTS
 
--- a/widget/nsBaseFilePicker.h
+++ b/widget/nsBaseFilePicker.h
@@ -14,16 +14,17 @@
 #include "nsCOMPtr.h"
 #include "nsString.h"
 
 class nsPIDOMWindowOuter;
 class nsIWidget;
 
 class nsBaseFilePicker : public nsIFilePicker
 {
+  class AsyncShowFilePicker;
 public:
   nsBaseFilePicker(); 
   virtual ~nsBaseFilePicker();
 
   NS_IMETHOD Init(mozIDOMWindowProxy* aParent,
                   const nsAString& aTitle,
                   int16_t aMode);
 
@@ -43,16 +44,17 @@ public:
   NS_IMETHOD GetOkButtonLabel(nsAString& aLabel);
 
   NS_IMETHOD GetDomFileOrDirectory(nsISupports** aValue);
   NS_IMETHOD GetDomFileOrDirectoryEnumerator(nsISimpleEnumerator** aValue);
 
 protected:
 
   virtual void InitNative(nsIWidget *aParent, const nsAString& aTitle) = 0;
+  virtual nsresult Show(int16_t *_retval) = 0;
 
   bool mAddToRecentDocs;
   nsCOMPtr<nsIFile> mDisplayDirectory;
   nsString mDisplaySpecialDirectory;
 
   nsCOMPtr<nsPIDOMWindowOuter> mParent;
   int16_t mMode;
   nsString mOkButtonLabel;
--- a/widget/nsFilePickerProxy.cpp
+++ b/widget/nsFilePickerProxy.cpp
@@ -117,17 +117,17 @@ nsFilePickerProxy::GetFileURL(nsIURI** a
 
 NS_IMETHODIMP
 nsFilePickerProxy::GetFiles(nsISimpleEnumerator** aFiles)
 {
   MOZ_ASSERT(false, "GetFiles is unimplemented; use GetDomFileOrDirectoryEnumerator");
   return NS_ERROR_FAILURE;
 }
 
-NS_IMETHODIMP
+nsresult
 nsFilePickerProxy::Show(int16_t* aReturn)
 {
   MOZ_ASSERT(false, "Show is unimplemented; use Open");
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP
 nsFilePickerProxy::Open(nsIFilePickerShownCallback* aCallback)
--- a/widget/nsFilePickerProxy.h
+++ b/widget/nsFilePickerProxy.h
@@ -44,26 +44,26 @@ public:
     NS_IMETHOD SetFilterIndex(int32_t aFilterIndex) override;
     NS_IMETHOD GetFile(nsIFile** aFile) override;
     NS_IMETHOD GetFileURL(nsIURI** aFileURL) override;
     NS_IMETHOD GetFiles(nsISimpleEnumerator** aFiles) override;
 
     NS_IMETHOD GetDomFileOrDirectory(nsISupports** aValue) override;
     NS_IMETHOD GetDomFileOrDirectoryEnumerator(nsISimpleEnumerator** aValue) override;
 
-    NS_IMETHOD Show(int16_t* aReturn) override;
     NS_IMETHOD Open(nsIFilePickerShownCallback* aCallback) override;
 
     // PFilePickerChild
     virtual mozilla::ipc::IPCResult
     Recv__delete__(const MaybeInputData& aData, const int16_t& aResult) override;
 
 private:
     ~nsFilePickerProxy();
     void InitNative(nsIWidget*, const nsAString&) override;
+    nsresult Show(int16_t* aReturn) override;
 
     void
     ActorDestroy(ActorDestroyReason aWhy) override;
 
     nsTArray<mozilla::dom::OwningFileOrDirectory> mFilesOrDirectories;
     nsCOMPtr<nsIFilePickerShownCallback> mCallback;
 
     int16_t   mSelectedType;
--- a/widget/nsIFilePicker.idl
+++ b/widget/nsIFilePicker.idl
@@ -173,27 +173,16 @@ interface nsIFilePicker : nsISupports
   * Controls whether the chosen file(s) should be added to the system's recent
   * documents list. This attribute will be ignored if the system has no "Recent
   * Docs" concept, or if the application is in private browsing mode (in which
   * case the file will not be added). Defaults to true.
   */
   attribute boolean addToRecentDocs;
 
  /**
-  * This method is **deprecated**. Please use open()
-  *
-  * Show File Dialog. The dialog is displayed modally.
-  *
-  * @return returnOK if the user selects OK, returnCancel if the user selects cancel
-  *
-  */
-  [deprecated] short show();
-
-
- /**
   * Opens the file dialog asynchrounously.
   * The passed in object's done method will be called upon completion.
   */
   void open(in nsIFilePickerShownCallback aFilePickerShownCallback);
 
  /**
   * The picker's mode, as set by the 'mode' argument passed to init()
   * (one of the modeOpen et. al. constants specified above).
--- a/widget/windows/nsFilePicker.cpp
+++ b/widget/windows/nsFilePicker.cpp
@@ -586,17 +586,17 @@ nsFilePicker::ShowFilePicker(const nsStr
     }
   }
   return true;
 }
 
 ///////////////////////////////////////////////////////////////////////////////
 // nsIFilePicker impl.
 
-NS_IMETHODIMP
+nsresult
 nsFilePicker::ShowW(int16_t *aReturnVal)
 {
   NS_ENSURE_ARG_POINTER(aReturnVal);
 
   *aReturnVal = returnCancel;
 
   AutoSuppressEvents supress(mParentWidget);
 
@@ -642,17 +642,17 @@ nsFilePicker::ShowW(int16_t *aReturnVal)
       retValue = returnReplace;
     }
   }
 
   *aReturnVal = retValue;
   return NS_OK;
 }
 
-NS_IMETHODIMP
+nsresult
 nsFilePicker::Show(int16_t *aReturnVal)
 {
   return ShowW(aReturnVal);
 }
 
 NS_IMETHODIMP
 nsFilePicker::GetFile(nsIFile **aFile)
 {
--- a/widget/windows/nsFilePicker.h
+++ b/widget/windows/nsFilePicker.h
@@ -57,33 +57,33 @@ public:
   STDMETHODIMP QueryInterface(REFIID refiid, void** ppvResult);
 
   // nsIFilePicker (less what's in nsBaseFilePicker and nsBaseWinFilePicker)
   NS_IMETHOD GetFilterIndex(int32_t *aFilterIndex);
   NS_IMETHOD SetFilterIndex(int32_t aFilterIndex);
   NS_IMETHOD GetFile(nsIFile * *aFile);
   NS_IMETHOD GetFileURL(nsIURI * *aFileURL);
   NS_IMETHOD GetFiles(nsISimpleEnumerator **aFiles);
-  NS_IMETHOD Show(int16_t *aReturnVal);
-  NS_IMETHOD ShowW(int16_t *aReturnVal);
   NS_IMETHOD AppendFilter(const nsAString& aTitle, const nsAString& aFilter);
 
   // IFileDialogEvents
   HRESULT STDMETHODCALLTYPE OnFileOk(IFileDialog *pfd);
   HRESULT STDMETHODCALLTYPE OnFolderChanging(IFileDialog *pfd, IShellItem *psiFolder);
   HRESULT STDMETHODCALLTYPE OnFolderChange(IFileDialog *pfd);
   HRESULT STDMETHODCALLTYPE OnSelectionChange(IFileDialog *pfd);
   HRESULT STDMETHODCALLTYPE OnShareViolation(IFileDialog *pfd, IShellItem *psi, FDE_SHAREVIOLATION_RESPONSE *pResponse);
   HRESULT STDMETHODCALLTYPE OnTypeChange(IFileDialog *pfd);
   HRESULT STDMETHODCALLTYPE OnOverwrite(IFileDialog *pfd, IShellItem *psi, FDE_OVERWRITE_RESPONSE *pResponse);
 
 protected:
   /* method from nsBaseFilePicker */
   virtual void InitNative(nsIWidget *aParent,
-                          const nsAString& aTitle);
+                          const nsAString& aTitle) override;
+  nsresult Show(int16_t *aReturnVal) override;
+  nsresult ShowW(int16_t *aReturnVal);
   void GetFilterListArray(nsString& aFilterList);
   bool ShowFolderPicker(const nsString& aInitialDir);
   bool ShowFilePicker(const nsString& aInitialDir);
   void RememberLastUsedDirectory();
   bool IsPrivacyModeEnabled();
   bool IsDefaultPathLink();
   bool IsDefaultPathHtml();
   void SetDialogHandle(HWND aWnd);