<?xml version="1.0"?> 
<!-- See license.txt for terms of usage -->

<?xml-stylesheet href="chrome://firebug/skin/cookies/cookies.css"?>
<?xml-stylesheet href="chrome://firebug/content/cookies/cookies.css"?>

<overlay xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">

    <commandset id="mainCommandSet">
        <command id="cmd_firebug_cookieRemoveAll" oncommand="Firebug.CookieModule.onRemoveAll(Firebug.currentContext)"/>
        <command id="cmd_firebug_cookieRemoveAllSession" oncommand="Firebug.CookieModule.onRemoveAllSession(Firebug.currentContext)"/>
        <command id="cmd_firebug_cookieCreate" oncommand="Firebug.CookieModule.onCreateCookie(Firebug.currentContext)"/>
        <command id="cmd_firebug_cookieViewAll" oncommand="Firebug.CookieModule.onViewAll(Firebug.currentContext)"/>
        <command id="cmd_firebug_cookieViewExceptions" oncommand="Firebug.CookieModule.onViewExceptions(Firebug.currentContext)"/>
        <command id="cmd_firebug_cookieFilterByPath" oncommand="Firebug.CookieModule.onFilter(Firebug.currentContext, 'cookies.filterByPath')"/>
        <command id="cmd_firebug_cookieShowRejectedCookies" oncommand="Firebug.CookieModule.onFilter(Firebug.currentContext, 'cookies.showRejectedCookies')"/>
        <command id="cmd_firebug_cookieExportAll" oncommand="Firebug.CookieModule.onExportAll(Firebug.currentContext)"/>
        <command id="cmd_firebug_cookieExportForSite" oncommand="Firebug.CookieModule.onExportForSite(Firebug.currentContext)"/>
    </commandset>

    <keyset id="mainKeyset">
        <key id="key_firebug_removeAllCookies" key="o" modifiers="control,shift" command="cmd_firebug_cookieRemoveAll" class="fbOnlyKey"/>
    </keyset>

    <!-- Firebug toolbar -->
    <toolbar id="fbToolbar" align="center">
        <hbox id="fbToolbarInner" insertbefore="fbDetachButton" flex="1" align="center">

            <!-- Console toolbar -->
            <hbox id="fbConsoleButtons">
                <toolbarbutton
                    id="fbConsoleFilter-cookies"
                    type="checkbox"
                    label="cookies.console.Cookies"
                    class="toolbar-text-button fbConsoleFilter fbInternational"
                    tooltiptext="cookies.console.Filter By Cookies"
                    oncommand="Firebug.Console.onToggleFilter(event, Firebug.currentContext, 'cookies')"/>
            </hbox>

            <!-- Cookies toolbar -->
            <hbox id="fbCookieButtons" insertafter="fbNetButtons" collapsed="true">

                <!-- The BON button is displayed as the first one without a separator. -->
                <toolbarseparator class="fbPanelSpecificButtonsSeparator"/>

                <!-- General cookies actions -->
                <toolbarbutton id="fcCookiesMenu" label="cookies.menu.Cookies" type="menu"
                    class="fbInternational">
                    <menupopup id="fcCookiesMenuPopup">

                        <!-- Create cookies -->
                        <tooltip id="fcCreateCookieTooltip"
                            onpopupshowing="return Firebug.CookieModule.onCreateCookieShowTooltip(this, Firebug.currentContext)"/>
                        <menuitem id="fcCreate" class="fbInternational"
                            label="cookies.Create"
                            tooltip="fcCreateCookieTooltip" command="cmd_firebug_cookieCreate"/>
                        <menuseparator/>

                        <!-- Remove all cookies -->
                        <tooltip id="fcRemoveAllTooltip"
                            onpopupshowing="return Firebug.CookieModule.onRemoveAllShowTooltip(this, Firebug.currentContext)"/>
                        <menuitem id="fcRemoveAll" class="fbInternational"
                            label="cookies.RemoveAll"
                            key="key_firebug_removeAllCookies"
                            tooltip="fcRemoveAllTooltip" command="cmd_firebug_cookieRemoveAll"/>

                        <!-- Remove all session cookies -->
                        <tooltip id="fcRemoveAllSessionTooltip"
                            onpopupshowing="return Firebug.CookieModule.onRemoveAllSessionShowTooltip(this, Firebug.currentContext)"/>
                        <menuitem id="fcRemoveAllSession" class="fbInternational"
                            label="cookies.Remove Session Cookies"
                            tooltip="fcRemoveAllSessionTooltip" command="cmd_firebug_cookieRemoveAllSession"/>
                        <menuseparator/>

                        <!-- Export cookies xxxHonza: remove this for now and wait for user feedback
                        <menuitem id="fcExportAll" class="fbInternational"
                            label="cookies.export.Export All Cookies"
                            tooltiptext="cookies.export.Export All Cookies Tooltip"
                            command="cmd_firebug_cookieExportAll"/> -->
                        <tooltip id="fcExportForSiteTooltip"
                            onpopupshowing="return Firebug.CookieModule.onExportForSiteShowTooltip(this, Firebug.currentContext)"/>
                        <menuitem id="fcExportForSite" class="fbInternational"
                            label="cookies.export.Export For Site"
                            tooltip="fcExportForSiteTooltip" command="cmd_firebug_cookieExportForSite"/>
                    </menupopup>
                </toolbarbutton>

                <!-- Filter cookies -->
                <toolbarbutton id="fcFilterMenu" type="menu" class="fbInternational"
                    label="cookies.Filter"
                    tooltiptext="cookies.FilterTooltip">
                    <menupopup id="fcFilterMenuPopup"
                            onpopupshowing="return Firebug.CookieModule.onFilterPopupShowing(this)">
                        <menuitem id="fcFilterByPath" type="checkbox" class="fbInternational"
                            value="cookies.filterByPath"
                            label="cookies.filter.byPath"
                            tooltiptext="cookies.filter.byPathTooltip"
                            command="cmd_firebug_cookieFilterByPath"/>
                        <menuitem id="fcShowRejectedCookies" type="checkbox"
                            class="fbInternational"
                            value="cookies.showRejectedCookies"
                            label="cookies.filter.showRejectedCookies"
                            tooltiptext="cookies.filter.showRejectedCookiesTooltip"
                            command="cmd_firebug_cookieShowRejectedCookies"/>
                        <!--<menuseparator/>
                        <menu id="fcCustomPathFilter" label="cookies.Path Filter">
                            <menupopup id="fcCustomPathFilterPanel" ignorekeys="true"
                                onpopupshowing="return Firebug.CookieModule.onFilterPanelShowing(this, Firebug.currentContext)"
                                onpopuphiding="return Firebug.CookieModule.onFilterPanelHiding(this, Firebug.currentContext)"
                                onapply="Firebug.CookieModule.onFilterPanelApply(Firebug.currentContext)"/>
                        </menu>-->
                    </menupopup>
                </toolbarbutton>
                <toolbarseparator/>

                <!-- Cookie permissions -->
                <tooltip id="fcPermTooltip"
                    onpopupshowing="return Firebug.CookieModule.Perm.onTooltipShowing(this, Firebug.currentContext)"/>

                <toolbarbutton id="fcPerm" type="menu" tooltip="fcPermTooltip">
                    <menupopup id="fcPermMenuPopup"
                        oncommand="return Firebug.CookieModule.Perm.onCommand(event, Firebug.currentContext, null)"
                        onpopupshowing="return Firebug.CookieModule.Perm.onPopupShowing(this, Firebug.currentContext)"
                        onpopuphiding="return Firebug.CookieModule.Perm.onPopupHiding(this, Firebug.currentContext)">
                        <menuitem type="radio" name="fcPerm" value="default"/>
                        <menuitem type="radio" name="fcPerm" value="host-deny"/>
                        <menuitem type="radio" name="fcPerm" value="host-allow"/>
                        <menuitem type="radio" name="fcPerm" value="host-allow-session"/>
                        <!-- This doesn't seem to be working as expected comment out for now -->
                        <!-- <menuitem type="radio" name="fcPerm" value="host-limit-third-party"/> -->
                    </menupopup>
                </toolbarbutton>

                <!-- Tools xxxHonza: remove this for now and wait for user feedback.
                <toolbarseparator/>
                <toolbarbutton id="fcToolsMenu" type="menu" class="fbInternational"
                    label="cookies.Tools"
                    tooltiptext="cookies.ToolsTooltip">
                    <menupopup>
                        <menuitem id="fcCookieViewAll" class="fbInternational"
                            command="cmd_firebug_cookieViewAll"
                            label="cookies.ViewAll"
                            tooltiptext="cookies.ViewAllTooltip"/>
                        <menuitem id="fcCookieViewExceptions" class="fbInternational"
                            command="cmd_firebug_cookieViewExceptions"
                            label="cookies.ViewExceptions"
                            tooltiptext="cookies.ViewExceptionsTooltip"/>
                    </menupopup>
                </toolbarbutton> -->
            </hbox>
        </hbox>
    </toolbar>
</overlay>
