browser/base/content/macBrowserOverlay.xul

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/browser/base/content/macBrowserOverlay.xul	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,64 @@
     1.4 +<?xml version="1.0"?>
     1.5 +# -*- Mode: HTML -*-
     1.6 +#
     1.7 +# This Source Code Form is subject to the terms of the Mozilla Public
     1.8 +# License, v. 2.0. If a copy of the MPL was not distributed with this
     1.9 +# file, You can obtain one at http://mozilla.org/MPL/2.0/.
    1.10 +
    1.11 +<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
    1.12 +<?xml-stylesheet href="chrome://browser/content/places/places.css" type="text/css"?>
    1.13 +
    1.14 +<?xul-overlay href="chrome://global/content/editMenuOverlay.xul"?>
    1.15 +<?xul-overlay href="chrome://browser/content/baseMenuOverlay.xul"?>
    1.16 +<?xul-overlay href="chrome://browser/content/places/placesOverlay.xul"?>
    1.17 +
    1.18 +# All DTD information is stored in a separate file so that it can be shared by
    1.19 +# hiddenWindow.xul.
    1.20 +#include browser-doctype.inc
    1.21 +
    1.22 +<overlay id="hidden-overlay"
    1.23 +        xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    1.24 +        xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
    1.25 +
    1.26 +# All JS files which are not content (only) dependent that browser.xul
    1.27 +# wishes to include *must* go into the global-scripts.inc file
    1.28 +# so that they can be shared by this overlay.
    1.29 +#include global-scripts.inc
    1.30 +
    1.31 +<script type="application/javascript">
    1.32 +  function OpenBrowserWindowFromDockMenu(options) {
    1.33 +    let win = OpenBrowserWindow(options);
    1.34 +    win.addEventListener("load", function listener() {
    1.35 +      win.removeEventListener("load", listener);
    1.36 +      let dockSupport = Cc["@mozilla.org/widget/macdocksupport;1"]
    1.37 +        .getService(Ci.nsIMacDockSupport);
    1.38 +      dockSupport.activateApplication(true);
    1.39 +    });
    1.40 +
    1.41 +    return win;
    1.42 +  }
    1.43 +
    1.44 +  addEventListener("load",   function() { gBrowserInit.nonBrowserWindowStartup()  }, false);
    1.45 +  addEventListener("unload", function() { gBrowserInit.nonBrowserWindowShutdown() }, false);
    1.46 +</script>
    1.47 +
    1.48 +# All sets except for popupsets (commands, keys, stringbundles and broadcasters) *must* go into the 
    1.49 +# browser-sets.inc file for sharing with hiddenWindow.xul.
    1.50 +#include browser-sets.inc
    1.51 +
    1.52 +# The entire main menubar is placed into browser-menubar.inc, so that it can be shared by 
    1.53 +# hiddenWindow.xul.
    1.54 +#include browser-menubar.inc
    1.55 +
    1.56 +<!-- Dock menu -->
    1.57 +<popupset>
    1.58 +  <menupopup id="menu_mac_dockmenu">
    1.59 +    <!-- The command cannot be cmd_newNavigator because we need to activate
    1.60 +         the application. -->
    1.61 +    <menuitem label="&newNavigatorCmd.label;" oncommand="OpenBrowserWindowFromDockMenu();"
    1.62 +              id="macDockMenuNewWindow" />
    1.63 +    <menuitem label="&newPrivateWindow.label;" oncommand="OpenBrowserWindowFromDockMenu({private: true});" />
    1.64 +  </menupopup>
    1.65 +</popupset>
    1.66 +
    1.67 +</overlay>

mercurial