mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-01-24 21:58:06 +00:00
Disable XUL progress dialog and fix print progress listener. b=168510 r=rods@netscape.com sr=rpotts@netscape.com
This commit is contained in:
parent
6a8aae7f71
commit
494355d131
@ -1489,9 +1489,12 @@ HRESULT CMozillaBrowser::PrintDocument(BOOL promptUser)
|
||||
printSettings->SetPrintSilent(promptUser ? PR_FALSE : PR_TRUE);
|
||||
}
|
||||
|
||||
// Disable print progress dialog (XUL)
|
||||
mPrefs->SetBoolPref("print.show_print_progress", PR_FALSE);
|
||||
|
||||
PrintListener *listener = new PrintListener;
|
||||
nsCOMPtr<nsIWebProgressListener> printListener = do_QueryInterface(listener);
|
||||
browserAsPrint->Print(printSettings, nsnull);
|
||||
browserAsPrint->Print(printSettings, printListener);
|
||||
listener->WaitForComplete();
|
||||
|
||||
if (printSettings)
|
||||
@ -3341,7 +3344,9 @@ void PrintListener::WaitForComplete()
|
||||
/* void onStateChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in unsigned long aStateFlags, in nsresult aStatus); */
|
||||
NS_IMETHODIMP PrintListener::OnStateChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, PRUint32 aStateFlags, nsresult aStatus)
|
||||
{
|
||||
if (aStatus == nsIWebProgressListener::STATE_STOP) {
|
||||
if (aStateFlags & nsIWebProgressListener::STATE_STOP &&
|
||||
aStateFlags & nsIWebProgressListener::STATE_IS_DOCUMENT)
|
||||
{
|
||||
mComplete = PR_TRUE;
|
||||
}
|
||||
return NS_OK;
|
||||
|
Loading…
x
Reference in New Issue
Block a user