<?xml version="1.0"?>
<?xml-stylesheet href="chrome://print_preview/skin/print_preview.css" type="text/css"?>
<!DOCTYPE overlay [
<!ENTITY % browserDTD SYSTEM "chrome://browser/locale/browser.dtd" >
%browserDTD;
]>
<overlay id="printpreviewoverlay" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<toolbarpalette id="BrowserToolbarPalette">
<!-- this redefines the print-button, as the overlay adds the new type and the menupopup to the existing button -->
<toolbarbutton id="print-button" type="menu-button">
<menupopup>
<!-- notice the absence of any command or oncommand, as it inherits the existing ones from the normal print button -->
<menuitem id="print-button-popup" label="&printCmd.label;" tooltiptext="&printCmd.label;" accesskey="&printCmd.accesskey;"/>
<!-- here we define our own oncommand, and more importantly we prevent the event bubbling/propagating, as otherwise cmd_print still gets executed as this is part of the button -->
<menuitem label="&printPreviewCmd.label;" tooltiptext="&printPreviewCmd.label;" oncommand="PrintUtils.printPreview(onEnterPrintPreview, onExitPrintPreview); event.stopPropagation();" accesskey="&printPreviewCmd.accesskey;"/>
<menuseparator/>
<menuitem label="&printSetupCmd.label;" tooltiptext="&printSetupCmd.label;" command="cmd_pageSetup" accesskey="&printSetupCmd.accesskey;"/>
</menupopup>
</toolbarbutton>
</toolbarpalette>
<popup id="contentAreaContextMenu">
<menu id="context-print-menu" label="&printCmd.label;" accesskey="&printCmd.accesskey;" insertafter="context-stop">
<menupopup>
<menuitem id="context-print-menu-print" label="&printCmd.label;" accesskey="&printCmd.accesskey;" command="cmd_print"/>
<menuitem id="context-print-menu-preview" label="&printPreviewCmd.label;" accesskey="&printPreviewCmd.accesskey;" oncommand="PrintUtils.printPreview(onEnterPrintPreview, onExitPrintPreview);"/>
<menuseparator/>
<menuitem id="context-print-menu-printSetup" label="&printSetupCmd.label;" command="cmd_pageSetup" accesskey="&printSetupCmd.accesskey;"/>
</menupopup>
</menu>
</popup>
</overlay>