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
This commit is contained in:
Jonathan Watt 2022-04-27 14:37:25 +00:00
parent 7aeb663d4a
commit 6d2c0da09b
3 changed files with 4 additions and 20 deletions

View File

@ -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);

View File

@ -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 {

View File

@ -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