Adding Configurable Security Policy menu

This commit is contained in:
ben%netscape.com 2002-04-05 00:20:13 +00:00
Родитель 1a3e031141
Коммит 7f0364b7ac
8 изменённых файлов: 122 добавлений и 1 удалений

Просмотреть файл

@ -76,11 +76,24 @@ Contributor(s): ______________________________________. -->
<script type="application/x-javascript" src="chrome://browser/content/navigatorDD.js"/>
<script type="application/x-javascript" src="chrome://browser/content/sessionHistoryUI.js"/>
<<<<<<< browser.xul
<script type="application/x-javascript" src="chrome://browser/content/policy/policy.js"/>
<!-- hook for stringbundle overlays -->
<stringbundleset id="stringbundleset">
<stringbundle id="bundle_navigator" src="chrome://browser/locale/navigator.properties"/>
<stringbundle id="bundle_brand" src="chrome://global/locale/brand.properties"/>
<stringbundle id="bundle_navigator_region" src="chrome://navigator-region/locale/region.properties"/>
<stringbundle id="bundle_brand_region" src="chrome://global-region/locale/region.properties"/>
<stringbundle id="findBundle" src="chrome://global/locale/finddialog.properties"/>
</stringbundleset>
=======
<stringbundle id="bundle_navigator" src="chrome://browser/locale/navigator.properties"/>
<stringbundle id="bundle_brand" src="chrome://global/locale/brand.properties"/>
<stringbundle id="bundle_navigator_region" src="chrome://navigator-region/locale/region.properties"/>
<stringbundle id="bundle_brand_region" src="chrome://global-region/locale/region.properties"/>
<stringbundle id="findBundle" src="chrome://global/locale/finddialog.properties"/>
>>>>>>> 1.11
<commandset id="commands">
<commandset id="globalEditMenuItems"/>
@ -382,6 +395,18 @@ Contributor(s): ______________________________________. -->
</statusbarpanel>
<statusbarpanel class="statusbarpanel-iconic" id="offline-status"/>
<statusbarpanel class="statusbarpanel-iconic" id="security-button" onclick="displayPageInfo()"/>
<statusbarpanel>
<button id="policy-menu" type="menu" label="Policy"
oncommand="policyMenuAction(event);">
<menupopup context="" onpopupshowing="policyMenuShowing(event);"
popupanchor="bottomleft" popupalign="topleft">
<menuitem id="policyMenu-noregions" label="Add to New Region..."/>
<menuseparator id="customPolicySeparator"/>
<menuitem id="policyMenu-cookies" label="Can set cookies"/>
<menuitem id="policyMenu-scripts" label="Can execute scripts"/>
</menupopup>
</button>
</statusbarpanel>
</statusbar>
</window>

Просмотреть файл

@ -42,6 +42,6 @@ VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
DIRS = bookmarks build
DIRS = bookmarks build policy
include $(topsrcdir)/config/rules.mk

Просмотреть файл

Просмотреть файл

Просмотреть файл

Просмотреть файл

Просмотреть файл

@ -0,0 +1,74 @@
/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Ben Goodger <ben@netscape.com> (Original Author)
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the NPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
var gPolicyBranch = null;
function getPolicyBranch()
{
if (!gPolicyBranch) {
var prefService = Components.classes["@mozilla.org/preferences-service;1"]
.getService(Components.interfaces.nsIPrefService);
gPolicyBranch = prefService.getBranch("capability.policy.");
}
return gPolicyBranch;
}
function policyMenuAction(aEvent)
{
}
function policyMenuShowing(aEvent)
{
var branch = getPolicyBranch();
var regions = branch.getCharPref("policynames");
regions = regions.split(", ");
var noRegionsItem = document.getElementById("policyMenu-noregions");
for (var i = 0; i < regions.length; ++i) {
var menuitem = document.createElement("menuitem");
var label = branch.getCharPref(regions[i] + ".policyName");
menuitem.setAttribute("label", label);
menuitem.setAttribute("id", "policyMenuRegion-" + regions[i]);
aEvent.target.insertBefore(menuitem, noRegionsItem);
}
}

Просмотреть файл

@ -0,0 +1,22 @@
# The contents of this file are subject to the Netscape Public
# License Version 1.1 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy of
# the License at http://www.mozilla.org/NPL/
#
# Software distributed under the License is distributed on an "AS
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
# implied. See the License for the specific language governing
# rights and limitations under the License.
#
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All
# Rights Reserved.
#
# Contributor(s):
browser.jar:
content/browser/policy/policy.js (content/policy.js)