Commit 6d2c0da0 authored by Jonathan Watt's avatar Jonathan Watt
Browse files

Bug 1766640 - Remove nsIWebBrowserPrint.cancel(). r=emilio

It seems the new tab-modal printing code doesn't actually use this. Instead it
relies on the window being closed (see cancelPrint() in
toolkit/components/printing/content/print.js ).

Differential Revision: https://phabricator.services.mozilla.com/D144821
parent 7aeb663d
Loading
Loading
Loading
Loading
+0 −6
Original line number Diff line number Diff line
@@ -3196,12 +3196,6 @@ nsDocumentViewer::GetCurrentPrintSettings(
  return NS_OK;
}

NS_IMETHODIMP
nsDocumentViewer::Cancel() {
  NS_ENSURE_TRUE(mPrintJob, NS_ERROR_FAILURE);
  return mPrintJob->Cancel();
}

NS_IMETHODIMP
nsDocumentViewer::ExitPrintPreview() {
  NS_ENSURE_TRUE(mPrintJob, NS_ERROR_FAILURE);
+0 −8
Original line number Diff line number Diff line
@@ -383,14 +383,6 @@ nsresult nsPrintJob::Initialize(nsIDocumentViewerPrint* aDocViewerPrint,
  return NS_OK;
}

//-------------------------------------------------------
nsresult nsPrintJob::Cancel() {
  if (mPrt && mPrt->mPrintSettings) {
    return mPrt->mPrintSettings->SetIsCancelled(true);
  }
  return NS_ERROR_FAILURE;
}

//-----------------------------------------------------------------
std::tuple<nsPageSequenceFrame*, int32_t>
nsPrintJob::GetSeqFrameAndCountSheets() const {
+4 −6
Original line number Diff line number Diff line
@@ -97,6 +97,8 @@ interface nsIWebBrowserPrint : nsISupports
   *                            then the global PS will be used.
   * @param aWPListener - is updated during the print
   * @return void
   *
   * @note To cancel, close the window of the document that is being printed.
   */
  [noscript] void print(in nsIPrintSettings aThePrintSettings,
                        in nsIWebProgressListener aWPListener);
@@ -108,6 +110,8 @@ interface nsIWebBrowserPrint : nsISupports
   *                            then the global PS will be used.
   * @param aWPListener - is updated during the printpreview
   * @return void
   *
   * @note To cancel, close the print preview document's window.
   */
  [noscript] void printPreview(in nsIPrintSettings aThePrintSettings,
                               in nsIWebProgressListener aWPListener,
@@ -120,12 +124,6 @@ interface nsIWebBrowserPrint : nsISupports
   */
  void printPreviewScrollToPage(in short aNavType, in long aPageNum);

  /**
   * Cancels the current print
   * @return void
   */
  void cancel();

  /**
   * This exists PrintPreview mode and returns browser window to galley mode
   * @return void