P3P code drop. Includes basic P3P support and UI.

Contributed by Tom Lendacky ( toml@us.ibm.com ).

*-- NOT PART OF THE BUILD...YET --*


git-svn-id: svn://10.0.0.236/trunk@90806 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
harishd%netscape.com
2001-03-30 02:36:22 +00:00
parent 2ebbd7376a
commit 23353e444d
127 changed files with 32614 additions and 0 deletions

View File

@@ -0,0 +1,31 @@
#
# The contents of this file are subject to the Mozilla 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/MPL/
#
# 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 imitations under the License.
#
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is International
# Business Machines Corporation. Portions created by IBM
# Corporation are Copyright (C) 2000 International Business
# Machines Corporation. All Rights Reserved.
#
# Contributor(s): IBM Corporation.
#
DEPTH = ../..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
DIRS = public src resources
include $(topsrcdir)/config/rules.mk

View File

@@ -0,0 +1,26 @@
#
# The contents of this file are subject to the Mozilla 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/MPL/
#
# 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 imitations under the License.
#
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is International
# Business Machines Corporation. Portions created by IBM
# Corporation are Copyright (C) 2000 International Business
# Machines Corporation. All Rights Reserved.
#
# Contributor(s): IBM Corporation.
#
DEPTH = ..\..
DIRS = public src resources
include <$(DEPTH)\config\rules.mak>

View File

@@ -0,0 +1,24 @@
#
# The contents of this file are subject to the Mozilla 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/MPL/
#
# 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 imitations under the License.
#
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is International
# Business Machines Corporation. Portions created by IBM
# Corporation are Copyright (C) 2000 International Business
# Machines Corporation. All Rights Reserved.
#
# Contributor(s): IBM Corporation.
#
#
# This is a list of local files which get exported
#

View File

@@ -0,0 +1,39 @@
#
# The contents of this file are subject to the Mozilla 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/MPL/
#
# 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 imitations under the License.
#
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is International
# Business Machines Corporation. Portions created by IBM
# Corporation are Copyright (C) 2000 International Business
# Machines Corporation. All Rights Reserved.
#
# Contributor(s): IBM Corporation.
#
DEPTH = ../../..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
MODULE = p3p
XPIDL_MODULE = p3p
EXPORTS = $(NULL)
XPIDLSRCS = \
nsIP3PService.idl \
nsIP3PUI.idl \
$(NULL)
include $(topsrcdir)/config/rules.mk

View File

@@ -0,0 +1,34 @@
#
# The contents of this file are subject to the Mozilla 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/MPL/
#
# 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 imitations under the License.
#
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is International
# Business Machines Corporation. Portions created by IBM
# Corporation are Copyright (C) 2000 International Business
# Machines Corporation. All Rights Reserved.
#
# Contributor(s): IBM Corporation.
#
DEPTH = ..\..\..
MODULE = p3p
XPIDL_MODULE = p3p
EXPORTS = $(NULL)
XPIDLSRCS = \
.\nsIP3PService.idl \
.\nsIP3PUI.idl \
$(NULL)
include <$(DEPTH)\config\rules.mak>

View File

@@ -0,0 +1,42 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Mozilla 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/MPL/
*
* 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 imitations under the License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is International
* Business Machines Corporation. Portions created by IBM
* Corporation are Copyright (C) 2000 International Business
* Machines Corporation. All Rights Reserved.
*
* Contributor(s): IBM Corporation.
*
*/
#include "nsISupports.idl"
interface nsIRDFDataSource;
[scriptable, uuid(31430E50-D43D-11d3-9781-002035AEE991)]
interface nsIP3PService : nsISupports
{
boolean P3PIsEnabled( );
};
%{C++
// Class ID definitions {31430E51-D43D-11d3-9781-002035AEE991}
#define NS_P3PSERVICE_CID { 0x31430e51, 0xd43d, 0x11d3, { 0x97, 0x81, 0x0, 0x20, 0x35, 0xae, 0xe9, 0x91 } }
#define NS_P3PSERVICE_CONTRACTID "@mozilla.org/p3p-service;1"
#define NS_P3PSERVICE_CLASSNAME "P3P Service"
%}

View File

@@ -0,0 +1,45 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Mozilla 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/MPL/
*
* 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 imitations under the License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is International
* Business Machines Corporation. Portions created by IBM
* Corporation are Copyright (C) 2000 International Business
* Machines Corporation. All Rights Reserved.
*
* Contributor(s): IBM Corporation.
*
*/
#include "nsISupports.idl"
interface nsIDOMWindow;
interface nsIDOMElement;
interface nsIRDFDataSource;
[scriptable, uuid(31430e54-d43d-11d3-9781-002035aee991)]
interface nsIP3PUI : nsISupports
{
void Init(in nsIDOMWindow window, in nsIDOMElement button);
void Close();
long GetPrivacyStatus();
string GetCurrentURI();
nsIRDFDataSource GetPrivacyInfo();
};
%{C++
#define NS_P3PUI_CONTRACTID "@mozilla.org/p3p-browser-ui;1"
#define NS_P3PUI_CLASSNAME "Mozilla Privacy Browser"
#define NS_P3PUI_CID {0x31430e55, 0xd43d, 0x11d3, { 0x97, 0x81, 0x00, 0x20, 0x35, 0xae, 0xe9, 0x91 }}
%}

View File

@@ -0,0 +1,32 @@
#
# The contents of this file are subject to the Mozilla 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/MPL/
#
# 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 imitations under the License.
#
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is International
# Business Machines Corporation. Portions created by IBM
# Corporation are Copyright (C) 2000 International Business
# Machines Corporation. All Rights Reserved.
#
# Contributor(s): IBM Corporation.
#
DEPTH = ../../..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
DIRS = content locale skin
include $(topsrcdir)/config/rules.mk

View File

@@ -0,0 +1,43 @@
#
# The contents of this file are subject to the Mozilla 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/MPL/
#
# 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 imitations under the License.
#
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is International
# Business Machines Corporation. Portions created by IBM
# Corporation are Copyright (C) 2000 International Business
# Machines Corporation. All Rights Reserved.
#
# Contributor(s): IBM Corporation.
#
#
# This is a list of local files which get exported
#
privacyOverlay.xul
privacyUI.js
P3PBadPrivacyInfo.js
P3PBadPrivacyInfo.xul
P3PBaseDataSchema.xml
P3PInProgressInfo.js
P3PInProgressInfo.xul
P3PNoPrivacyInfo.js
P3PNoPrivacyInfo.xul
P3PPartialPrivacyInfo.js
P3PPartialPrivacyInfo.xul
P3PPrivacyMetInfo.js
P3PPrivacyMetInfo.xul
P3PPrivacyNotMetInfo.js
P3PPrivacyNotMetInfo.xul
pref-P3P.js
pref-P3P.xul
pref-P3Pcust.js
pref-P3Pcust.xul

View File

@@ -0,0 +1,62 @@
#
# The contents of this file are subject to the Mozilla 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/MPL/
#
# 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 imitations under the License.
#
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is International
# Business Machines Corporation. Portions created by IBM
# Corporation are Copyright (C) 2000 International Business
# Machines Corporation. All Rights Reserved.
#
# Contributor(s): IBM Corporation.
#
DEPTH = ../../../..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
EXPORT_RESOURCE_PREF_CONTENT = \
$(srcdir)/pref-P3P.xul \
$(srcdir)/pref-P3P.js \
$(srcdir)/pref-P3Pcust.xul \
$(srcdir)/pref-P3Pcust.js \
$(NULL)
EXPORT_RESOURCE_CONTENT = \
$(srcdir)/privacyOverlay.xul \
$(srcdir)/privacyUI.js \
$(srcdir)/P3PPrivacyMetInfo.xul \
$(srcdir)/P3PPrivacyMetInfo.js \
$(srcdir)/P3PPrivacyNotMetInfo.xul \
$(srcdir)/P3PPrivacyNotMetInfo.js \
$(srcdir)/P3PNoPrivacyInfo.xul \
$(srcdir)/P3PNoPrivacyInfo.js \
$(srcdir)/P3PBadPrivacyInfo.xul \
$(srcdir)/P3PBadPrivacyInfo.js \
$(srcdir)/P3PPartialPrivacyInfo.xul \
$(srcdir)/P3PPartialPrivacyInfo.js \
$(srcdir)/P3PInProgressInfo.xul \
$(srcdir)/P3PInProgressInfo.js \
$(NULL)
EXPORT_RESOURCE_DATASCHEMA_CONTENT = \
$(srcdir)/P3PBaseDataSchema.xml \
$(NULL)
include $(topsrcdir)/config/rules.mk
install::
$(INSTALL) $(EXPORT_RESOURCE_PREF_CONTENT) $(DIST)/bin/chrome/comm/content/communicator/pref
$(INSTALL) $(EXPORT_RESOURCE_CONTENT) $(DIST)/bin/chrome/comm/content/communicator
$(INSTALL) $(EXPORT_RESOURCE_DATASCHEMA_CONTENT) $(DIST)/bin/components

View File

@@ -0,0 +1,36 @@
/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Mozilla 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/MPL/
*
* 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 imitations under the License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is International
* Business Machines Corporation. Portions created by IBM
* Corporation are Copyright (C) 2000 International Business
* Machines Corporation. All Rights Reserved.
*
* Contributor(s): IBM Corporation.
*
*/
var privacyUI;
var ds;
var privacyTree;
function Init() {
privacyUI = window.arguments[0];
ds = privacyUI.GetPrivacyInfo();
privacyTree = document.getElementById("privacyTree");
privacyTree.database.AddDataSource(ds);
privacyTree.builder.rebuild();
}

View File

@@ -0,0 +1,127 @@
<?xml version="1.0"?>
<!--
- The contents of this file are subject to the Mozilla 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/MPL/
-
- 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 imitations under the License.
-
- The Original Code is mozilla.org code.
-
- The Initial Developer of the Original Code is International
- Business Machines Corporation. Portions created by IBM
- Corporation are Copyright (C) 2000 International Business
- Machines Corporation. All Rights Reserved.
-
- Contributor(s): IBM Corporation.
-
-->
<?xml-stylesheet href="chrome://communicator/skin/" type="text/css"?>
<?xul-overlay href="chrome://global/content/dialogOverlay.xul"?>
<!DOCTYPE window SYSTEM "chrome://communicator/locale/P3PPrivacyInfo.dtd" >
<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
xmlns:html="http://www.w3.org/TR/REC-html40"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:web="http://home.netscape.com/WEB-rdf#"
id="privacyInfo"
class="dialog"
width="600" height="400" screenX="40" screenY="40"
persist="width height screenX screenY"
orient="vertical"
title="&privacyInfo.title;"
onload="Init()">
<html:script language="JavaScript" src="chrome://global/content/strres.js" />
<html:script language="JavaScript" src="chrome://communicator/content/P3PBadPrivacyInfo.js"/>
<box class="box-smallheader" title="&privacyinfo.header;"/>
<text class="header" value="&badpolicy.text;"/>
<separator/>
<box flex="1">
<tree id="privacyTree" flex="1" datasources="rdf:null" ref="NC:P3PPolicyRoot"
containment="http://home.netscape.com/NC-rdf#P3PEntries">
<treecolgroup>
<treecol style="width:300px" flex="1"/>
<splitter class="tree-splitter"/>
<treecol style="width:300px" flex="1"/>
</treecolgroup>
<treehead>
<treerow>
<treecell class="treecell-header outset" value="&privacypolicy.text;"/>
<treecell class="treecell-header outset"/>
</treerow>
</treehead>
<template>
<rule>
<conditions>
<content uri="?uri"/>
<triple subject="?uri"
predicate="http://home.netscape.com/NC-rdf#P3PEntries"
object="?entries"/>
<member container="?entries" child="?entry"/>
<triple subject="?entry"
predicate="http://home.netscape.com/NC-rdf#P3PTitle"
object="?title"/>
<triple subject="?entry"
predicate="http://home.netscape.com/NC-rdf#P3PValue"
object="?value"/>
</conditions>
<action>
<treechildren flex="1">
<treeitem uri="?entry">
<treerow>
<treecell class="treecell-indent" value="?title"/>
<treecell class="treecell-indent" value="?value"/>
</treerow>
</treeitem>
</treechildren>
</action>
</rule>
<rule>
<conditions>
<content uri="?uri"/>
<triple subject="?uri"
predicate="http://home.netscape.com/NC-rdf#P3PEntries"
object="?entries"/>
<member container="?entries" child="?entry"/>
<triple subject="?entry"
predicate="http://home.netscape.com/NC-rdf#P3PTitle"
object="?title"/>
</conditions>
<action>
<treechildren flex="1">
<treeitem uri="?entry">
<treerow>
<treecell class="treecell-indent" value="?title"/>
</treerow>
</treeitem>
</treechildren>
</action>
</rule>
</template>
</tree>
</box>
<separator/>
<box align="horizontal" autostretch="never">
<spring flex="1"/>
<button id="ok" value="&okButton.label;" default="true" align="center" onclick="doOKButton()"/>
<spring flex="1"/>
</box>
</window>

View File

@@ -0,0 +1,444 @@
<!--
- The contents of this file are subject to the Mozilla 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/MPL/
-
- 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 imitations under the License.
-
- The Original Code is mozilla.org code.
-
- The Initial Developer of the Original Code is International
- Business Machines Corporation. Portions created by IBM
- Corporation are Copyright (C) 2000 International Business
- Machines Corporation. All Rights Reserved.
-
- Contributor(s): IBM Corporation.
-
-->
<DATASCHEMA xmlns="http://www.w3.org/2000/09/15/P3Pv1">
<!-- ********** Base Data Structures ********** -->
<!-- "date" Data Structure -->
<DATA-STRUCT name="date.ymd.year"
short-description="Year"/>
<DATA-STRUCT name="date.ymd.month"
short-description="Month"/>
<DATA-STRUCT name="date.ymd.day"
short-description="Day"/>
<DATA-STRUCT name="date.hms.hour"
short-description="Hour"/>
<DATA-STRUCT name="date.hms.minute"
short-description="Minutes"/>
<DATA-STRUCT name="date.hms.second"
short-description="Second"/>
<DATA-STRUCT name="date.fractionsecond"
short-description="Fraction of Second"/>
<DATA-STRUCT name="date.timezone"
short-description="Time Zone"/>
<!-- "personname" Data Structure -->
<DATA-STRUCT name="personname.prefix"
short-description="Name Prefix">
<CATEGORIES><demographic/></CATEGORIES>
</DATA-STRUCT>
<DATA-STRUCT name="personname.given"
short-description="Given Name (First Name)">
<CATEGORIES><physical/></CATEGORIES>
</DATA-STRUCT>
<DATA-STRUCT name="personname.middle"
short-description="Middle Name">
<CATEGORIES><physical/></CATEGORIES>
</DATA-STRUCT>
<DATA-STRUCT name="personname.family"
short-description="Family Name (Last Name)">
<CATEGORIES><physical/></CATEGORIES>
</DATA-STRUCT>
<DATA-STRUCT name="personname.suffix"
short-description="Name Suffix">
<CATEGORIES><demographic/></CATEGORIES>
</DATA-STRUCT>
<DATA-STRUCT name="personname.nickname"
short-description="Nickname">
<CATEGORIES><demographic/></CATEGORIES>
</DATA-STRUCT>
<!-- "certificate" Data Structure -->
<DATA-STRUCT name="certificate.key"
short-description="Certificate key">
<CATEGORIES><uniqueid/></CATEGORIES>
</DATA-STRUCT>
<DATA-STRUCT name="certificate.format"
short-description="Certificate format">
<CATEGORIES><uniqueid/></CATEGORIES>
</DATA-STRUCT>
<!-- "telephonenum" Data Structure -->
<DATA-STRUCT name="telephonenum.intcode"
short-description="International Telephone Code">
<CATEGORIES><physical/></CATEGORIES>
</DATA-STRUCT>
<DATA-STRUCT name="telephonenum.loccode"
short-description="Local Telephone Area Code">
<CATEGORIES><physical/></CATEGORIES>
</DATA-STRUCT>
<DATA-STRUCT name="telephonenum.number"
short-description="Telephone Number">
<CATEGORIES><physical/></CATEGORIES>
</DATA-STRUCT>
<DATA-STRUCT name="telephonenum.ext"
short-description="Telephone Extension">
<CATEGORIES><physical/></CATEGORIES>
</DATA-STRUCT>
<DATA-STRUCT name="telephonenum.comment"
short-description="Telephone Optional Comments">
<CATEGORIES><physical/></CATEGORIES>
</DATA-STRUCT>
<!-- "postal" Data Structure -->
<DATA-STRUCT name="postal.name" struct-ref="#personname">
<CATEGORIES><physical/><demographic/></CATEGORIES>
</DATA-STRUCT>
<DATA-STRUCT name="postal.street"
short-description="Street Address">
<CATEGORIES><physical/></CATEGORIES>
</DATA-STRUCT>
<DATA-STRUCT name="postal.city"
short-description="City">
<CATEGORIES><physical/></CATEGORIES>
</DATA-STRUCT>
<DATA-STRUCT name="postal.stateprov"
short-description="State or Province">
<CATEGORIES><physical/></CATEGORIES>
</DATA-STRUCT>
<DATA-STRUCT name="postal.postalcode"
short-description="Postal Code">
<CATEGORIES><demographic/></CATEGORIES>
</DATA-STRUCT>
<DATA-STRUCT name="postal.organization"
short-description="Organization Name">
<CATEGORIES><physical/><demographic/></CATEGORIES>
</DATA-STRUCT>
<DATA-STRUCT name="postal.country"
short-description="Country Name">
<CATEGORIES><demographic/></CATEGORIES>
</DATA-STRUCT>
<!-- "telecom" Data Structure -->
<DATA-STRUCT name="telecom.telephone"
short-description="Telephone Number"
structref="#telephonenum">
<CATEGORIES><physical/></CATEGORIES>
</DATA-STRUCT>
<DATA-STRUCT name="telecom.fax"
short-description="Fax Number"
structref="#telephonenum">
<CATEGORIES><physical/></CATEGORIES>
</DATA-STRUCT>
<DATA-STRUCT name="telecom.mobile"
short-description="Mobile Telephone Number"
structref="#telephonenum">
<CATEGORIES><physical/></CATEGORIES>
</DATA-STRUCT>
<DATA-STRUCT name="telecom.pager"
short-description="Pager Number"
structref="#telephonenum">
<CATEGORIES><physical/></CATEGORIES>
</DATA-STRUCT>
<!-- "online" Data Structure -->
<DATA-STRUCT name="online.email"
short-description="Email Address">
<CATEGORIES><online/></CATEGORIES>
</DATA-STRUCT>
<DATA-STRUCT name="online.uri"
short-description="Home Page Address">
<CATEGORIES><online/></CATEGORIES>
</DATA-STRUCT>
<!-- "contact" Data Structure -->
<DATA-STRUCT name="contact.postal"
short-description="Postal Address Information"
structref="#postal">
<CATEGORIES><physical/><demographic/></CATEGORIES>
</DATA-STRUCT>
<DATA-STRUCT name="contact.telecom"
short-description="Telecommunications Information"
structref="#telecom">
<CATEGORIES><physical/></CATEGORIES>
</DATA-STRUCT>
<DATA-STRUCT name="contact.online"
short-description="Online Address Information"
structref="#online">
<CATEGORIES><online/></CATEGORIES>
</DATA-STRUCT>
<!-- "uri" Data Structure -->
<DATA-STRUCT name="uri.authority"
short-description="URI authority"/>
<DATA-STRUCT name="uri.stem"
short-description="URI stem"/>
<DATA-STRUCT name="uri.querystring"
short-description="Query-string portion of URI"/>
<!-- "ipaddr" Data Structure -->
<DATA-STRUCT name="ipaddr.hostname"
short-description="Complete host and domain name">
<CATEGORIES><uniqueid/></CATEGORIES>
</DATA-STRUCT>
<DATA-STRUCT name="ipaddr.partialhostname"
short-description="Partial hostname">
<CATEGORIES><demographic/></CATEGORIES>
</DATA-STRUCT>
<DATA-STRUCT name="ipaddr.fullip"
short-description="Full IP address">
<CATEGORIES><uniqueid/></CATEGORIES>
</DATA-STRUCT>
<DATA-STRUCT name="ipaddr.partialip"
short-description="Partial IP address">
<CATEGORIES><demographic/></CATEGORIES>
</DATA-STRUCT>
<!-- "loginfo" Data Structure -->
<DATA-STRUCT name="loginfo.uri"
short-description="URI of requested resource"
structref="#uri">
<CATEGORIES><navigation/></CATEGORIES>
</DATA-STRUCT>
<DATA-STRUCT name="loginfo.timestamp"
short-description="Request timestamp"
structref="#date">
<CATEGORIES><navigation/></CATEGORIES>
</DATA-STRUCT>
<DATA-STRUCT name="loginfo.clientip"
short-description="Client's IP address or hostname"
structref="#ipaddr">
<CATEGORIES><computer/></CATEGORIES>
</DATA-STRUCT>
<DATA-STRUCT name="loginfo.other.httpmethod"
short-description="HTTP request method">
<CATEGORIES><navigation/></CATEGORIES>
</DATA-STRUCT>
<DATA-STRUCT name="loginfo.other.bytes"
short-description="Data bytes in response">
<CATEGORIES><navigation/></CATEGORIES>
</DATA-STRUCT>
<DATA-STRUCT name="loginfo.other.statuscode"
short-description="Response status code">
<CATEGORIES><navigation/></CATEGORIES>
</DATA-STRUCT>
<!-- "httpinfo" Data Structure -->
<DATA-STRUCT name="httpinfo.referer"
short-description="Last URI requested by the user"
structref="#uri">
<CATEGORIES><navigation/></CATEGORIES>
</DATA-STRUCT>
<DATA-STRUCT name="httpinfo.useragent"
short-description="User agent information">
<CATEGORIES><computer/></CATEGORIES>
</DATA-STRUCT>
<!-- ********** Base Data Schemas ********** -->
<!-- "dynamic" Data Schema -->
<DATA-DEF name="dynamic.clickstream"
short-description="Click-stream information"
structref="#loginfo">
<CATEGORIES><navigation/><computer/></CATEGORIES>
</DATA-DEF>
<DATA-DEF name="dynamic.cookies"
short-description="HTTP Cookies">
</DATA-DEF>
<DATA-DEF name="dynamic.http"
short-description="HTTP protocol information"
structref="#httpinfo">
<CATEGORIES><navigation/><computer/></CATEGORIES>
</DATA-DEF>
<DATA-DEF name="dynamic.miscdata"
short-description="Other information"/>
<DATA-DEF name="dynamic.searchtext"
short-description="Search terms">
<CATEGORIES><interactive/></CATEGORIES>
</DATA-DEF>
<DATA-DEF name="dynamic.interactionrecord"
short-description="Transaction history">
<CATEGORIES><interactive/></CATEGORIES>
</DATA-DEF>
<!-- "user" Data Schema -->
<DATA-DEF name="user.name"
short-description="User's Name"
structref="#personname">
<CATEGORIES><physical/><demographic/></CATEGORIES>
</DATA-DEF>
<DATA-DEF name="user.bdate"
short-description="User's Birth Date"
structref="#date">
<CATEGORIES><demographic/></CATEGORIES>
</DATA-DEF>
<DATA-DEF name="user.cert"
short-description="User's Identity certificate"
structref="#certificate">
<CATEGORIES><uniqueid/></CATEGORIES>
</DATA-DEF>
<DATA-DEF name="user.gender"
short-description="User's Gender">
<CATEGORIES><demographic/></CATEGORIES>
</DATA-DEF>
<DATA-DEF name="user.jobtitle"
short-description="User's Job Title">
<CATEGORIES><demographic/></CATEGORIES>
</DATA-DEF>
<DATA-DEF name="user.home-info"
short-description="User's Home Contact Information"
structref="#contact">
<CATEGORIES><physical/><online/><demographic/></CATEGORIES>
</DATA-DEF>
<DATA-DEF name="user.business-info"
short-description="User's Business Contact Information"
structref="#contact">
<CATEGORIES><physical/><online/><demographic/></CATEGORIES>
</DATA-DEF>
<DATA-DEF name="user.employer"
short-description="Name of User's Employer">
<CATEGORIES><demographic/></CATEGORIES>
</DATA-DEF>
<DATA-DEF name="user.department"
short-description="Department or division of organization where user is employed">
<CATEGORIES><demographic/></CATEGORIES>
</DATA-DEF>
<!-- "thirdparty" Data Schema -->
<DATA-DEF name="thirdparty.name"
short-description="Third Party's Name"
structref="#personname">
<CATEGORIES><physical/><demographic/></CATEGORIES>
</DATA-DEF>
<DATA-DEF name="thirdparty.bdate"
short-description="Third Party's Birth Date"
structref="#date">
<CATEGORIES><demographic/></CATEGORIES>
</DATA-DEF>
<DATA-DEF name="thirdparty.cert"
short-description="Third Party's Identity certificate"
structref="#certificate">
<CATEGORIES><uniqueid/></CATEGORIES>
</DATA-DEF>
<DATA-DEF name="thirdparty.gender"
short-description="Third Party's Gender">
<CATEGORIES><demographic/></CATEGORIES>
</DATA-DEF>
<DATA-DEF name="thirdparty.jobtitle"
short-description="Third Party's Job Title">
<CATEGORIES><demographic/></CATEGORIES>
</DATA-DEF>
<DATA-DEF name="thirdparty.home-info"
short-description="Third Party's Home Contact Information"
structref="#contact">
<CATEGORIES><physical/><online/><demographic/></CATEGORIES>
</DATA-DEF>
<DATA-DEF name="thirdparty.business-info"
short-description="Third Party's Business Contact Information"
structref="#contact">
<CATEGORIES><physical/><online/><demographic/></CATEGORIES>
</DATA-DEF>
<DATA-DEF name="thirdparty.employer"
short-description="Name of Third Party's Employer">
<CATEGORIES><demographic/></CATEGORIES>
</DATA-DEF>
<DATA-DEF name="thirdparty.department"
short-description="Department or division of organization where third party is employed">
<CATEGORIES><demographic/></CATEGORIES>
</DATA-DEF>
<!-- "business" Data Schema -->
<DATA-DEF name="business.name"
short-description="Organization Name">
<CATEGORIES><demographic/></CATEGORIES>
</DATA-DEF>
<DATA-DEF name="business.department"
short-description="Department or division of organization">
<CATEGORIES><demographic/></CATEGORIES>
</DATA-DEF>
<DATA-DEF name="business.cert"
short-description="Organization Identity certificate"
structref="#certificate">
<CATEGORIES><uniqueid/></CATEGORIES>
</DATA-DEF>
<DATA-DEF name="business.contact-info"
short-description="Contact Information for the Organization"
structref="#contact">
<CATEGORIES><physical/></CATEGORIES>
</DATA-DEF>
</DATASCHEMA>

View File

@@ -0,0 +1,60 @@
/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Mozilla 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/MPL/
*
* 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 imitations under the License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is International
* Business Machines Corporation. Portions created by IBM
* Corporation are Copyright (C) 2000 International Business
* Machines Corporation. All Rights Reserved.
*
* Contributor(s): IBM Corporation.
*
*/
var privacyUI;
function Init() {
privacyUI = window.arguments[0];
var element = document.getElementById( "currentURI" );
if (element) {
element.setAttribute("value", privacyUI.GetCurrentURI());
}
}
function doRefreshButton() {
var privacyStatus = privacyUI.GetPrivacyStatus( );
if (privacyStatus != 6) {
if (privacyStatus == 1) {
window.openDialog("chrome://communicator/content/P3PNoPrivacyInfo.xul","","modal=no,chrome,resizable=yes",
privacyUI);
} else if (privacyStatus == 2) {
window.openDialog("chrome://communicator/content/P3PPrivacyMetInfo.xul","","modal=no,chrome,resizable=yes",
privacyUI);
} else if (privacyStatus == 3) {
window.openDialog("chrome://communicator/content/P3PPrivacyNotMetInfo.xul","","modal=no,chrome,resizable=yes",
privacyUI);
} else if (privacyStatus == 4) {
window.openDialog("chrome://communicator/content/P3PPartialPrivacyInfo.xul","","modal=no,chrome,resizable=yes",
privacyUI);
} else if (privacyStatus == 5) {
window.openDialog("chrome://communicator/content/P3PBadPrivacyInfo.xul","","modal=no,chrome,resizable=yes",
privacyUI);
}
doCancelButton();
}
}

View File

@@ -0,0 +1,60 @@
<?xml version="1.0"?>
<!--
- The contents of this file are subject to the Mozilla 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/MPL/
-
- 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 imitations under the License.
-
- The Original Code is mozilla.org code.
-
- The Initial Developer of the Original Code is International
- Business Machines Corporation. Portions created by IBM
- Corporation are Copyright (C) 2000 International Business
- Machines Corporation. All Rights Reserved.
-
- Contributor(s): IBM Corporation.
-
-->
<?xml-stylesheet href="chrome://communicator/skin/" type="text/css"?>
<?xul-overlay href="chrome://global/content/dialogOverlay.xul"?>
<!DOCTYPE window SYSTEM "chrome://communicator/locale/P3PPrivacyInfo.dtd" >
<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
xmlns:html="http://www.w3.org/TR/REC-html40"
id="privacyInfo"
class="dialog"
screenX="40" screenY="40"
persist="width height screenX screenY"
orient="vertical"
title="&privacyInfo.title;"
onload="Init()">
<html:script language="JavaScript" src="chrome://global/content/strres.js" />
<html:script language="JavaScript" src="chrome://communicator/content/P3PInProgressInfo.js"/>
<box class="box-smallheader" title="&privacyinfo.header;"/>
<text class="header" value="&inprogress1.text;"/>
<text class="header" value="&inprogress2.text;"/>
<separator/>
<text value="&currentURI.text;"/>
<text id="currentURI" value=""/>
<separator/>
<spring flex="1"/>
<box align="horizontal" autostretch="never">
<spring flex="1"/>
<button id="refresh" value="&refreshButton.label;" onclick="doRefreshButton()"/>
<button id="cancel" value="&cancelButton.label;" onclick="doCancelButton()"/>
<spring flex="1"/>
</box>
</window>

View File

@@ -0,0 +1,36 @@
/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Mozilla 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/MPL/
*
* 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 imitations under the License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is International
* Business Machines Corporation. Portions created by IBM
* Corporation are Copyright (C) 2000 International Business
* Machines Corporation. All Rights Reserved.
*
* Contributor(s): IBM Corporation.
*
*/
var privacyUI;
var ds;
var privacyTree;
function Init() {
privacyUI = window.arguments[0];
ds = privacyUI.GetPrivacyInfo();
privacyTree = document.getElementById("privacyTree");
privacyTree.database.AddDataSource(ds);
privacyTree.builder.rebuild();
}

View File

@@ -0,0 +1,126 @@
<?xml version="1.0"?>
<!--
- The contents of this file are subject to the Mozilla 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/MPL/
-
- 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 imitations under the License.
-
- The Original Code is mozilla.org code.
-
- The Initial Developer of the Original Code is International
- Business Machines Corporation. Portions created by IBM
- Corporation are Copyright (C) 2000 International Business
- Machines Corporation. All Rights Reserved.
-
- Contributor(s): IBM Corporation.
-
-->
<?xml-stylesheet href="chrome://communicator/skin/" type="text/css"?>
<?xul-overlay href="chrome://global/content/dialogOverlay.xul"?>
<!DOCTYPE window SYSTEM "chrome://communicator/locale/P3PPrivacyInfo.dtd" >
<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
xmlns:html="http://www.w3.org/TR/REC-html40"
id="privacyInfo"
class="dialog"
width="600" height="400" screenX="40" screenY="40"
persist="width height screenX screenY"
orient="vertical"
title="&privacyInfo.title;"
onload="Init()">
<html:script language="JavaScript" src="chrome://global/content/strres.js" />
<html:script language="JavaScript" src="chrome://communicator/content/P3PNoPrivacyInfo.js"/>
<box class="box-smallheader" title="&privacyinfo.header;"/>
<text class="header" value="&nopolicy.text;"/>
<separator/>
<box flex="1">
<tree id="privacyTree" flex="1" datasources="rdf:null" ref="NC:P3PPolicyRoot"
containment="http://home.netscape.com/NC-rdf#P3PEntries">
<treecolgroup>
<treecol style="width:300px" flex="1"/>
<splitter class="tree-splitter"/>
<treecol style="width:300px" flex="1"/>
</treecolgroup>
<treehead>
<treerow>
<treecell class="treecell-header outset" value="&privacypolicy.text;"/>
<treecell class="treecell-header outset"/>
</treerow>
</treehead>
<template>
<rule>
<conditions>
<content uri="?uri"/>
<triple subject="?uri"
predicate="http://home.netscape.com/NC-rdf#P3PEntries"
object="?entries"/>
<member container="?entries" child="?entry"/>
<triple subject="?entry"
predicate="http://home.netscape.com/NC-rdf#P3PTitle"
object="?title"/>
<triple subject="?entry"
predicate="http://home.netscape.com/NC-rdf#P3PValue"
object="?value"/>
</conditions>
<action>
<treechildren flex="1">
<treeitem uri="?entry">
<treerow>
<treecell class="treecell-indent" value="?title"/>
<treecell class="treecell-indent" value="?value"/>
</treerow>
</treeitem>
</treechildren>
</action>
</rule>
<rule>
<conditions>
<content uri="?uri"/>
<triple subject="?uri"
predicate="http://home.netscape.com/NC-rdf#P3PEntries"
object="?entries"/>
<member container="?entries" child="?entry"/>
<triple subject="?entry"
predicate="http://home.netscape.com/NC-rdf#P3PTitle"
object="?title"/>
</conditions>
<action>
<treechildren flex="1">
<treeitem uri="?entry">
<treerow>
<treecell class="treecell-indent" value="?title"/>
</treerow>
</treeitem>
</treechildren>
</action>
</rule>
</template>
</tree>
</box>
<separator/>
<spring flex="1"/>
<box align="horizontal" autostretch="never">
<spring flex="1"/>
<button id="ok" value="&okButton.label;" default="true" align="center" onclick="doOKButton()"/>
<spring flex="1"/>
</box>
</window>

View File

@@ -0,0 +1,36 @@
/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Mozilla 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/MPL/
*
* 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 imitations under the License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is International
* Business Machines Corporation. Portions created by IBM
* Corporation are Copyright (C) 2000 International Business
* Machines Corporation. All Rights Reserved.
*
* Contributor(s): IBM Corporation.
*
*/
var privacyUI;
var ds;
var privacyTree;
function Init() {
privacyUI = window.arguments[0];
ds = privacyUI.GetPrivacyInfo();
privacyTree = document.getElementById("privacyTree");
privacyTree.database.AddDataSource(ds);
privacyTree.builder.rebuild();
}

View File

@@ -0,0 +1,127 @@
<?xml version="1.0"?>
<!--
- The contents of this file are subject to the Mozilla 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/MPL/
-
- 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 imitations under the License.
-
- The Original Code is mozilla.org code.
-
- The Initial Developer of the Original Code is International
- Business Machines Corporation. Portions created by IBM
- Corporation are Copyright (C) 2000 International Business
- Machines Corporation. All Rights Reserved.
-
- Contributor(s): IBM Corporation.
-
-->
<?xml-stylesheet href="chrome://communicator/skin/" type="text/css"?>
<?xul-overlay href="chrome://global/content/dialogOverlay.xul"?>
<!DOCTYPE window SYSTEM "chrome://communicator/locale/P3PPrivacyInfo.dtd" >
<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
xmlns:html="http://www.w3.org/TR/REC-html40"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:web="http://home.netscape.com/WEB-rdf#"
id="privacyInfo"
class="dialog"
width="600" height="400" screenX="40" screenY="40"
persist="width height screenX screenY"
orient="vertical"
title="&privacyInfo.title;"
onload="Init()">
<html:script language="JavaScript" src="chrome://global/content/strres.js" />
<html:script language="JavaScript" src="chrome://communicator/content/P3PPartialPrivacyInfo.js"/>
<box class="box-smallheader" title="&privacyinfo.header;"/>
<text class="header" value="&partialpolicy.text;"/>
<separator/>
<box flex="1">
<tree id="privacyTree" flex="1" datasources="rdf:null" ref="NC:P3PPolicyRoot"
containment="http://home.netscape.com/NC-rdf#P3PEntries">
<treecolgroup>
<treecol style="width:300px" flex="1"/>
<splitter class="tree-splitter"/>
<treecol style="width:300px" flex="1"/>
</treecolgroup>
<treehead>
<treerow>
<treecell class="treecell-header outset" value="&privacypolicy.text;"/>
<treecell class="treecell-header outset"/>
</treerow>
</treehead>
<template>
<rule>
<conditions>
<content uri="?uri"/>
<triple subject="?uri"
predicate="http://home.netscape.com/NC-rdf#P3PEntries"
object="?entries"/>
<member container="?entries" child="?entry"/>
<triple subject="?entry"
predicate="http://home.netscape.com/NC-rdf#P3PTitle"
object="?title"/>
<triple subject="?entry"
predicate="http://home.netscape.com/NC-rdf#P3PValue"
object="?value"/>
</conditions>
<action>
<treechildren flex="1">
<treeitem uri="?entry">
<treerow>
<treecell class="treecell-indent" value="?title"/>
<treecell class="treecell-indent" value="?value"/>
</treerow>
</treeitem>
</treechildren>
</action>
</rule>
<rule>
<conditions>
<content uri="?uri"/>
<triple subject="?uri"
predicate="http://home.netscape.com/NC-rdf#P3PEntries"
object="?entries"/>
<member container="?entries" child="?entry"/>
<triple subject="?entry"
predicate="http://home.netscape.com/NC-rdf#P3PTitle"
object="?title"/>
</conditions>
<action>
<treechildren flex="1">
<treeitem uri="?entry">
<treerow>
<treecell class="treecell-indent" value="?title"/>
</treerow>
</treeitem>
</treechildren>
</action>
</rule>
</template>
</tree>
</box>
<separator/>
<box align="horizontal" autostretch="never">
<spring flex="1"/>
<button id="ok" value="&okButton.label;" default="true" align="center" onclick="doOKButton()"/>
<spring flex="1"/>
</box>
</window>

View File

@@ -0,0 +1,36 @@
/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Mozilla 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/MPL/
*
* 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 imitations under the License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is International
* Business Machines Corporation. Portions created by IBM
* Corporation are Copyright (C) 2000 International Business
* Machines Corporation. All Rights Reserved.
*
* Contributor(s): IBM Corporation.
*
*/
var privacyUI;
var ds;
var privacyTree;
function Init() {
privacyUI = window.arguments[0];
ds = privacyUI.GetPrivacyInfo();
privacyTree = document.getElementById("privacyTree");
privacyTree.database.AddDataSource(ds);
privacyTree.builder.rebuild();
}

View File

@@ -0,0 +1,127 @@
<?xml version="1.0"?>
<!--
- The contents of this file are subject to the Mozilla 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/MPL/
-
- 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 imitations under the License.
-
- The Original Code is mozilla.org code.
-
- The Initial Developer of the Original Code is International
- Business Machines Corporation. Portions created by IBM
- Corporation are Copyright (C) 2000 International Business
- Machines Corporation. All Rights Reserved.
-
- Contributor(s): IBM Corporation.
-
-->
<?xml-stylesheet href="chrome://communicator/skin/" type="text/css"?>
<?xul-overlay href="chrome://global/content/dialogOverlay.xul"?>
<!DOCTYPE window SYSTEM "chrome://communicator/locale/P3PPrivacyInfo.dtd" >
<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
xmlns:html="http://www.w3.org/TR/REC-html40"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:web="http://home.netscape.com/WEB-rdf#"
id="privacyInfo"
class="dialog"
width="600" height="400" screenX="40" screenY="40"
persist="width height screenX screenY"
orient="vertical"
title="&privacyInfo.title;"
onload="Init()">
<html:script language="JavaScript" src="chrome://global/content/strres.js" />
<html:script language="JavaScript" src="chrome://communicator/content/P3PPrivacyMetInfo.js"/>
<box class="box-smallheader" title="&privacyinfo.header;"/>
<text class="header" value="&policymet.text;"/>
<separator/>
<box flex="1">
<tree id="privacyTree" flex="1" datasources="rdf:null" ref="NC:P3PPolicyRoot"
containment="http://home.netscape.com/NC-rdf#P3PEntries">
<treecolgroup>
<treecol style="width:300px" flex="1"/>
<splitter class="tree-splitter"/>
<treecol style="width:300px" flex="1"/>
</treecolgroup>
<treehead>
<treerow>
<treecell class="treecell-header outset" value="&privacypolicy.text;"/>
<treecell class="treecell-header outset"/>
</treerow>
</treehead>
<template>
<rule>
<conditions>
<content uri="?uri"/>
<triple subject="?uri"
predicate="http://home.netscape.com/NC-rdf#P3PEntries"
object="?entries"/>
<member container="?entries" child="?entry"/>
<triple subject="?entry"
predicate="http://home.netscape.com/NC-rdf#P3PTitle"
object="?title"/>
<triple subject="?entry"
predicate="http://home.netscape.com/NC-rdf#P3PValue"
object="?value"/>
</conditions>
<action>
<treechildren flex="1">
<treeitem uri="?entry">
<treerow>
<treecell class="treecell-indent" value="?title"/>
<treecell class="treecell-indent" value="?value"/>
</treerow>
</treeitem>
</treechildren>
</action>
</rule>
<rule>
<conditions>
<content uri="?uri"/>
<triple subject="?uri"
predicate="http://home.netscape.com/NC-rdf#P3PEntries"
object="?entries"/>
<member container="?entries" child="?entry"/>
<triple subject="?entry"
predicate="http://home.netscape.com/NC-rdf#P3PTitle"
object="?title"/>
</conditions>
<action>
<treechildren flex="1">
<treeitem uri="?entry">
<treerow>
<treecell class="treecell-indent" value="?title"/>
</treerow>
</treeitem>
</treechildren>
</action>
</rule>
</template>
</tree>
</box>
<separator/>
<box align="horizontal" autostretch="never">
<spring flex="1"/>
<button id="ok" value="&okButton.label;" default="true" align="center" onclick="doOKButton()"/>
<spring flex="1"/>
</box>
</window>

View File

@@ -0,0 +1,36 @@
/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Mozilla 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/MPL/
*
* 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 imitations under the License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is International
* Business Machines Corporation. Portions created by IBM
* Corporation are Copyright (C) 2000 International Business
* Machines Corporation. All Rights Reserved.
*
* Contributor(s): IBM Corporation.
*
*/
var privacyUI;
var ds;
var privacyTree;
function Init() {
privacyUI = window.arguments[0];
ds = privacyUI.GetPrivacyInfo();
privacyTree = document.getElementById("privacyTree");
privacyTree.database.AddDataSource(ds);
privacyTree.builder.rebuild();
}

View File

@@ -0,0 +1,127 @@
<?xml version="1.0"?>
<!--
- The contents of this file are subject to the Mozilla 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/MPL/
-
- 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 imitations under the License.
-
- The Original Code is mozilla.org code.
-
- The Initial Developer of the Original Code is International
- Business Machines Corporation. Portions created by IBM
- Corporation are Copyright (C) 2000 International Business
- Machines Corporation. All Rights Reserved.
-
- Contributor(s): IBM Corporation.
-
-->
<?xml-stylesheet href="chrome://communicator/skin/" type="text/css"?>
<?xul-overlay href="chrome://global/content/dialogOverlay.xul"?>
<!DOCTYPE window SYSTEM "chrome://communicator/locale/P3PPrivacyInfo.dtd" >
<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
xmlns:html="http://www.w3.org/TR/REC-html40"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:web="http://home.netscape.com/WEB-rdf#"
id="privacyInfo"
class="dialog"
width="600" height="400" screenX="40" screenY="40"
persist="width height screenX screenY"
orient="vertical"
title="&privacyInfo.title;"
onload="Init()">
<html:script language="JavaScript" src="chrome://global/content/strres.js" />
<html:script language="JavaScript" src="chrome://communicator/content/P3PPrivacyNotMetInfo.js"/>
<box class="box-smallheader" title="&privacyinfo.header;"/>
<text class="header" value="&policynotmet.text;"/>
<separator/>
<box flex="1">
<tree id="privacyTree" flex="1" datasources="rdf:null" ref="NC:P3PPolicyRoot"
containment="http://home.netscape.com/NC-rdf#P3PEntries">
<treecolgroup>
<treecol style="width:300px" flex="1"/>
<splitter class="tree-splitter"/>
<treecol style="width:300px" flex="1"/>
</treecolgroup>
<treehead>
<treerow>
<treecell class="treecell-header outset" value="&privacypolicy.text;"/>
<treecell class="treecell-header outset"/>
</treerow>
</treehead>
<template>
<rule>
<conditions>
<content uri="?uri"/>
<triple subject="?uri"
predicate="http://home.netscape.com/NC-rdf#P3PEntries"
object="?entries"/>
<member container="?entries" child="?entry"/>
<triple subject="?entry"
predicate="http://home.netscape.com/NC-rdf#P3PTitle"
object="?title"/>
<triple subject="?entry"
predicate="http://home.netscape.com/NC-rdf#P3PValue"
object="?value"/>
</conditions>
<action>
<treechildren flex="1">
<treeitem uri="?entry">
<treerow>
<treecell class="treecell-indent" value="?title"/>
<treecell class="treecell-indent" value="?value"/>
</treerow>
</treeitem>
</treechildren>
</action>
</rule>
<rule>
<conditions>
<content uri="?uri"/>
<triple subject="?uri"
predicate="http://home.netscape.com/NC-rdf#P3PEntries"
object="?entries"/>
<member container="?entries" child="?entry"/>
<triple subject="?entry"
predicate="http://home.netscape.com/NC-rdf#P3PTitle"
object="?title"/>
</conditions>
<action>
<treechildren flex="1">
<treeitem uri="?entry">
<treerow>
<treecell class="treecell-indent" value="?title"/>
</treerow>
</treeitem>
</treechildren>
</action>
</rule>
</template>
</tree>
</box>
<separator/>
<box align="horizontal" autostretch="never">
<spring flex="1"/>
<button id="ok" value="&okButton.label;" default="true" align="center" onclick="doOKButton()"/>
<spring flex="1"/>
</box>
</window>

View File

@@ -0,0 +1,45 @@
#
# The contents of this file are subject to the Mozilla 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/MPL/
#
# 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 imitations under the License.
#
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is International
# Business Machines Corporation. Portions created by IBM
# Corporation are Copyright (C) 2000 International Business
# Machines Corporation. All Rights Reserved.
#
# Contributor(s): IBM Corporation.
#
DEPTH = ..\..\..\..
include <$(DEPTH)\config\rules.mak>
install::
$(MAKE_INSTALL) pref-P3P.xul $(DIST)\bin\chrome\comm\content\communicator\pref
$(MAKE_INSTALL) pref-P3P.js $(DIST)\bin\chrome\comm\content\communicator\pref
$(MAKE_INSTALL) pref-P3Pcust.xul $(DIST)\bin\chrome\comm\content\communicator\pref
$(MAKE_INSTALL) pref-P3Pcust.js $(DIST)\bin\chrome\comm\content\communicator\pref
$(MAKE_INSTALL) privacyOverlay.xul $(DIST)\bin\chrome\comm\content\communicator
$(MAKE_INSTALL) privacyUI.js $(DIST)\bin\chrome\comm\content\communicator
$(MAKE_INSTALL) P3PPrivacyMetInfo.xul $(DIST)\bin\chrome\comm\content\communicator
$(MAKE_INSTALL) P3PPrivacyMetInfo.js $(DIST)\bin\chrome\comm\content\communicator
$(MAKE_INSTALL) P3PPrivacyNotMetInfo.xul $(DIST)\bin\chrome\comm\content\communicator
$(MAKE_INSTALL) P3PPrivacyNotMetInfo.js $(DIST)\bin\chrome\comm\content\communicator
$(MAKE_INSTALL) P3PNoPrivacyInfo.xul $(DIST)\bin\chrome\comm\content\communicator
$(MAKE_INSTALL) P3PNoPrivacyInfo.js $(DIST)\bin\chrome\comm\content\communicator
$(MAKE_INSTALL) P3PBadPrivacyInfo.xul $(DIST)\bin\chrome\comm\content\communicator
$(MAKE_INSTALL) P3PBadPrivacyInfo.js $(DIST)\bin\chrome\comm\content\communicator
$(MAKE_INSTALL) P3PPartialPrivacyInfo.xul $(DIST)\bin\chrome\comm\content\communicator
$(MAKE_INSTALL) P3PPartialPrivacyInfo.js $(DIST)\bin\chrome\comm\content\communicator
$(MAKE_INSTALL) P3PInProgressInfo.xul $(DIST)\bin\chrome\comm\content\communicator
$(MAKE_INSTALL) P3PInProgressInfo.js $(DIST)\bin\chrome\comm\content\communicator
$(MAKE_INSTALL) P3PBaseDataSchema.xml $(DIST)\bin\components

View File

@@ -0,0 +1,432 @@
/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Mozilla 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/MPL/
*
* 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 imitations under the License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is International
* Business Machines Corporation. Portions created by IBM
* Corporation are Copyright (C) 2000 International Business
* Machines Corporation. All Rights Reserved.
*
* Contributor(s): IBM Corporation.
*
*/
function Startup() {
DoEnableService();
DoEnableSettings();
}
function DoEnableService() {
var enable_setting = document.getElementById( "P3PServiceEnabled" );
var warn0_setting = document.getElementById( "P3PWarningNotPrivate" );
var warn1_setting = document.getElementById( "P3PWarningPartialPrivacy" );
var warn2_setting = document.getElementById( "P3PWarningPostToNotPrivate" );
var warn3_setting = document.getElementById( "P3PWarningPostToBrokenPolicy" );
var warn4_setting = document.getElementById( "P3PWarningPostToNoPolicy" );
var pref = Components.classes["@mozilla.org/preferences;1"].getService();
pref = pref.QueryInterface( Components.interfaces.nsIPref );
if (enable_setting.checked) {
warn0_setting.removeAttribute( "disabled" );
warn1_setting.removeAttribute( "disabled" );
warn2_setting.removeAttribute( "disabled" );
warn3_setting.removeAttribute( "disabled" );
warn4_setting.removeAttribute( "disabled" );
// Look for the warning settings. If not defined then an exception will occur.
// If exception occurs then set the checkbox.
try {
pref.GetBoolPref( "P3P.warningnotprivate" );
}
catch (ex) {
warn0_setting.setAttribute("checked", "true");
}
try {
pref.GetBoolPref( "P3P.warningpartialprivacy" );
}
catch (ex) {
warn1_setting.setAttribute("checked", "true");
}
try {
pref.GetBoolPref( "P3P.warningposttonotprivate" );
}
catch (ex) {
warn2_setting.setAttribute("checked", "true");
}
try {
pref.GetBoolPref( "P3P.warningposttobrokenpolicy" );
}
catch (ex) {
warn3_setting.setAttribute("checked", "true");
}
try {
pref.GetBoolPref( "P3P.warningposttonopolicy" );
}
catch (ex) {
warn4_setting.setAttribute("checked", "true");
}
}
else {
warn0_setting.setAttribute( "disabled", "true" );
warn1_setting.setAttribute( "disabled", "true" );
warn2_setting.setAttribute( "disabled", "true" );
warn3_setting.setAttribute( "disabled", "true" );
warn4_setting.setAttribute( "disabled", "true" );
}
// Allow other settings to be updated
DoEnableSettings();
}
function DoEnableSettings() {
var enable_service = document.getElementById( "P3PServiceEnabled" );
var level_setting = document.getElementById( "P3PLevel" );
if (enable_service.checked) {
// Service is enabled...
EnableTree(level_setting);
try {
var pref = Components.classes["@mozilla.org/preferences;1"].getService();
pref = pref.QueryInterface( Components.interfaces.nsIPref );
var level = pref.GetIntPref( "P3P.level" );
}
catch (ex) {
level_setting.setAttribute( "data", "0" );
}
DoMapLevel();
}
else {
// Service is not enabled... disable all controls
DisableTree(level_setting);
}
}
function EnableTree(item) {
item.removeAttribute( "disabled" );
for( var i = 0; i < item.childNodes.length; i++ ) {
EnableTree(item.childNodes[i]);
}
}
function DisableTree(item) {
item.setAttribute( "disabled", "true" );
for( var i = 0; i < item.childNodes.length; i++ ) {
DisableTree(item.childNodes[i]);
}
}
var settingIDs = ["P3PPhysicalAdmin", "P3PPhysicalHistorical",
"P3PPhysicalDevelop", "P3PPhysicalPseudo-analysis",
"P3PPhysicalIndividual-analysis", "P3PPhysicalCustomization",
"P3PPhysicalTailoring", "P3PPhysicalPseudo-decision",
"P3PPhysicalIndividual-decision", "P3PPhysicalCurrent",
"P3PPhysicalContact", "P3PPhysicalTelemarketing",
"P3PPhysicalOther-purpose", "P3PPhysicalSharing",
"P3PLocationAdmin", "P3PLocationHistorical",
"P3PLocationDevelop", "P3PLocationPseudo-analysis",
"P3PLocationIndividual-analysis", "P3PLocationCustomization",
"P3PLocationTailoring", "P3PLocationPseudo-decision",
"P3PLocationIndividual-decision", "P3PLocationCurrent",
"P3PLocationContact", "P3PLocationTelemarketing",
"P3PLocationOther-purpose", "P3PLocationSharing",
"P3POnlineAdmin", "P3POnlineHistorical",
"P3POnlineDevelop", "P3POnlinePseudo-analysis",
"P3POnlineIndividual-analysis", "P3POnlineCustomization",
"P3POnlineTailoring", "P3POnlinePseudo-decision",
"P3POnlineIndividual-decision", "P3POnlineCurrent",
"P3POnlineContact", "P3POnlineTelemarketing",
"P3POnlineOther-purpose", "P3POnlineSharing",
"P3PComputerAdmin", "P3PComputerHistorical",
"P3PComputerDevelop", "P3PComputerPseudo-analysis",
"P3PComputerIndividual-analysis", "P3PComputerCustomization",
"P3PComputerTailoring", "P3PComputerPseudo-decision",
"P3PComputerIndividual-decision", "P3PComputerCurrent",
"P3PComputerContact", "P3PComputerTelemarketing",
"P3PComputerOther-purpose", "P3PComputerSharing",
"P3PStateAdmin", "P3PStateHistorical",
"P3PStateDevelop", "P3PStatePseudo-analysis",
"P3PStateIndividual-analysis", "P3PStateCustomization",
"P3PStateTailoring", "P3PStatePseudo-decision",
"P3PStateIndividual-decision", "P3PStateCurrent",
"P3PStateContact", "P3PStateTelemarketing",
"P3PStateOther-purpose", "P3PStateSharing",
"P3PUniqueIDAdmin", "P3PUniqueIDHistorical",
"P3PUniqueIDDevelop", "P3PUniqueIDPseudo-analysis",
"P3PUniqueIDIndividual-analysis", "P3PUniqueIDCustomization",
"P3PUniqueIDTailoring", "P3PUniqueIDPseudo-decision",
"P3PUniqueIDIndividual-decision", "P3PUniqueIDCurrent",
"P3PUniqueIDContact", "P3PUniqueIDTelemarketing",
"P3PUniqueIDOther-purpose", "P3PUniqueIDSharing",
"P3PGovernmentAdmin", "P3PGovernmentHistorical",
"P3PGovernmentDevelop", "P3PGovernmentPseudo-analysis",
"P3PGovernmentIndividual-analysis", "P3PGovernmentCustomization",
"P3PGovernmentTailoring", "P3PGovernmentPseudo-decision",
"P3PGovernmentIndividual-decision", "P3PGovernmentCurrent",
"P3PGovernmentContact", "P3PGovernmentTelemarketing",
"P3PGovernmentOther-purpose", "P3PGovernmentSharing",
"P3PPurchaseAdmin", "P3PPurchaseHistorical",
"P3PPurchaseDevelop", "P3PPurchasePseudo-analysis",
"P3PPurchaseIndividual-analysis", "P3PPurchaseCustomization",
"P3PPurchaseTailoring", "P3PPurchasePseudo-decision",
"P3PPurchaseIndividual-decision", "P3PPurchaseCurrent",
"P3PPurchaseContact", "P3PPurchaseTelemarketing",
"P3PPurchaseOther-purpose", "P3PPurchaseSharing",
"P3PFinancialAdmin", "P3PFinancialHistorical",
"P3PFinancialDevelop", "P3PFinancialPseudo-analysis",
"P3PFinancialIndividual-analysis", "P3PFinancialCustomization",
"P3PFinancialTailoring", "P3PFinancialPseudo-decision",
"P3PFinancialIndividual-decision", "P3PFinancialCurrent",
"P3PFinancialContact", "P3PFinancialTelemarketing",
"P3PFinancialOther-purpose", "P3PFinancialSharing",
"P3PHealthAdmin", "P3PHealthHistorical",
"P3PHealthDevelop", "P3PHealthPseudo-analysis",
"P3PHealthIndividual-analysis", "P3PHealthCustomization",
"P3PHealthTailoring", "P3PHealthPseudo-decision",
"P3PHealthIndividual-decision", "P3PHealthCurrent",
"P3PHealthContact", "P3PHealthTelemarketing",
"P3PHealthOther-purpose", "P3PHealthSharing",
"P3PPoliticalAdmin", "P3PPoliticalHistorical",
"P3PPoliticalDevelop", "P3PPoliticalPseudo-analysis",
"P3PPoliticalIndividual-analysis", "P3PPoliticalCustomization",
"P3PPoliticalTailoring", "P3PPoliticalPseudo-decision",
"P3PPoliticalIndividual-decision", "P3PPoliticalCurrent",
"P3PPoliticalContact", "P3PPoliticalTelemarketing",
"P3PPoliticalOther-purpose", "P3PPoliticalSharing",
"P3PNavigationAdmin", "P3PNavigationHistorical",
"P3PNavigationDevelop", "P3PNavigationPseudo-analysis",
"P3PNavigationIndividual-analysis", "P3PNavigationCustomization",
"P3PNavigationTailoring", "P3PNavigationPseudo-decision",
"P3PNavigationIndividual-decision", "P3PNavigationCurrent",
"P3PNavigationContact", "P3PNavigationTelemarketing",
"P3PNavigationOther-purpose", "P3PNavigationSharing",
"P3PInteractiveAdmin", "P3PInteractiveHistorical",
"P3PInteractiveDevelop", "P3PInteractivePseudo-analysis",
"P3PInteractiveIndividual-analysis", "P3PInteractiveCustomization",
"P3PInteractiveTailoring", "P3PInteractivePseudo-decision",
"P3PInteractiveIndividual-decision", "P3PInteractiveCurrent",
"P3PInteractiveContact", "P3PInteractiveTelemarketing",
"P3PInteractiveOther-purpose", "P3PInteractiveSharing",
"P3PDemographicAdmin", "P3PDemographicHistorical",
"P3PDemographicDevelop", "P3PDemographicPseudo-analysis",
"P3PDemographicIndividual-analysis", "P3PDemographicCustomization",
"P3PDemographicTailoring", "P3PDemographicPseudo-decision",
"P3PDemographicIndividual-decision", "P3PDemographicCurrent",
"P3PDemographicContact", "P3PDemographicTelemarketing",
"P3PDemographicOther-purpose", "P3PDemographicSharing",
"P3PPreferenceAdmin", "P3PPreferenceHistorical",
"P3PPreferenceDevelop", "P3PPreferencePseudo-analysis",
"P3PPreferenceIndividual-analysis", "P3PPreferenceCustomization",
"P3PPreferenceTailoring", "P3PPreferencePseudo-decision",
"P3PPreferenceIndividual-decision", "P3PPreferenceCurrent",
"P3PPreferenceContact", "P3PPreferenceTelemarketing",
"P3PPreferenceOther-purpose", "P3PPreferenceSharing",
"P3PContentAdmin", "P3PContentHistorical",
"P3PContentDevelop", "P3PContentPseudo-analysis",
"P3PContentIndividual-analysis", "P3PContentCustomization",
"P3PContentTailoring", "P3PContentPseudo-decision",
"P3PContentIndividual-decision", "P3PContentCurrent",
"P3PContentContact", "P3PContentTelemarketing",
"P3PContentOther-purpose", "P3PContentSharing",
"P3POtherAdmin", "P3POtherHistorical",
"P3POtherDevelop", "P3POtherPseudo-analysis",
"P3POtherIndividual-analysis", "P3POtherCustomization",
"P3POtherTailoring", "P3POtherPseudo-decision",
"P3POtherIndividual-decision", "P3POtherCurrent",
"P3POtherContact", "P3POtherTelemarketing",
"P3POtherOther-purpose", "P3POtherSharing"];
// It is imperitive that the order in the following matrix arrays be maintained with the order in the settingIDs array above.
// admin historical develop pseudo- individual- customization tailoring pseudo- individual- current contact telemarketing other- Sharing
// analysis analysis decision decision purpose
var low_matrix = [ true, true, true, true, true, true, true, true, true, true, true, true, false, true, // Physical
true, true, true, true, true, true, true, true, true, true, true, true, false, true, // Location
true, true, true, true, true, true, true, true, true, true, true, true, false, true, // Online
true, true, true, true, true, true, true, true, true, true, true, true, false, true, // Computer
true, true, true, true, true, true, true, true, true, true, true, true, false, true, // State
false, false, false, false, false, false, false, false, false, true, false, false, false, false, // UniqueID
false, false, false, false, false, false, false, false, false, true, false, false, false, false, // Government
false, false, false, false, false, false, false, false, false, true, false, false, false, false, // Purchase
false, false, false, false, false, false, false, false, false, true, false, false, false, false, // Financial
true, true, true, true, true, true, true, true, true, true, true, true, false, true, // Health
true, true, true, true, true, true, true, true, true, true, true, true, false, true, // Political
true, true, true, true, true, true, true, true, true, true, true, true, false, true, // Navigation
true, true, true, true, true, true, true, true, true, true, true, true, false, true, // Interactive
true, true, true, true, true, true, true, true, true, true, true, true, false, true, // Demographic
true, true, true, true, true, true, true, true, true, true, true, true, false, true, // Preference
true, true, true, true, true, true, true, true, true, true, true, true, false, true, // Content
false, false, false, false, false, false, false, false, false, true, false, false, false, false // Other
];
// admin historical develop pseudo- individual- customization tailoring pseudo- individual- current contact telemarketing other- Sharing
// analysis analysis decision decision purpose
var medium_matrix = [ true, true, true, true, true, true, true, true, true, true, true, true, false, false, // Physical
true, true, true, true, true, true, true, true, true, true, true, true, false, false, // Location
true, true, true, true, true, true, true, true, true, true, true, true, false, false, // Online
true, true, true, true, true, true, true, true, true, true, true, true, false, false, // Computer
true, true, true, true, true, true, true, true, true, true, true, true, false, false, // State
false, false, false, false, false, false, false, false, false, false, false, false, false, false, // UniqueID
false, false, false, false, false, false, false, false, false, false, false, false, false, false, // Government
false, false, false, false, false, false, false, false, false, false, false, false, false, false, // Purchase
false, false, false, false, false, false, false, false, false, false, false, false, false, false, // Financial
true, true, true, true, true, true, true, true, true, true, true, true, false, false, // Health
true, true, true, true, true, true, true, true, true, true, true, true, false, false, // Political
true, true, true, true, true, true, true, true, true, true, true, true, false, false, // Navigation
true, true, true, true, true, true, true, true, true, true, true, true, false, false, // Interactive
true, true, true, true, true, true, true, true, true, true, true, true, false, false, // Demographic
true, true, true, true, true, true, true, true, true, true, true, true, false, false, // Preference
true, true, true, true, true, true, true, true, true, true, true, true, false, false, // Content
false, false, false, false, false, false, false, false, false, false, false, false, false, false // Other
];
// admin historical develop pseudo- individual- customization tailoring pseudo- individual- current contact telemarketing other- Sharing
// analysis analysis decision decision purpose
var high_matrix = [ false, false, false, false, false, false, false, false, false, true, false, false, false, false, // Physical
false, false, false, false, false, false, false, false, false, true, false, false, false, false, // Location
false, false, false, false, false, false, false, false, false, true, false, false, false, false, // Online
true, true, true, false, false, true, true, true, true, true, false, false, false, false, // Computer
true, true, true, false, false, true, true, true, true, true, false, false, false, false, // State
false, false, false, false, false, false, false, false, false, false, false, false, false, false, // UniqueID
false, false, false, false, false, false, false, false, false, false, false, false, false, false, // Government
false, false, false, false, false, false, false, false, false, false, false, false, false, false, // Purchase
false, false, false, false, false, false, false, false, false, false, false, false, false, false, // Financial
false, false, false, false, false, false, false, false, false, false, false, false, false, false, // Health
false, false, false, false, false, false, false, false, false, false, false, false, false, false, // Political
true, true, true, false, false, true, true, true, true, true, false, false, false, false, // Navigation
true, true, true, false, false, true, true, true, true, true, false, false, false, false, // Interactive
false, false, false, false, false, false, false, false, false, false, false, false, false, false, // Demographic
false, false, false, false, false, false, false, false, false, false, false, false, false, false, // Preference
false, false, false, false, false, false, false, false, false, false, false, false, false, false, // Content
false, false, false, false, false, false, false, false, false, false, false, false, false, false // Other
];
function DoMapLevel() {
var level = document.getElementById( "P3PLevel" );
if (level.data != "3") {
var custradio = document.getElementById( "custradio" );
custradio.setAttribute("disabled", "true");
for (var i = 0; i < settingIDs.length; i++) {
var element = document.getElementById( settingIDs[i] );
if (level.data == "0") {
element.checked = low_matrix[i];
}
else if (level.data == "1") {
element.checked = medium_matrix[i];
}
else if (level.data == "2") {
element.checked = high_matrix[i];
}
}
}
}
function doCustomize() {
// Save the current settings so that we can check if the customize window changed
// any of them.
var savedSettings = [false, false, false, false, false, false, false, false, false, false, false, false, false, false,
false, false, false, false, false, false, false, false, false, false, false, false, false, false,
false, false, false, false, false, false, false, false, false, false, false, false, false, false,
false, false, false, false, false, false, false, false, false, false, false, false, false, false,
false, false, false, false, false, false, false, false, false, false, false, false, false, false,
false, false, false, false, false, false, false, false, false, false, false, false, false, false,
false, false, false, false, false, false, false, false, false, false, false, false, false, false,
false, false, false, false, false, false, false, false, false, false, false, false, false, false,
false, false, false, false, false, false, false, false, false, false, false, false, false, false,
false, false, false, false, false, false, false, false, false, false, false, false, false, false,
false, false, false, false, false, false, false, false, false, false, false, false, false, false,
false, false, false, false, false, false, false, false, false, false, false, false, false, false,
false, false, false, false, false, false, false, false, false, false, false, false, false, false,
false, false, false, false, false, false, false, false, false, false, false, false, false, false,
false, false, false, false, false, false, false, false, false, false, false, false, false, false,
false, false, false, false, false, false, false, false, false, false, false, false, false, false,
false, false, false, false, false, false, false, false, false, false, false, false, false, false];
for (var i = 0; i < settingIDs.length; i++) {
savedSettings[i] = document.getElementById( settingIDs[i] ).checked;
}
// Open the customize window.
window.openDialog("chrome://communicator/content/pref/pref-P3Pcust.xul","P3Pcust","modal=yes,chrome,resizable=yes",
"custombox");
// Check if any settings were changed.
var settingChanged = false;
for (var i = 0; (i < settingIDs.length) && !settingChanged; i++) {
settingChanged = savedSettings[i] != document.getElementById( settingIDs[i] ).checked;
}
// If any of the settings changed, enable and set the "Custom" radio button
// (uncheck the current radio button first).
if (settingChanged) {
// Rather than try to figure out which radio button is currently checked in
// order to uncheck it, we just get all the radio buttons in the group and uncheck them all.
var level = document.getElementById( "P3PLevel" );
var groupElements = document.getElementsByAttribute( "group", "P3PLevel" );
for( var i = 0; i < groupElements.length; i++ ) {
if( groupElements[i] != level && groupElements[i].checked ) {
groupElements[i].checked = false;
groupElements[i].removeAttribute( "checked" );
}
}
// Enable the "Custom" radio button and check it.
var custradio = document.getElementById( "custradio" );
custradio.removeAttribute("disabled");
custradio.setAttribute("checked", "true");
// Set the radio group's data index to the one for the custom button.
level.setAttribute( "data", "3" );
}
}
function initCustomize() {
var tree = document.getElementById( 'categoryTree' );
var defaultItem = document.getElementById( 'defaultItem' );
tree.selectItem( defaultItem );
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,66 @@
/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Mozilla 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/MPL/
*
* 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 imitations under the License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is International
* Business Machines Corporation. Portions created by IBM
* Corporation are Copyright (C) 2000 International Business
* Machines Corporation. All Rights Reserved.
*
* Contributor(s): IBM Corporation.
*
*/
var mybox;
var elementIDs;
function Init() {
var boxname = window.arguments[0];
// Find the parent's box and make a copy of it for ourselves.
var parentBox = window.opener.document.getElementById( boxname );
if (parentBox) {
mybox = parentBox.cloneNode( "true" );
// Put our copy of the box into our window.
var insertpoint = document.getElementById( "insertboxhere" );
if (insertpoint) {
insertpoint.appendChild( mybox );
// Run the initialization code.
initCustomize();
}
}
doSetOKCancel( onOK, onCancel );
}
function onOK () {
// Copy my settings back to the parent window.
for (var i = 0; i < settingIDs.length; i++) {
var myElement = document.getElementById( settingIDs[i] );
if (myElement) {
var parentElement = window.opener.document.getElementById( settingIDs[i] );
if (parentElement) {
parentElement.setAttribute( "checked", myElement.getAttribute( "checked" ) );
}
}
}
window.close();
}
function onCancel () {
// Just bail out.
window.close();
}

View File

@@ -0,0 +1,46 @@
<?xml version="1.0"?>
<!--
- The contents of this file are subject to the Mozilla 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/MPL/
-
- 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 imitations under the License.
-
- The Original Code is mozilla.org code.
-
- The Initial Developer of the Original Code is International
- Business Machines Corporation. Portions created by IBM
- Corporation are Copyright (C) 2000 International Business
- Machines Corporation. All Rights Reserved.
-
- Contributor(s): IBM Corporation.
-
-->
<?xml-stylesheet href="chrome://communicator/skin/" type="text/css"?>
<?xul-overlay href="chrome://global/content/dialogOverlay.xul"?>
<!DOCTYPE window SYSTEM "chrome://communicator/locale/pref/pref-P3P.dtd" >
<window xmlns:html="http://www.w3.org/TR/REC-html40"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
title="&custwindow.title;"
class="dialog"
orient="vertical"
onload="Init();">
<html:script language="JavaScript" src="chrome://global/content/strres.js" />
<html:script language="JavaScript" src="chrome://communicator/content/pref/pref-P3P.js"/>
<html:script language="JavaScript" src="chrome://communicator/content/pref/pref-P3Pcust.js"/>
<html:script language="JavaScript" src="chrome://communicator/content/pref/prefutilities.js"/>
<box id="insertboxhere" orient="vertical" flex="1"/>
<separator class="groove"/>
<box id="okCancelButtons"/>
</window>

View File

@@ -0,0 +1,36 @@
<?xml version="1.0"?>
<!--
- The contents of this file are subject to the Mozilla 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/MPL/
-
- 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 imitations under the License.
-
- The Original Code is mozilla.org code.
-
- The Initial Developer of the Original Code is International
- Business Machines Corporation. Portions created by IBM
- Corporation are Copyright (C) 2000 International Business
- Machines Corporation. All Rights Reserved.
-
- Contributor(s): IBM Corporation.
-
-->
<?xml-stylesheet href="chrome://communicator/skin/privacyOverlay.css" type="text/css"?>
<!DOCTYPE window SYSTEM "chrome://communicator/locale/P3PPrivacyInfo.dtd" >
<overlay id="NavPrivacyOverlay"
xmlns:html="http://www.w3.org/1999/xhtml"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<script language="JavaScript" src="chrome://communicator/content/privacyUI.js" />
<statusbarpanel id="privacy-button" onclick="displayPrivacyInfo()" tooltip="aTooltip"/>
</overlay>

View File

@@ -0,0 +1,113 @@
/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Mozilla 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/MPL/
*
* 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 imitations under the License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is International
* Business Machines Corporation. Portions created by IBM
* Corporation are Copyright (C) 2000 International Business
* Machines Corporation. All Rights Reserved.
*
* Contributor(s): IBM Corporation.
*
*/
window.addEventListener("load", SetPrivacyButton, false);
window.addEventListener("unload", RemovePrivacyButton, false);
var privacyUI;
function SetPrivacyButton()
{
var ui = Components.classes["@mozilla.org/p3p-browser-ui;1"].createInstance();
if (ui) {
privacyUI = ui.QueryInterface(Components.interfaces.nsIP3PUI);
if (privacyUI) {
var button = document.getElementById("privacy-button");
if (button && window._content) {
privacyUI.Init(window._content, button);
}
}
}
}
function RemovePrivacyButton()
{
if (privacyUI) {
privacyUI.Close();
}
}
function displayPrivacyInfo()
{
var p3pService = Components.classes["@mozilla.org/p3p-service;1"].getService();
if (p3pService) {
p3pService = p3pService.QueryInterface(Components.interfaces.nsIP3PService);
if (p3pService) {
var isEnabled = p3pService.P3PIsEnabled();
if (isEnabled) {
if (privacyUI) {
var status = privacyUI.GetPrivacyStatus();
if (status == 1) {
window.openDialog("chrome://communicator/content/P3PNoPrivacyInfo.xul","","modal=no,chrome,resizable=yes",
privacyUI);
} else if (status == 2) {
window.openDialog("chrome://communicator/content/P3PPrivacyMetInfo.xul","","modal=no,chrome,resizable=yes",
privacyUI);
} else if (status == 3) {
window.openDialog("chrome://communicator/content/P3PPrivacyNotMetInfo.xul","","modal=no,chrome,resizable=yes",
privacyUI);
} else if (status == 4) {
window.openDialog("chrome://communicator/content/P3PPartialPrivacyInfo.xul","","modal=no,chrome,resizable=yes",
privacyUI);
} else if (status == 5) {
window.openDialog("chrome://communicator/content/P3PBadPrivacyInfo.xul","","modal=no,chrome,resizable=yes",
privacyUI);
} else if (status == 6) {
window.openDialog("chrome://communicator/content/P3PInProgressInfo.xul","","modal=no,chrome,resizable=yes",
privacyUI);
}
}
}
}
}
}
function SelectTipText() {
var result = false;
var text = document.getElementById("tiptext");
if (text) {
var statustext = document.getElementById("statustext");
if (statustext) {
var status = privacyUI.GetPrivacyStatus();
if (status == 1) {
text.setAttribute("value", statustext.getAttribute("none"));
} else if (status == 2) {
text.setAttribute("value", statustext.getAttribute("met"));
} else if (status == 3) {
text.setAttribute("value", statustext.getAttribute("notmet"));
} else if (status == 4) {
text.setAttribute("value", statustext.getAttribute("broken"));
} else if (status == 5) {
text.setAttribute("value", statustext.getAttribute("inprog"));
}
result = true;
}
}
return result;
}

View File

@@ -0,0 +1,54 @@
comm.jar:
content/communicator/pref/pref-P3P.xul (content/pref-P3P.xul)
content/communicator/pref/pref-P3P.js (content/pref-P3P.js)
content/communicator/pref/pref-P3Pcust.xul (content/pref-P3Pcust.xul)
content/communicator/pref/pref-P3Pcust.js (content/pref-P3Pcust.js)
content/communicator/privacyOverlay.xul (content/privacyOverlay.xul)
content/communicator/privacyUI.js (content/privacyUI.js)
content/communicator/P3PPrivacyMetInfo.xul (content/P3PPrivacyMetInfo.xul)
content/communicator/P3PPrivacyMetInfo.js (content/P3PPrivacyMetInfo.js)
content/communicator/P3PPrivacyNotMetInfo.xul (content/P3PPrivacyNotMetInfo.xul)
content/communicator/P3PPrivacyNotMetInfo.js (content/P3PPrivacyNotMetInfo.js)
content/communicator/P3PNoPrivacyInfo.xul (content/P3PNoPrivacyInfo.xul)
content/communicator/P3PNoPrivacyInfo.js (content/P3PNoPrivacyInfo.js))
content/communicator/P3PPartialPrivacyInfo.xul (content/P3PPartialPrivacyInfo.xul)
content/communicator/P3PPartialPrivacyInfo.js (content/P3PPartialPrivacyInfo.js))
content/communicator/P3PBadPrivacyInfo.xul (content/P3PBadPrivacyInfo.xul)
content/communicator/P3PBadPrivacyInfo.js (content/P3PBadPrivacyInfo.js))
content/communicator/P3PInProgressInfo.xul (content/P3PInProgressInfo.xul)
content/communicator/P3PInProgressInfo.js (content/P3PInProgressInfo.js)
en-US.jar:
locale/en-US/communicator/pref/pref-P3P.dtd (locale/en-US/pref-P3P.dtd)
locale/en-US/communicator/P3PPrivacyInfo.dtd (locale/en-US/P3PPrivacyInfo.dtd)
locale/en-US/communicator/P3P.properties (locale/en-US/P3P.properties)
classic.jar:
skin/classic/communicator/P3PDefault.gif (skin/classic/P3PDefault.gif)
skin/classic/communicator/P3PNoPrivacy.gif (skin/classic/P3PNoPrivacy.gif)
skin/classic/communicator/P3PPrivate.gif (skin/classic/P3PPrivate.gif)
skin/classic/communicator/P3PNotPrivate.gif (skin/classic/P3PNotPrivate.gif)
skin/classic/communicator/P3PPartialPrivacy.gif (skin/classic/P3PPartialPrivacy.gif)
skin/classic/communicator/P3PPrivacyBroken.gif (skin/classic/P3PPrivacyBroken.gif)
skin/classic/communicator/P3PPrivacyInProgress.gif (skin/classic/P3PPrivacyInProgress.gif)
skin/classic/communicator/privacyOverlay.css (skin/classic/privacyOverlay.css)
blue.jar:
skin/blue/communicator/P3PDefault.gif (skin/blue/P3PDefault.gif)
skin/blue/communicator/P3PNoPrivacy.gif (skin/blue/P3PNoPrivacy.gif)
skin/blue/communicator/P3PPrivate.gif (skin/blue/P3PPrivate.gif)
skin/blue/communicator/P3PNotPrivate.gif (skin/blue/P3PNotPrivate.gif)
skin/blue/communicator/P3PPartialPrivacy.gif (skin/blue/P3PPartialPrivacy.gif)
skin/blue/communicator/P3PPrivacyBroken.gif (skin/blue/P3PPrivacyBroken.gif)
skin/blue/communicator/P3PPrivacyInProgress.gif (skin/blue/P3PPrivacyInProgress.gif)
skin/blue/communicator/privacyOverlay.css (skin/blue/privacyOverlay.css)
modern.jar:
skin/modern/communicator/P3PDefault.gif (skin/modern/P3PDefault.gif)
skin/modern/communicator/P3PNoPrivacy.gif (skin/modern/P3PNoPrivacy.gif)
skin/modern/communicator/P3PPrivate.gif (skin/modern/P3PPrivate.gif)
skin/modern/communicator/P3PNotPrivate.gif (skin/modern/P3PNotPrivate.gif)
skin/modern/communicator/P3PPartialPrivacy.gif (skin/modern/P3PPartialPrivacy.gif)
skin/modern/communicator/P3PPrivacyBroken.gif (skin/modern/P3PPrivacyBroken.gif)
skin/modern/communicator/P3PPrivacyInProgress.gif (skin/modern/P3PPrivacyInProgress.gif)
skin/modern/communicator/privacyOverlay.css (skin/modern/privacyOverlay.css)

View File

@@ -0,0 +1,31 @@
#
# The contents of this file are subject to the Mozilla 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/MPL/
#
# 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 imitations under the License.
#
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is International
# Business Machines Corporation. Portions created by IBM
# Corporation are Copyright (C) 2000 International Business
# Machines Corporation. All Rights Reserved.
#
# Contributor(s): IBM Corporation.
#
DEPTH = ../../../..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
DIRS = en-US
include $(topsrcdir)/config/rules.mk

View File

@@ -0,0 +1,27 @@
#
# The contents of this file are subject to the Mozilla 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/MPL/
#
# 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 imitations under the License.
#
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is International
# Business Machines Corporation. Portions created by IBM
# Corporation are Copyright (C) 2000 International Business
# Machines Corporation. All Rights Reserved.
#
# Contributor(s): IBM Corporation.
#
#
# This is a list of local files which get exported
#
P3P.properties
P3PPrivacyInfo.dtd
pref-P3P.dtd

View File

@@ -0,0 +1,42 @@
#
# The contents of this file are subject to the Mozilla 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/MPL/
#
# 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 imitations under the License.
#
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is International
# Business Machines Corporation. Portions created by IBM
# Corporation are Copyright (C) 2000 International Business
# Machines Corporation. All Rights Reserved.
#
# Contributor(s): IBM Corporation.
#
DEPTH = ../../../../..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
EXPORT_PREF_CONTENT = \
$(srcdir)/pref-P3P.dtd \
$(NULL)
EXPORT_PROPERTIES_CONTENT = \
$(srcdir)/P3P.properties \
$(srcdir)/P3PPrivacyInfo.dtd \
$(NULL)
include $(topsrcdir)/config/rules.mk
install::
$(INSTALL) $(EXPORT_PREF_CONTENT) $(DIST)/bin/chrome/en-US/locale/en-US/communicator/pref
$(INSTALL) $(EXPORT_PROPERTIES_CONTENT) $(DIST)/bin/chrome/en-US/locale/en-US/communicator

View File

@@ -0,0 +1,49 @@
#
# The contents of this file are subject to the Mozilla 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/MPL/
#
# 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 imitations under the License.
#
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is International
# Business Machines Corporation. Portions created by IBM
# Corporation are Copyright (C) 2000 International Business
# Machines Corporation. All Rights Reserved.
#
# Contributor(s): IBM Corporation.
#
EntityInformation = Entity Information
PolicyInformation = Policy Information
PolicyURI = Policy URI:
PolicyDescURI = Policy Description URI:
PolicyResult = Policy Result:
PrivacyNotMet = Privacy Not Met
PrivacyMet = Privacy Met
PrivacyUndetermined = Privacy Undetermined
FailedData = Data failing to meet desired privacy:
PreferenceCombination = Preference Combination (category, purpose, sharing):
NoPolicy = No privacy policy is associated with this object.
ErrorObtainingPolicy = An error occurred while obtaining the privacy policy information for this object.
P3PTitle = Platform for Privacy Preferences
WarningNotPrivate = The privacy policy for this Web page does not meet your privacy preferences. Any information you provide might be used for purposes other than those selected in your preferences.
WarningPartialPrivacy = The privacy policy for the Web page meets your preferences. However, the Web page refers to one or more other resources that do not have privacy policies associated with them.
WarningPostToNotPrivate = Warning! The site to which you are about to send data has a privacy policy that does not meet your privacy preferences. If you want to send the data, click OK. Otherwise, click Cancel.
WarningPostToBrokenPolicy = Warning! The site to which you are about to send data has a privacy policy that was not processed successfully. If you want to send the data, click OK. Otherwise, click Cancel.
WarningPostToNoPolicy = Warning! The site to which you are about to send data does not have a privacy policy. If you want to send the data, click OK. Otherwise, click Cancel.
ShowAgain = Show me this alert next time.
StatusNone = No privacy policy
StatusMet = Privacy preferences met
StatusNotMet = Privacy preferences not met
StatusPartial = Incomplete privacy information
StatusBroken = Privacy policy broken
StatusInProg = Privacy policy retrieval in progress

View File

@@ -0,0 +1,50 @@
<!--
- The contents of this file are subject to the Mozilla 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/MPL/
-
- 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 imitations under the License.
-
- The Original Code is mozilla.org code.
-
- The Initial Developer of the Original Code is International
- Business Machines Corporation. Portions created by IBM
- Corporation are Copyright (C) 2000 International Business
- Machines Corporation. All Rights Reserved.
-
- Contributor(s): IBM Corporation.
-
-->
<!ENTITY privacyInfo.title "Platform for Privacy Preferences">
<!ENTITY notprivatewarn.text "The privacy policy for this Web page does not meet your privacy preferences. Any information you provide could be used for purposes other than those selected in your preferences.">
<!ENTITY notprivatepost.text "Warning! The information you are about to submit does not meet your privacy preferences. If you are submitting information you would like to keep private, it would be safer for you to cancel the submission.">
<!ENTITY submitbutton.label "Submit">
<!ENTITY cancelbutton.label "Cancel Submission">
<!ENTITY dontshowagain.text "Don't show me this alert next time.">
<!ENTITY privacyinfo.header "Privacy Information">
<!ENTITY currentURI.text "Current URI is: ">
<!ENTITY inprogress1.text "The system is currently retrieving the privacy policy for the current page.">
<!ENTITY inprogress2.text "Click Refresh after the page loads.">
<!ENTITY nopolicy.text "The current Web page does not have a privacy policy.">
<!ENTITY partialpolicy.text "Some elements on the Web page do not have privacy policies.">
<!ENTITY badpolicy.text "The privacy policy for the current Web page is broken.">
<!ENTITY privacypolicy.text "Privacy Policy Details">
<!ENTITY naturallangURI.text "The readable version of the privacy policy resides at:">
<!ENTITY policymet.text "Your privacy preferences have been met.">
<!ENTITY policynotmet.text "Your privacy preferences have not been met.">
<!ENTITY reasonsnotmet.text "The privacy policy does not meet your preferences for the following reasons:">
<!ENTITY refreshButton.label "Refresh">
<!ENTITY cancelButton.label "Cancel">
<!ENTITY okButton.label "OK">

View File

@@ -0,0 +1,29 @@
#
# The contents of this file are subject to the Mozilla 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/MPL/
#
# 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 imitations under the License.
#
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is International
# Business Machines Corporation. Portions created by IBM
# Corporation are Copyright (C) 2000 International Business
# Machines Corporation. All Rights Reserved.
#
# Contributor(s): IBM Corporation.
#
DEPTH = ..\..\..\..\..
include <$(DEPTH)\config\rules.mak>
install::
$(MAKE_INSTALL) pref-P3P.dtd $(DIST)\bin\chrome\en-US\locale\en-US\communicator\pref
$(MAKE_INSTALL) P3PPrivacyInfo.dtd $(DIST)\bin\chrome\en-US\locale\en-US\communicator
$(MAKE_INSTALL) P3P.properties $(DIST)\bin\chrome\en-US\locale\en-US\communicator

View File

@@ -0,0 +1,121 @@
<!--
- The contents of this file are subject to the Mozilla 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/MPL/
-
- 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 imitations under the License.
-
- The Original Code is mozilla.org code.
-
- The Initial Developer of the Original Code is International
- Business Machines Corporation. Portions created by IBM
- Corporation are Copyright (C) 2000 International Business
- Machines Corporation. All Rights Reserved.
-
- Contributor(s): IBM Corporation.
-
-->
<!ENTITY pref.label "Privacy">
<!ENTITY window.title "Platform for Privacy Preferences">
<!ENTITY custwindow.title "Customize Privacy Settings">
<!ENTITY lHeader "Privacy">
<!ENTITY rHeader "Platform for Privacy Preferences (P3P)">
<!-- Service: Enable/Disable the service -->
<!ENTITY service.label "Privacy Service">
<!ENTITY enable.label "Enable the Privacy Service">
<!ENTITY warningnotprivate.label "Warn me if a page does not meet my preferences.">
<!ENTITY warningpartialprivacy.label "Warn me if a page has elements that do not have privacy policies.">
<!ENTITY warningposttonotprivate.label "Warn me before sending data to a site that does not meet my preferences.">
<!ENTITY warningposttobrokenpolicy.label "Warn me before sending data to a site whose privacy policy was not processed successfully.">
<!ENTITY warningposttonopolicy.label "Warn me before sending data to a site that does not have a privacy policy.">
<!-- Settings: Privacy Preferences -->
<!ENTITY settings.label "Privacy Settings">
<!ENTITY selection.desc "Select a level of privacy to set pre-configured settings. Click Customize to configure your own settings.">
<!ENTITY selection.label "Level of Desired Privacy">
<!ENTITY lowlevel.label "Low -- Warn me if personal identifiers and financial information will be used for anything other than the current transaction.">
<!ENTITY mediumlevel.label "Medium -- Warn me if personal identifiers and financial information will be used for anything other than the current transaction. Warn me if personal information will be shared with others.">
<!ENTITY highlevel.label "High -- Warn me if personal information will be used for anything other than online transactions and site administration.">
<!ENTITY customlevel.label "Custom -- Customized privacy settings">
<!ENTITY custom.accesskey "c">
<!ENTITY custwindow.title "Customize Privacy Settings">
<!ENTITY customize.label "Customize">
<!ENTITY category.label "Data Category">
<!ENTITY purpose.label "Purpose">
<!ENTITY purpose.tip "These are the different purposes for which your data might be used. Select the purposes that you wish to permit for this data category. You will be warned if a site might use data of this category for purposes you do not select.">
<!ENTITY sharingtitle.label "Sharing">
<!ENTITY sharingtitle.tip "These are the ways your data might be shared with other service providers. Select the sharing that you wish to permit for this data category. You will be warned if a site might share data of this category with those you do not select.">
<!ENTITY superadmin.label "Administration">
<!ENTITY superadmin.tip "These purposes define ways the service provider might use your information to administer the Web site.">
<!ENTITY superdevelopment.label "Development">
<!ENTITY superdevelopment.tip "These purposes define ways the service provider might use your information for the development of the Web site.">
<!ENTITY supercustomize.label "Customization">
<!ENTITY supercustomize.tip "These purposes define ways the service provider might use your information to tailor the content or design of the site.">
<!ENTITY supercontact.label "Personal Contact">
<!ENTITY supercontact.tip "These purposes define ways the service provider might use your information to contact you about products or services.">
<!ENTITY current.tip "The service provider might use your information in order to complete the activity for which it was provided, for example, to return the results from a Web search, or to place an order.">
<!ENTITY admin.tip "The service provider might use your information for the administration and maintenance of the Web site and its computer system.">
<!ENTITY develop.tip "The service provider might use your information to enhance, evaluate, and review the Web site, its services, or products.">
<!ENTITY customization.tip "The service provider might use your information to tailor the content or design of the site according to specifications you selected during one or more visits to the site.">
<!ENTITY tailoring.tip "The service provider might use your information to tailor the content or design of the site according to specifications that you did not choose. The information is used for only a single visit to the site.">
<!ENTITY pseudo-analysis.tip "The service provider might use your information to build a record of you or your computer that is tied to a pseudonymous identifier. The record does not include personally identifiable information. The information is used for research, analysis, and reporting.">
<!ENTITY pseudo-decision.tip "The service provider might use your information to build a record of you or your computer that is tied to a pseudonymous identifier. The record does not include personally identifiable information. The information is used to make a decision, such as tailoring the content of a Web page.">
<!ENTITY individual-analysis.tip "The service provider might use your information to build a record of you to determine your habits, interests, or other characteristics. The record includes information that identifies you personally. The information is used for research, analysis, and reporting.">
<!ENTITY individual-decision.tip "The service provider might use your information to build a record of you to determine your habits, interests, or other characteristics. The record includes information that identifies you personally. The information is used to make a decision, such as tailoring the content of a Web page.">
<!ENTITY contact.tip "The service provider might use your information to contact you about products or services.">
<!ENTITY historical.tip "The service provider might store your information to preserve social history as governed by existing law or policy.">
<!ENTITY telemarketing.tip "The service provider might use your information to contact you by telephone about products or services.">
<!ENTITY other-purpose.tip "The service provider might use your information in ways not described by the other purposes.">
<!ENTITY sharing.label "Share information with others">
<!ENTITY sharing.tip 'The service provider might share your information with other service providers. This option includes the P3P RECIPIENT categories of "delivery", "same", "other-recipient", "unrelated", and "public".'>
<!ENTITY superphysical.label "Offline Contact Information">
<!ENTITY superphysical.tip "These categories include information that might be used to contact or locate you offline, such as an address or telephone number.">
<!ENTITY superonline.label "Online Contact Information">
<!ENTITY superonline.tip "These categories include information that might be used to contact or locate you on the Internet, such as an email address.">
<!ENTITY superuserid.label "User Identification">
<!ENTITY superuserid.tip "These categories include unique information that might be used to identify you or the computer you are currently using.">
<!ENTITY superpurchase.label "Purchase Information">
<!ENTITY superpurchase.tip "These categories include information that might be generated when you purchase a product or service, such as the method of payment.">
<!ENTITY superpersonal.label "Personal Information">
<!ENTITY superpersonal.tip "These categories include personal information about you, such as financial, medical and political information.">
<!ENTITY superhistory.label "Browsing History">
<!ENTITY superhistory.tip "These categories include information about your browsing activity on the Web, including sites you visit and terms you entered into search engines.">
<!ENTITY superdemographic.label "About You">
<!ENTITY superdemographic.tip "These categories include demographic information about you, such as your age, gender, income, and preferences.">
<!ENTITY supercontent.label "Messages">
<!ENTITY supercontent.tip "These categories include words and expressions contained in the text of your communications, such as the text of emails, bulletin board postings, or chat room communications.">
<!ENTITY superother.label "Other">
<!ENTITY superother.tip "Other types of data not described by the other data categories">
<!ENTITY physical.tip "Information about how to contact you offline, such as your address and telephone number">
<!ENTITY location.tip "Information about how to determine your current location and track you as your location changes, such as Global Positioning Satellite data">
<!ENTITY online.tip "Information about how to contact or locate you on the Internet, such as an email address">
<!ENTITY uniqueid.tip "Information about how to identify an individual. This includes identifiers used by a Web site or service, such as a user ID">
<!ENTITY computer.tip "Information about the computer system that you are is using to access the Internet, such as an IP address, domain name, browser type, or operating system">
<!ENTITY state.tip "Information used to keep track of your sessions with a Web site, such as HTTP cookies and mechanisms to implement shopping carts">
<!ENTITY government.tip "Identifiers issued by the government to consistently identify an individual, such as a Social Security Number">
<!ENTITY purchase.tip "Information actively generated by the purchase of a product or service, including information about the method of payment">
<!ENTITY financial.tip "Information about your finances including account status and activity information, such as account balance, payment, or overdraft history, and information about your use of financial instruments, such as credit or debit card information">
<!ENTITY health.tip "Information about your physical or mental health, sexual orientation, use, purchase of, or inquiry into health care services or products">
<!ENTITY political.tip "Information about membership or affiliation with groups such as religious organizations, trade unions, professional associations, or political parties">
<!ENTITY navigation.tip "Information passively generated by browsing a Web site, such as the places you visited and the length of time you spend on each page">
<!ENTITY interactive.tip "Information actively generated from interactions with a service provider through its site, such as queries to search engines">
<!ENTITY demographic.tip "Information about your characteristics, such as gender, age, or income">
<!ENTITY preference.tip "Information about your preferences, such as favorite color or musical tastes">
<!ENTITY content.tip "The words and expressions contained in the text of a communication, such as the text of emails, bulletin board postings, or chat room communications">
<!ENTITY other.tip "Other types of data not described by the other data categories">

View File

@@ -0,0 +1,26 @@
#
# The contents of this file are subject to the Mozilla 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/MPL/
#
# 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 imitations under the License.
#
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is International
# Business Machines Corporation. Portions created by IBM
# Corporation are Copyright (C) 2000 International Business
# Machines Corporation. All Rights Reserved.
#
# Contributor(s): IBM Corporation.
#
DEPTH = ..\..\..\..
DIRS = en-US
include <$(DEPTH)\config\rules.mak>

View File

@@ -0,0 +1,27 @@
#
# The contents of this file are subject to the Mozilla 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/MPL/
#
# 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 imitations under the License.
#
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is International
# Business Machines Corporation. Portions created by IBM
# Corporation are Copyright (C) 2000 International Business
# Machines Corporation. All Rights Reserved.
#
# Contributor(s): IBM Corporation.
#
DEPTH = ..\..\..
DIRS = content locale skin
include <$(DEPTH)\config\rules.mak>

View File

@@ -0,0 +1,32 @@
#
# The contents of this file are subject to the Mozilla 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/MPL/
#
# 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 imitations under the License.
#
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is International
# Business Machines Corporation. Portions created by IBM
# Corporation are Copyright (C) 2000 International Business
# Machines Corporation. All Rights Reserved.
#
# Contributor(s): IBM Corporation.
#
#
# This is a list of local files which get exported
#
privacyOverlay.css
P3PDefault.gif
P3PNoPrivacy.gif
P3PNotPrivate.gif
P3PPartialPrivacy.gif
P3PPrivacyBroken.gif
P3PPrivacyInProgress.gif
P3PPrivate.gif

View File

@@ -0,0 +1,67 @@
#
# The contents of this file are subject to the Mozilla 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/MPL/
#
# 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 imitations under the License.
#
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is International
# Business Machines Corporation. Portions created by IBM
# Corporation are Copyright (C) 2000 International Business
# Machines Corporation. All Rights Reserved.
#
# Contributor(s): IBM Corporation.
#
DEPTH = ../../../..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
CLASSIC_EXPORT_RESOURCE_CONTENT = \
$(srcdir)/classic/P3PDefault.gif \
$(srcdir)/classic/P3PNoPrivacy.gif \
$(srcdir)/classic/P3PPrivate.gif \
$(srcdir)/classic/P3PNotPrivate.gif \
$(srcdir)/classic/P3PPartialPrivacy.gif \
$(srcdir)/classic/P3PPrivacyBroken.gif \
$(srcdir)/classic/P3PPrivacyInProgress.gif \
$(srcdir)/classic/privacyOverlay.css \
$(NULL)
BLUE_EXPORT_RESOURCE_CONTENT = \
$(srcdir)/blue/P3PDefault.gif \
$(srcdir)/blue/P3PNoPrivacy.gif \
$(srcdir)/blue/P3PPrivate.gif \
$(srcdir)/blue/P3PNotPrivate.gif \
$(srcdir)/blue/P3PPartialPrivacy.gif \
$(srcdir)/blue/P3PPrivacyBroken.gif \
$(srcdir)/blue/P3PPrivacyInProgress.gif \
$(srcdir)/blue/privacyOverlay.css \
$(NULL)
MODERN_EXPORT_RESOURCE_CONTENT = \
$(srcdir)/modern/P3PDefault.gif \
$(srcdir)/modern/P3PNoPrivacy.gif \
$(srcdir)/modern/P3PPrivate.gif \
$(srcdir)/modern/P3PNotPrivate.gif \
$(srcdir)/modern/P3PPartialPrivacy.gif \
$(srcdir)/modern/P3PPrivacyBroken.gif \
$(srcdir)/modern/P3PPrivacyInProgress.gif \
$(srcdir)/modern/privacyOverlay.css \
$(NULL)
include $(topsrcdir)/config/rules.mk
install::
$(INSTALL) $(CLASSIC_EXPORT_RESOURCE_CONTENT) $(DIST)/bin/chrome/classic/skin/classic/communicator
$(INSTALL) $(BLUE_EXPORT_RESOURCE_CONTENT) $(DIST)/bin/chrome/blue/skin/blue/communicator
$(INSTALL) $(MODERN_EXPORT_RESOURCE_CONTENT) $(DIST)/bin/chrome/modern/skin/modern/communicator

Binary file not shown.

After

Width:  |  Height:  |  Size: 158 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 185 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 186 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 188 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 189 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 172 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 185 B

View File

@@ -0,0 +1,57 @@
/*
* The contents of this file are subject to the Mozilla 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/MPL/
*
* 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 imitations under the License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is International
* Business Machines Corporation. Portions created by IBM
* Corporation are Copyright (C) 2000 International Business
* Machines Corporation. All Rights Reserved.
*
* Contributor(s): IBM Corporation.
*
*/
#privacy-button
{
list-style-image:url("chrome://communicator/skin/P3PDefault.gif");
}
#privacy-button[level="yes"]
{
list-style-image:url("chrome://communicator/skin/P3PPrivate.gif");
}
#privacy-button[level="no"]
{
list-style-image:url("chrome://communicator/skin/P3PNotPrivate.gif");
}
#privacy-button[level="none"]
{
list-style-image:url("chrome://communicator/skin/P3PNoPrivacy.gif");
}
#privacy-button[level="partial"]
{
list-style-image:url("chrome://communicator/skin/P3PPartialPrivacy.gif");
}
#privacy-button[level="broken"]
{
list-style-image:url("chrome://communicator/skin/P3PPrivacyBroken.gif");
}
#privacy-button[level="inprogress"]
{
list-style-image:url("chrome://communicator/skin/P3PPrivacyInProgress.gif");
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 160 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 199 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 88 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 226 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 227 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 185 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 217 B

View File

@@ -0,0 +1,57 @@
/*
* The contents of this file are subject to the Mozilla 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/MPL/
*
* 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 imitations under the License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is International
* Business Machines Corporation. Portions created by IBM
* Corporation are Copyright (C) 2000 International Business
* Machines Corporation. All Rights Reserved.
*
* Contributor(s): IBM Corporation.
*
*/
#privacy-button
{
list-style-image:url("chrome://communicator/skin/P3PDefault.gif");
}
#privacy-button[level="yes"]
{
list-style-image:url("chrome://communicator/skin/P3PPrivate.gif");
}
#privacy-button[level="no"]
{
list-style-image:url("chrome://communicator/skin/P3PNotPrivate.gif");
}
#privacy-button[level="none"]
{
list-style-image:url("chrome://communicator/skin/P3PNoPrivacy.gif");
}
#privacy-button[level="partial"]
{
list-style-image:url("chrome://communicator/skin/P3PPartialPrivacy.gif");
}
#privacy-button[level="broken"]
{
list-style-image:url("chrome://communicator/skin/P3PPrivacyBroken.gif");
}
#privacy-button[level="inprogress"]
{
list-style-image:url("chrome://communicator/skin/P3PPrivacyInProgress.gif");
}

View File

@@ -0,0 +1,50 @@
#
# The contents of this file are subject to the Mozilla 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/MPL/
#
# 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 imitations under the License.
#
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is International
# Business Machines Corporation. Portions created by IBM
# Corporation are Copyright (C) 2000 International Business
# Machines Corporation. All Rights Reserved.
#
# Contributor(s): IBM Corporation.
#
DEPTH = ..\..\..\..
include <$(DEPTH)\config\rules.mak>
install::
$(MAKE_INSTALL) classic\P3PDefault.gif $(DIST)\bin\chrome\classic\skin\classic\communicator
$(MAKE_INSTALL) classic\P3PNoPrivacy.gif $(DIST)\bin\chrome\classic\skin\classic\communicator
$(MAKE_INSTALL) classic\P3PPrivate.gif $(DIST)\bin\chrome\classic\skin\classic\communicator
$(MAKE_INSTALL) classic\P3PNotPrivate.gif $(DIST)\bin\chrome\classic\skin\classic\communicator
$(MAKE_INSTALL) classic\P3PPartialPrivacy.gif $(DIST)\bin\chrome\classic\skin\classic\communicator
$(MAKE_INSTALL) classic\P3PPrivacyBroken.gif $(DIST)\bin\chrome\classic\skin\classic\communicator
$(MAKE_INSTALL) classic\P3PPrivacyInProgress.gif $(DIST)\bin\chrome\classic\skin\classic\communicator
$(MAKE_INSTALL) classic\privacyOverlay.css $(DIST)\bin\chrome\classic\skin\classic\communicator
$(MAKE_INSTALL) blue\P3PDefault.gif $(DIST)\bin\chrome\blue\skin\blue\communicator
$(MAKE_INSTALL) blue\P3PNoPrivacy.gif $(DIST)\bin\chrome\blue\skin\blue\communicator
$(MAKE_INSTALL) blue\P3PPrivate.gif $(DIST)\bin\chrome\blue\skin\blue\communicator
$(MAKE_INSTALL) blue\P3PNotPrivate.gif $(DIST)\bin\chrome\blue\skin\blue\communicator
$(MAKE_INSTALL) blue\P3PPartialPrivacy.gif $(DIST)\bin\chrome\blue\skin\blue\communicator
$(MAKE_INSTALL) blue\P3PPrivacyBroken.gif $(DIST)\bin\chrome\blue\skin\blue\communicator
$(MAKE_INSTALL) blue\P3PPrivacyInProgress.gif $(DIST)\bin\chrome\blue\skin\blue\communicator
$(MAKE_INSTALL) blue\privacyOverlay.css $(DIST)\bin\chrome\blue\skin\blue\communicator
$(MAKE_INSTALL) modern\P3PDefault.gif $(DIST)\bin\chrome\modern\skin\modern\communicator
$(MAKE_INSTALL) modern\P3PNoPrivacy.gif $(DIST)\bin\chrome\modern\skin\modern\communicator
$(MAKE_INSTALL) modern\P3PPrivate.gif $(DIST)\bin\chrome\modern\skin\modern\communicator
$(MAKE_INSTALL) modern\P3PNotPrivate.gif $(DIST)\bin\chrome\modern\skin\modern\communicator
$(MAKE_INSTALL) modern\P3PPartialPrivacy.gif $(DIST)\bin\chrome\modern\skin\modern\communicator
$(MAKE_INSTALL) modern\P3PPrivacyBroken.gif $(DIST)\bin\chrome\modern\skin\modern\communicator
$(MAKE_INSTALL) modern\P3PPrivacyInProgress.gif $(DIST)\bin\chrome\modern\skin\modern\communicator
$(MAKE_INSTALL) modern\privacyOverlay.css $(DIST)\bin\chrome\modern\skin\modern\communicator

Binary file not shown.

After

Width:  |  Height:  |  Size: 159 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 192 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 194 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 185 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 191 B

View File

@@ -0,0 +1,57 @@
/*
* The contents of this file are subject to the Mozilla 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/MPL/
*
* 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 imitations under the License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is International
* Business Machines Corporation. Portions created by IBM
* Corporation are Copyright (C) 2000 International Business
* Machines Corporation. All Rights Reserved.
*
* Contributor(s): IBM Corporation.
*
*/
#privacy-button
{
list-style-image:url("chrome://communicator/skin/P3PDefault.gif");
}
#privacy-button[level="yes"]
{
list-style-image:url("chrome://communicator/skin/P3PPrivate.gif");
}
#privacy-button[level="no"]
{
list-style-image:url("chrome://communicator/skin/P3PNotPrivate.gif");
}
#privacy-button[level="none"]
{
list-style-image:url("chrome://communicator/skin/P3PNoPrivacy.gif");
}
#privacy-button[level="partial"]
{
list-style-image:url("chrome://communicator/skin/P3PPartialPrivacy.gif");
}
#privacy-button[level="broken"]
{
list-style-image:url("chrome://communicator/skin/P3PPrivacyBroken.gif");
}
#privacy-button[level="inprogress"]
{
list-style-image:url("chrome://communicator/skin/P3PPrivacyInProgress.gif");
}

View File

@@ -0,0 +1,66 @@
#
# The contents of this file are subject to the Mozilla 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/MPL/
#
# 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 imitations under the License.
#
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is International
# Business Machines Corporation. Portions created by IBM
# Corporation are Copyright (C) 2000 International Business
# Machines Corporation. All Rights Reserved.
#
# Contributor(s): IBM Corporation.
#
DEPTH = ../../..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
MODULE = p3p
LIBRARY_NAME = p3p
IS_COMPONENT = 1
REQUIRES = p3p xpcom
CPPSRCS = \
nsP3PModule.cpp \
nsP3PService.cpp \
nsP3PUIService.cpp \
nsP3PHTTPNotify.cpp \
nsP3PObserverHTML.cpp \
nsP3PObserverXML.cpp \
nsP3PObserverUtils.cpp \
nsP3PObserverLayout.cpp \
nsP3PObserverFormSubmit.cpp \
nsP3PURIInformation.cpp \
nsP3PReference.cpp \
nsP3PXMLProcessor.cpp \
nsP3PPolicyRefFile.cpp \
nsP3PPolicy.cpp \
nsP3PDataSchema.cpp \
nsP3PPrivacyResult.cpp \
nsP3PTags.cpp \
nsP3PDataStruct.cpp \
nsP3PXMLUtils.cpp \
nsP3PPreferences.cpp \
nsP3PUI.cpp \
nsP3PSimpleEnumerator.cpp \
$(NULL)
EXTRA_DSO_LDOPTS = \
$(MOZ_COMPONENT_LIBS) \
$(MOZ_JS_LIBS) \
$(NSPR_LIBS) \
$(NULL)
include $(topsrcdir)/config/rules.mk

View File

@@ -0,0 +1,110 @@
#
# The contents of this file are subject to the Mozilla 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/MPL/
#
# 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 imitations under the License.
#
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is International
# Business Machines Corporation. Portions created by IBM
# Corporation are Copyright (C) 2000 International Business
# Machines Corporation. All Rights Reserved.
#
# Contributor(s): IBM Corporation.
#
DEPTH = ..\..\..
include <$(DEPTH)/config/config.mak>
MODULE = p3p
LIBRARY_NAME = p3p
DLLNAME = p3p
DLL = .\$(OBJDIR)\$(DLLNAME).dll
IS_COMPONENT = 1
REQUIRES = p3p xpcom
EXPORTS = $(NULL)
CPP_OBJS = \
.\$(OBJDIR)\nsP3PModule.obj \
.\$(OBJDIR)\nsP3PService.obj \
.\$(OBJDIR)\nsP3PUIService.obj \
.\$(OBJDIR)\nsP3PHTTPNotify.obj \
.\$(OBJDIR)\nsP3PObserverHTML.obj \
.\$(OBJDIR)\nsP3PObserverXML.obj \
.\$(OBJDIR)\nsP3PObserverUtils.obj \
.\$(OBJDIR)\nsP3PObserverLayout.obj \
.\$(OBJDIR)\nsP3PObserverFormSubmit.obj \
.\$(OBJDIR)\nsP3PURIInformation.obj \
.\$(OBJDIR)\nsP3PReference.obj \
.\$(OBJDIR)\nsP3PXMLProcessor.obj \
.\$(OBJDIR)\nsP3PPolicyRefFile.obj \
.\$(OBJDIR)\nsP3PPolicy.obj \
.\$(OBJDIR)\nsP3PDataSchema.obj \
.\$(OBJDIR)\nsP3PPrivacyResult.obj \
.\$(OBJDIR)\nsP3PTags.obj \
.\$(OBJDIR)\nsP3PDataStruct.obj \
.\$(OBJDIR)\nsP3PXMLUtils.obj \
.\$(OBJDIR)\nsP3PPreferences.obj \
.\$(OBJDIR)\nsP3PUI.obj \
.\$(OBJDIR)\nsP3PSimpleEnumerator.obj \
$(NULL)
CPPSRCS = \
nsP3PModule.cpp \
nsP3PService.cpp \
nsP3PUIService.cpp \
nsP3PHTTPNotify.cpp \
nsP3PObserverHTML.cpp \
nsP3PObserverXML.cpp \
nsP3PObserverUtils.cpp \
nsP3PObserverLayout.cpp \
nsP3PObserverFormSubmit.cpp \
nsP3PURIInformation.cpp \
nsP3PReference.cpp \
nsP3PXMLProcessor.cpp \
nsP3PPoliycRefFile.cpp \
nsP3PPolicy.cpp \
nsP3PDataSchema.cpp \
nsP3PPrivacyResult.cpp \
nsP3PTags.cpp \
nsP3PDataStruct.cpp \
nsP3PXMLUtils.cpp \
nsP3PPreferences.cpp \
nsP3PUI.cpp \
nsP3PSimpleEnumerator.cpp \
$(NULL)
LLIBS = \
$(LLIBS) \
$(LIBNSPR) \
$(DIST)\lib\xpcom.lib \
$(DIST)\lib\js3250.lib \
$(NULL)
LCFLAGS = \
$(LCFLAGS) \
$(DEFINES) \
$(NULL)
include <$(DEPTH)\config\rules.mak>
clobber::
rm -f $(DIST)\lib\$(LIBRARY_NAME).lib
rm -f $(DIST)\lib\$(DLLNAME).lib
rm -f $(DIST)\bin\components\$(DLLNAME).dll
install:: $(LIBRARY)
$(MAKE_INSTALL) $(LIBRARY) $(DIST)\lib
install:: $(DLL)
$(MAKE_INSTALL) .\$(OBJDIR)\$(DLLNAME).dll $(DIST)\bin\components

View File

@@ -0,0 +1,317 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Mozilla 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/MPL/
*
* 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 imitations under the License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is International
* Business Machines Corporation. Portions created by IBM
* Corporation are Copyright (C) 2000 International Business
* Machines Corporation. All Rights Reserved.
*
* Contributor(s): IBM Corporation.
*
*/
#ifndef nsIP3PCService_h__
#define nsIP3PCService_h__
#include "nsIP3PXMLListener.h"
#include "nsIP3PTag.h"
#include "nsIP3PDataStruct.h"
#include <nsCOMPtr.h>
#include <nsIP3PService.h>
#include <nsIURI.h>
#include <nsIDocShellTreeItem.h>
#include <nsIDOMWindowInternal.h>
#include <nsIContent.h>
#include <nsIRDFDataSource.h>
#include <nsString.h>
#include <nsVoidArray.h>
#define NS_IP3PCSERVICE_IID_STR "31430e56-d43d-11d3-9781-002035aee991"
#define NS_IP3PCSERVICE_IID {0x31430e56, 0xd43d, 0x11d3, { 0x97, 0x81, 0x00, 0x20, 0x35, 0xae, 0xe9, 0x91 }}
class nsIP3PURIInformation;
class nsIP3PPolicyRefFile;
class nsIP3PReference;
class nsIP3PPolicy;
class nsIP3PDataSchema;
class nsIP3PPrivacyResult;
// Class: nsIP3PCService
//
// This class represents the P3P Service interfaces that are only to be exposed
// to C++ callers (ie. not JavaScript)
//
class nsIP3PCService : public nsIP3PService {
public:
NS_DEFINE_STATIC_IID_ACCESSOR( NS_IP3PCSERVICE_IID );
// Function: Notification of the enabling of P3P (preference change).
//
// Parms: None
NS_IMETHOD Enabled( ) = 0;
// Function: Notification of the disabling of P3P (preference change).
//
// Parms: None
NS_IMETHOD Disabled( ) = 0;
// Function: Notification that a request to load a page has been initiated by the user.
//
// Parms: 1. In The URI being loaded
// 2. In The DocShellTreeItem that represents the browser UI instance
// 3. In The DocShellTreeItem where the URI is being loaded (possibly a frame)
NS_IMETHOD LoadingObject( nsIURI *aLoadingURI,
nsIDocShellTreeItem *aDocShellTreeItemMain,
nsIDocShellTreeItem *aDocShellTreeItemCurrent,
PRBool aInitialLoad ) = 0;
// Function: Modifies the URI associated with a PrivacyResult object (used for redirections, etc.)
//
// Parms: 1. In The original URI
// 2. In The new URI
// 3. In The DocShellTreeItem where the URI is being loaded
//
NS_IMETHOD ModifyPrivacyResult( nsIURI *aOriginalURI,
nsIURI *aNewURI,
nsIDocShellTreeItem *aDocShellTreeItem ) = 0;
// Function: Notification that a document has been completed in a browser window instance.
//
// Parms: 1. In The DocShellTreeItem that represents the browser UI instance
//
NS_IMETHOD DocumentComplete( nsIDocShellTreeItem *aDocShellTreeItemMain ) = 0;
// Function: Notification that a browser window instance is closing.
//
// Parms: 1. In The DocShellTreeItem that represents the browser UI instance
//
NS_IMETHOD ClosingBrowserWindow( nsIDocShellTreeItem *aDocShellTreeItemMain ) = 0;
// Function: Set/Save the referer information associated with a URI.
//
// Parms: 1. In The DocShellTreeItem that the URI is associated with
// 2. In The URI being loaded
// 2. In The "Referer" response header value
NS_IMETHOD SetRefererHeader( nsIDocShellTreeItem *aDocShellTreeItem,
nsIURI *aReferencingURI,
nsString& aRefererHeader ) = 0;
// Function: Set the URI spec of the PolicyRefFile specified.
//
// Parms: 1. In The DocShellTreeItem that the URI is associated with
// 2. In The URI that has specified the PolicyRefFile
// 3. In The point where the reference was made (ie. HTTP header, HTML <LINK> tag)
// 4. In The URI spec of the PolicyRefFile
NS_IMETHOD SetPolicyRefFileURISpec( nsIDocShellTreeItem *aDocShellTreeItem,
nsIURI *aReferencingURI,
PRInt32 aReferencePoint,
nsString& aPolicyRefFileURISpec ) = 0;
// Function: Set/Save the cookie information associated with a URI.
//
// Parms: 1. In The DocShellTreeItem that the URI is associated with
// 2. In The URI being loaded
// 2. In The "Set-Cookie" response header value
NS_IMETHOD SetCookieHeader( nsIDocShellTreeItem *aDocShellTreeItem,
nsIURI *aReferencingURI,
nsString& aCookieHeader ) = 0;
// Function: Check the Privacy of a URI (an internet resource).
//
// Parms: 1. In The method used on the URI (corresponds to the Policy Ref File <METHOD>)
// 2. In The URI to check
// 3. In The DocShellTreeItem that the URI is associated with
// 4. In The data to be used during processing because of asynchronous read events
// that result in multiple calls to this function
NS_IMETHOD CheckPrivacy( nsString& aMethod,
nsIURI *aCheckURI,
nsIDocShellTreeItem *aDocShellTreeItem,
nsISupports *aReadData ) = 0;
// Function: Check the Privacy of the form submission URI target.
//
// Parms: 1. In The URI of the submission
// 2. In The DOMWindow associated with the form submission
// 3. In The Content of the <FORM>
// 4. Out The indicator of whether to cancel the form submission
NS_IMETHOD CheckPrivacyFormSubmit( nsIURI *aCheckURI,
nsIDOMWindowInternal *aDOMWindowInternal,
nsIContent *aFormContent,
PRBool *aCancelSubmit ) = 0;
// Function: Get a cached Policy object.
//
// Parms: 1. In The URI spec of the Policy
// 2. Out The Policy object (null if the Policy is not cached)
NS_IMETHOD GetCachedPolicy( nsString& aPolicyURISpec,
nsIP3PPolicy **aPolicy ) = 0;
// Function: Cache a Policy object.
//
// Parms: 1. In The URI spec of the Policy
// 2. In The Policy object to cache
NS_IMETHOD_( void ) CachePolicy( nsString& aPolicyURISpec,
nsIP3PPolicy *aPolicy ) = 0;
// Function: Remove a Policy object from the cache.
//
// Parms: 1. In The URI spec of the Policy
// 2. In The Policy object to remove from the cache
NS_IMETHOD_( void ) UncachePolicy( nsString& aPolicyURISpec,
nsIP3PPolicy *aPolicy ) = 0;
// Function: Get a cached DataSchema object.
//
// Parms: 1. In The URI spec of the DataSchema
// 2. Out The DataSchema object (null if the DataSchema is not cached)
NS_IMETHOD GetCachedDataSchema( nsString& aDataSchemaURISpec,
nsIP3PDataSchema **aDataSchema ) = 0;
// Function: Cache a DataSchema object.
//
// Parms: 1. In The URI spec of the DataSchema
// 2. In The DataSchema object to cache
NS_IMETHOD_( void ) CacheDataSchema( nsString& aDataSchemaURISpec,
nsIP3PDataSchema *aDataSchema ) = 0;
// Function: Remove a DataSchema object from the cache.
//
// Parms: 1. In The URI spec of the DataSchema
// 2. In The DataSchema object to remove from the cache
NS_IMETHOD_( void ) UncacheDataSchema( nsString& aDataSchemaURISpec,
nsIP3PDataSchema *aDataSchema ) = 0;
// Function: Get the RDF description of the Privacy information
//
// Parms: 1. In The DocShellTreeItem (browser instance) corresponding to the Privacy information to obtain
// 2. Out The RDFDataSource describing the Privacy information
NS_IMETHOD GetPrivacyInfo( nsIDocShellTreeItem *aDocShellTreeItem,
nsIRDFDataSource **aDataSource ) = 0;
// Function: Determines if the URI represents the HTTP protocol
//
// Parms: 1. In The URI to check
NS_IMETHOD_( PRBool ) IsHTTPProtocol( nsIURI *aURI ) = 0;
// Function: Adds a URI spec to the list of P3P related URIs
//
// Parms: 1. In The P3P related URI spec
NS_IMETHOD_( void ) AddP3PRelatedURISpec( nsString& aP3PRelatedURISpec ) = 0;
// Function: Removes a URI spec from the list of P3P related URIs
//
// Parms: 1. In The P3P related URI spec
NS_IMETHOD_( void ) RemoveP3PRelatedURISpec( nsString& aP3PRelatedURISpec ) = 0;
// Function: Checks if the URI is in the list of P3P related URIs
//
// Parms: 1. In The URI
NS_IMETHOD_( PRBool ) IsP3PRelatedURI( nsIURI *aURI ) = 0;
// Function: Returns the time the P3P preferences were last changed.
//
// Parms: 1. Out The time the P3P preferences were last changed
NS_IMETHOD GetTimePrefsLastChanged( PRTime *aTime ) = 0;
// Function: Checks if the preferences have changed since a given time.
//
// Parms: 1. In The time to perform the check against
NS_IMETHOD_( PRBool ) PrefsChanged( PRTime aTime ) = 0;
// Function: Return the value of the boolean preference combination.
//
// Parms: 1. In The Policy <PURPOSE>
// 2. In The Policy <RECIPIENT>
// 3. In The Policy <CATEGORY>
// 4. Out The indicator as to whether the boolean preference combination is set
NS_IMETHOD GetBoolPref( nsString& aPurposeValue,
nsString& aRecipientValue,
nsString& aCategoryValue,
PRBool *aResult ) = 0;
// Function: Function pair to return a string from a string bundle.
//
// Parms: 1. In The key used to locate the string within the string bundle
// 2. Out The string contained in the string bundle
NS_IMETHOD GetLocaleString( const char *aKey,
nsString& aValue ) = 0;
NS_IMETHOD GetLocaleString( nsString& aKey,
nsString& aValue ) = 0;
};
#define NS_DECL_NSIP3PCSERVICE \
NS_IMETHOD Enabled( ); \
NS_IMETHOD Disabled( ); \
NS_IMETHOD LoadingObject( nsIURI *aLoadingURI, \
nsIDocShellTreeItem *aDocShellTreeItemMain, \
nsIDocShellTreeItem *aDocShellTreeItemCurrent, \
PRBool aInitialLoad ); \
NS_IMETHOD ModifyPrivacyResult( nsIURI *aOriginalURI, \
nsIURI *aNewURI, \
nsIDocShellTreeItem *aDocShellTreeItem ); \
NS_IMETHOD DocumentComplete( nsIDocShellTreeItem *aDocShellTreeItemMain ); \
NS_IMETHOD ClosingBrowserWindow( nsIDocShellTreeItem *aDocShellTreeItemMain ); \
NS_IMETHOD SetRefererHeader( nsIDocShellTreeItem *aDocShellTreeItem, \
nsIURI *aReferencingURI, \
nsString& aRefererHeader ); \
NS_IMETHOD SetPolicyRefFileURISpec( nsIDocShellTreeItem *aDocShellTreeItem, \
nsIURI *aReferencingURI, \
PRInt32 aReferencePoint, \
nsString& aPolicyRefFileURISpec ); \
NS_IMETHOD SetCookieHeader( nsIDocShellTreeItem *aDocShellTreeItem, \
nsIURI *aReferencingURI, \
nsString& aCookieHeader ); \
NS_IMETHOD CheckPrivacy( nsString& aMethod, \
nsIURI *aCheckURI, \
nsIDocShellTreeItem *aDocShellTreeItem, \
nsISupports *aReadData ); \
NS_IMETHOD CheckPrivacyFormSubmit( nsIURI *aCheckURI, \
nsIDOMWindowInternal *aDOMWindowInternal, \
nsIContent *aFormContent, \
PRBool *aCancelSubmit ); \
NS_IMETHOD GetCachedPolicy( nsString& aPolicyURISpec, \
nsIP3PPolicy **aPolicy ); \
NS_IMETHOD_( void ) CachePolicy( nsString& aPolicyURISpec, \
nsIP3PPolicy *aPolicy ); \
NS_IMETHOD_( void ) UncachePolicy( nsString& aPolicyURISpec, \
nsIP3PPolicy *aPolicy ); \
NS_IMETHOD GetCachedDataSchema( nsString& aDataSchemaURISpec, \
nsIP3PDataSchema **aDataSchema ); \
NS_IMETHOD_( void ) CacheDataSchema( nsString& aDataSchemaURISpec, \
nsIP3PDataSchema *aDataSchema ); \
NS_IMETHOD_( void ) UncacheDataSchema( nsString& aDataSchemaURISpec, \
nsIP3PDataSchema *aDataSchema ); \
NS_IMETHOD GetPrivacyInfo( nsIDocShellTreeItem *aDocShellTreeItem, \
nsIRDFDataSource **aDataSource ); \
NS_IMETHOD_( PRBool ) IsHTTPProtocol( nsIURI *aURI ); \
NS_IMETHOD_( void ) AddP3PRelatedURISpec( nsString& aP3PRelatedURISpec ); \
NS_IMETHOD_( void ) RemoveP3PRelatedURISpec( nsString& aP3PRelatedURISpec ); \
NS_IMETHOD_( PRBool ) IsP3PRelatedURI( nsIURI *aURI ); \
NS_IMETHOD GetTimePrefsLastChanged( PRTime *aTime ); \
NS_IMETHOD_( PRBool ) PrefsChanged( PRTime aTime ); \
NS_IMETHOD GetBoolPref( nsString& aCategoryValue, \
nsString& aPurposeValue, \
nsString& aRecipientValue, \
PRBool *aResult ); \
NS_IMETHOD GetLocaleString( const char *aKey, \
nsString& aValue ); \
NS_IMETHOD GetLocaleString( nsString& aKey, \
nsString& aValue );
#endif /* nsP3PCService_h__ */

View File

@@ -0,0 +1,64 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Mozilla 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/MPL/
*
* 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 imitations under the License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is International
* Business Machines Corporation. Portions created by IBM
* Corporation are Copyright (C) 2000 International Business
* Machines Corporation. All Rights Reserved.
*
* Contributor(s): IBM Corporation.
*
*/
#ifndef nsIP3PUI_h__
#define nsIP3PUI_h__
#include "nsISupports.h"
#include <nsIP3PUI.h>
#define NS_IP3PCUI_IID_STR "31430e62-d43d-11d3-9781-002035aee991"
#define NS_IP3PCUI_IID {0x31430e62, 0xd43d, 0x11d3, { 0x97, 0x81, 0x00, 0x20, 0x35, 0xae, 0xe9, 0x91 }}
class nsIP3PCUI : public nsIP3PUI {
public:
NS_DEFINE_STATIC_IID_ACCESSOR(NS_IP3PCUI_IID)
NS_IMETHOD MarkNoP3P(void) = 0;
NS_IMETHOD MarkNoPrivacy(void) = 0;
NS_IMETHOD MarkPrivate(void) = 0;
NS_IMETHOD MarkNotPrivate(void) = 0;
NS_IMETHOD MarkPartialPrivacy(void) = 0;
NS_IMETHOD MarkPrivacyBroken(void) = 0;
NS_IMETHOD MarkInProgress(void) = 0;
};
/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIP3PCUI \
NS_IMETHOD MarkNoP3P(void); \
NS_IMETHOD MarkNoPrivacy(void); \
NS_IMETHOD MarkPrivate(void); \
NS_IMETHOD MarkNotPrivate(void); \
NS_IMETHOD MarkPartialPrivacy(void); \
NS_IMETHOD MarkPrivacyBroken(void); \
NS_IMETHOD MarkInProgress(void);
#endif /* nsIP3PUI_h__ */

View File

@@ -0,0 +1,57 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Mozilla 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/MPL/
*
* 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 imitations under the License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is International
* Business Machines Corporation. Portions created by IBM
* Corporation are Copyright (C) 2000 International Business
* Machines Corporation. All Rights Reserved.
*
* Contributor(s): IBM Corporation.
*
*/
#ifndef nsIP3PDataSchema_h__
#define nsIP3PDataSchema_h__
#include "nsP3PXMLProcessor.h"
#include "nsIP3PTag.h"
#include "nsIP3PXMLListener.h"
#include "nsIP3PDataStruct.h"
#define NS_IP3PDATASCHEMA_IID_STR "31430e5c-d43d-11d3-9781-002035aee991"
#define NS_IP3PDATASCHEMA_IID {0x31430e5c, 0xd43d, 0x11d3, { 0x97, 0x81, 0x00, 0x20, 0x35, 0xae, 0xe9, 0x91 }}
// Class: nsIP3PDataSchema
//
// This class builds upon the nsP3PXMLProcessor class and defines interfaces
// required to process and support a DataSchema.
//
class nsIP3PDataSchema : public nsP3PXMLProcessor {
public:
NS_DEFINE_STATIC_IID_ACCESSOR(NS_IP3PDATASCHEMA_IID)
// Function: Returns the DataStruct object for a given DataStruct
//
// Parms: 1. In The DataStruct name
// 2. Out The DataStruct object
NS_IMETHOD FindDataStruct( nsString& aDataStructName,
nsIP3PDataStruct **aDataStruct ) = 0;
};
#define NS_DECL_NSIP3PDATASCHEMA \
NS_IMETHOD FindDataStruct( nsString& aDataStructName, \
nsIP3PDataStruct **aDataStruct );
#endif /* nsIP3DataSchema_h__ */

View File

@@ -0,0 +1,199 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Mozilla 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/MPL/
*
* 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 imitations under the License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is International
* Business Machines Corporation. Portions created by IBM
* Corporation are Copyright (C) 2000 International Business
* Machines Corporation. All Rights Reserved.
*
* Contributor(s): IBM Corporation.
*
*/
#ifndef nsIP3PDataStruct_h__
#define nsIP3PDataStruct_h__
#include "nsIP3PTag.h"
#include <nsCOMPtr.h>
#include <nsISupports.h>
#include <nsString.h>
#include <nsISupportsArray.h>
#include <nsISimpleEnumerator.h>
#define NS_IP3PDATASTRUCT_IID_STR "31430e5f-d43d-11d3-9781-002035aee991"
#define NS_IP3PDATASTRUCT_IID {0x31430e5f, 0xd43d, 0x11d3, { 0x97, 0x81, 0x00, 0x20, 0x35, 0xae, 0xe9, 0x91 }}
// Class: nsIP3PDataStruct
//
// This class represents a DataSchema <DATA-DEF> or <DATA-STRUCT> definition.
// All of the associated attributes (such as "structref", etc.) and
// representations of valid child tags (such as <CATEGORIES>, etc.) are saved.
//
class nsIP3PDataStruct : public nsISupports {
public:
NS_DEFINE_STATIC_IID_ACCESSOR( NS_IP3PDATASTRUCT_IID )
// Function: Returns an indicator as to whether the DataStruct object was explicitly created.
//
// A DataStruct is not explicitly created when a parent has to be implicitly created for the DataStruct tree.
// ie. dynamic.http.useragent requires dynamic and http to be implicitly created if they do not exist,
// but useragent is explicitly created.
//
// Parms: None
NS_IMETHOD_( PRBool ) IsExplicitlyCreated( ) = 0;
// Function: Gets the name of the DataStruct object.
//
// Parms: 1. Out The name of the DataStruct object
NS_IMETHOD_( void ) GetName( nsString& aName ) = 0;
// Function: Gets the full name of the DataStruct object (this includes the parent DataStruct names).
//
// Parms: 1. Out The full name of the DataStruct object
NS_IMETHOD_( void ) GetFullName( nsString& aName ) = 0;
// Function: Gets the "structref" attribute of the DataStruct object.
//
// Parms: 1. Out The "structref" attribute of the DataStruct object
NS_IMETHOD_( void ) GetStructRef( nsString& aStructRef ) = 0;
// Function: Gets the DataSchema URI spec portion of the "structref" attribute of the DataStruct object.
//
// Parms: 1. Out The DataSchema URI spec of the "structref" attribute of the DataStruct object
NS_IMETHOD_( void ) GetDataSchemaURISpec( nsString& aDataSchemaURISpec ) = 0;
// Function: Gets the DataSchema structure of the "structref" attribute of the DataStruct object.
//
// Parms: 1. Out The DataSchema structure of the "structref" attribute of the DataStruct object
NS_IMETHOD_( void ) GetDataStructName( nsString& aDataStructName ) = 0;
// Function: Gets the "short-description" attribute of the DataStruct object.
//
// Parms: 1. Out The "short-description" attribute of the DataStruct object
NS_IMETHOD_( void ) GetShortDescription( nsString& aShortDescription ) = 0;
// Function: Gets the category value Tag objects of the DataStruct object.
//
// Parms: 1. Out The category value Tag objects of the DataStruct object
NS_IMETHOD GetCategoryValues( nsISupportsArray **aCategoryValueTags ) = 0;
// Function: Function pair to add category value Tag objects to the DataStruct object.
//
// Parms: 1. In The category value Tag objects to add to the DataStruct object
NS_IMETHOD AddCategoryValues( nsISupportsArray *aCategoryValueTags ) = 0;
NS_IMETHOD AddCategoryValues( nsIP3PTag *aCategoryValueTag ) = 0;
// Function: Gets the <LONG-DESCRIPTION> Tag object of the DataStruct object.
//
// Parms: 1. Out The <LONG-DESCRIPTION> Tag object of the DataStruct object
NS_IMETHOD GetLongDescription( nsIP3PTag **aLongDescriptionTag ) = 0;
// Function: Gets the parent of the DataStruct object.
//
// Parms: 1. Out The parent DataStruct object
NS_IMETHOD GetParent( nsIP3PDataStruct **aParent ) = 0;
// Function: Sets the parent of the DataStruct object.
//
// Parms: 1. In The parent DataStruct object
NS_IMETHOD_( void ) SetParent( nsIP3PDataStruct *aParent ) = 0;
// Function: Gets the DataStruct object children.
//
// Parms: 1. Out The DataStruct object children
NS_IMETHOD GetChildren( nsISupportsArray **aChildren ) = 0;
// Function: Adds a child to the DataStruct object.
//
// Parms: 1. In The child DataStruct object to add
NS_IMETHOD AddChild( nsIP3PDataStruct *aChild ) = 0;
// Function: Removes a child from the DataStruct object.
//
// Parms: 1. In The child DataStruct object to remove
NS_IMETHOD RemoveChild( nsIP3PDataStruct *aChild ) = 0;
// Function: Removes all children from the DataStruct object.
//
// Parms: None
NS_IMETHOD_( void ) RemoveChildren( ) = 0;
// Function: Creates a copy of the DataStruct object (at the node level only).
//
// Parms: 1. In The DataStruct object to make the parent of the cloned DataStruct object
// 2. Out The cloned DataStruct object
NS_IMETHOD CloneNode( nsIP3PDataStruct *aParent,
nsIP3PDataStruct **aNewDataStruct ) = 0;
// Function: Creates a copy of the DataStruct object and it's children.
//
// Parms: 1. In The DataStruct object to make the parent of the cloned DataStruct object
// 2. Out The cloned DataStruct object
NS_IMETHOD CloneTree( nsIP3PDataStruct *aParent,
nsIP3PDataStruct **aNewDataStruct ) = 0;
// Function: Creates a copy of the children of the DataStruct object and their children.
//
// Parms: 1. In The DataStruct object to make the parent of the cloned children
NS_IMETHOD CloneChildren( nsIP3PDataStruct *aParent ) = 0;
// Function: Removes all connections (parent/children) between DataStruct objects.
//
// Parms: None
NS_IMETHOD_( void ) DestroyTree( ) = 0;
// Function: Sets the indicator that says this DataStruct has resolved it's reference.
//
// Parms: None
NS_IMETHOD_( void ) SetReferenceResolved( ) = 0;
// Function: Returns the indicator that says whether or not the reference for this DataStruct
// has been resolved.
//
// Parms: None
NS_IMETHOD_( PRBool ) IsReferenceResolved( ) = 0;
};
#define NS_DECL_NSIP3PDATASTRUCT \
NS_IMETHOD_( PRBool ) IsExplicitlyCreated( ); \
NS_IMETHOD_( void ) GetName( nsString& aName ); \
NS_IMETHOD_( void ) GetFullName( nsString& aName ); \
NS_IMETHOD_( void ) GetStructRef( nsString& aStructRef ); \
NS_IMETHOD_( void ) GetDataSchemaURISpec( nsString& aDataSchemURISpec ); \
NS_IMETHOD_( void ) GetDataStructName( nsString& aDataStructName ); \
NS_IMETHOD_( void ) GetShortDescription( nsString& aShortDescription ); \
NS_IMETHOD GetCategoryValues( nsISupportsArray **aCategoryValueTags ); \
NS_IMETHOD AddCategoryValues( nsISupportsArray *aCategoryValueTags ); \
NS_IMETHOD AddCategoryValues( nsIP3PTag *aCategoryValueTag ); \
NS_IMETHOD GetLongDescription( nsIP3PTag **aLongDescriptionTag ); \
NS_IMETHOD AddChild( nsIP3PDataStruct *aChild ); \
NS_IMETHOD RemoveChild( nsIP3PDataStruct *aChild ); \
NS_IMETHOD_( void ) RemoveChildren( ); \
NS_IMETHOD GetChildren( nsISupportsArray **aChildren ); \
NS_IMETHOD GetParent( nsIP3PDataStruct **aParent ); \
NS_IMETHOD_( void ) SetParent( nsIP3PDataStruct *aParent ); \
NS_IMETHOD CloneNode( nsIP3PDataStruct *aParent, \
nsIP3PDataStruct **aNewDataStruct ); \
NS_IMETHOD CloneTree( nsIP3PDataStruct *aParent, \
nsIP3PDataStruct **aNewDataStruct ); \
NS_IMETHOD CloneChildren( nsIP3PDataStruct *aParent ); \
NS_IMETHOD_( void ) DestroyTree( ); \
NS_IMETHOD_( void ) SetReferenceResolved( ); \
NS_IMETHOD_( PRBool ) IsReferenceResolved( );
#endif /* nsIP3PDataStruct_h___ */

View File

@@ -0,0 +1,65 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Mozilla 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/MPL/
*
* 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 imitations under the License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is International
* Business Machines Corporation. Portions created by IBM
* Corporation are Copyright (C) 2000 International Business
* Machines Corporation. All Rights Reserved.
*
* Contributor(s): IBM Corporation.
*
*/
#ifndef nsIP3PPolicy_h__
#define nsIP3PPolicy_h__
#include "nsP3PXMLProcessor.h"
#include <nsIRDFDataSource.h>
#define NS_IP3PPOLICY_IID_STR "31430e5b-d43d-11d3-9781-002035aee991"
#define NS_IP3PPOLICY_IID {0x31430e5b, 0xd43d, 0x11d3, { 0x97, 0x81, 0x00, 0x20, 0x35, 0xae, 0xe9, 0x91 }}
// Class: nsIP3PPolicy
//
// This class builds upon the nsP3PXMLProcessor class and defines interfaces
// required to process and support a Policy.
//
class nsIP3PPolicy : public nsP3PXMLProcessor {
public:
NS_DEFINE_STATIC_IID_ACCESSOR(NS_IP3PPOLICY_IID)
// Function: Compares the Policy representation to the user's preferences.
//
// Parms: None
NS_IMETHOD ComparePolicyToPrefs( PRBool& aPolicyExpired ) = 0;
// Function: Gets the RDF description of the Policy information.
//
// Parms: 1. Out The "about" attribute to be used to access the Policy information
// 2. Out The "title" attribute to be used to describe the Policy information
// 3. Out The RDFDataSource describing the Policy information
NS_IMETHOD GetPolicyDescription( nsString& aAbout,
nsString& aTitle,
nsIRDFDataSource **aDataSource ) = 0;
};
#define NS_DECL_NSIP3PPOLICY \
NS_IMETHOD ComparePolicyToPrefs( PRBool& aPolicyExpired ); \
NS_IMETHOD GetPolicyDescription( nsString& aAbout, \
nsString& aTitle, \
nsIRDFDataSource **aDataSource );
#endif /* nsIP3Policy_h__ */

View File

@@ -0,0 +1,73 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Mozilla 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/MPL/
*
* 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 imitations under the License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is International
* Business Machines Corporation. Portions created by IBM
* Corporation are Copyright (C) 2000 International Business
* Machines Corporation. All Rights Reserved.
*
* Contributor(s): IBM Corporation.
*
*/
#ifndef nsIP3PPolicyRefFile_h__
#define nsIP3PPolicyRefFile_h__
#include "nsP3PXMLProcessor.h"
#include "nsIP3PPolicy.h"
#define NS_IP3PPOLICYREFFILE_IID_STR "31430e59-d43d-11d3-9781-002035aee991"
#define NS_IP3PPOLICYREFFILE_IID {0x31430e59, 0xd43d, 0x11d3, { 0x97, 0x81, 0x00, 0x20, 0x35, 0xae, 0xe9, 0x91 }}
// Class: nsIP3PPolicyRefFile
//
// This class builds upon the nsP3PXMLProcessor class and defines interfaces
// required to process and support a PolicyRefFile.
//
class nsIP3PPolicyRefFile : public nsP3PXMLProcessor {
public:
NS_DEFINE_STATIC_IID_ACCESSOR(NS_IP3PPOLICYREFFILE_IID)
// Function: Returns the Policy URI spec associated with the method/path combination.
//
// Parms: 1. In An indicator as to whether this check is for an embedded object
// 2. In The method used
// 3. In The path
// 4. Out The reading PolicyRefFile URI spec
// 5. Out The point where the reference was made (ie. HTTP header, HTML <LINK> tag)
// 6. Out The expired PolicyRefFile URI spec
// 7. Out The point where the reference was made (ie. HTTP header, HTML <LINK> tag)
// 8. Out The Policy object
NS_IMETHOD GetPolicy( PRBool aEmbedCheck,
nsString& aURIMethod,
nsString& aURIPath,
nsString& aReadingPolicyRefFileURISpec,
PRInt32& aReadingReferencePoint,
nsString& aExpiredPolicyRefFileURISpec,
PRInt32& aExpiredReferencePoint,
nsIP3PPolicy **aPolicy ) = 0;
};
#define NS_DECL_NSIP3PPOLICYREFFILE \
NS_IMETHOD GetPolicy( PRBool aEmbedCheck, \
nsString& aURIMethod, \
nsString& aURIPath, \
nsString& aReadingPolicyRefFileURISpec, \
PRInt32& aReadingReferencePoint, \
nsString& aExpiredPolicyRefFileURISpec, \
PRInt32& aExpiredReferencePoint, \
nsIP3PPolicy **aPolicy );
#endif /* nsIP3PPolicyRefFile_h__ */

View File

@@ -0,0 +1,69 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Mozilla 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/MPL/
*
* 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 imitations under the License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is International
* Business Machines Corporation. Portions created by IBM
* Corporation are Copyright (C) 2000 International Business
* Machines Corporation. All Rights Reserved.
*
* Contributor(s): IBM Corporation.
*
*/
#ifndef nsIP3PPreferences_h__
#define nsIP3PPreferences_h__
#include <nsCOMPtr.h>
#include <nsISupports.h>
#include <nsString.h>
#define NS_IP3PPREFERENCES_IID_STR "31430e57-d43d-11d3-9781-002035aee991"
#define NS_IP3PPREFERENCES_IID {0x31430e57, 0xd43d, 0x11d3, { 0x97, 0x81, 0x00, 0x20, 0x35, 0xae, 0xe9, 0x91 }}
class nsIP3PPreferences : public nsISupports {
public:
NS_DEFINE_STATIC_IID_ACCESSOR( NS_IP3PPREFERENCES_IID )
NS_IMETHOD PrefChanged( const char *aPrefName = 0 ) = 0;
NS_IMETHOD GetTimePrefsLastChanged( PRTime *aResult ) = 0;
NS_IMETHOD_( PRBool) PrefsChanged( PRTime time ) = 0;
NS_IMETHOD GetBoolPref( const char * aPrefName,
PRBool * aResult) = 0;
NS_IMETHOD GetBoolPref( nsString aCategory,
nsString aPurpose,
nsString aRecipient,
PRBool * aResult ) = 0;
NS_IMETHOD GetBoolPref( nsCString aCategory,
nsCString aPurpose,
nsCString aRecipient,
PRBool * aResult ) = 0;
};
#define NS_DECL_NSIP3PPREFERENCES \
NS_IMETHOD PrefChanged( const char *aPrefName = 0 ); \
NS_IMETHOD GetTimePrefsLastChanged( PRTime *aResult ); \
NS_IMETHOD_( PRBool) PrefsChanged( PRTime time ); \
NS_IMETHOD GetBoolPref( const char * aPrefName, \
PRBool * aResult); \
NS_IMETHOD GetBoolPref( nsString aCategory, \
nsString aPurpose, \
nsString aRecipient, \
PRBool * aResult ); \
NS_IMETHOD GetBoolPref( nsCString aCategory, \
nsCString aPurpose, \
nsCString aRecipient, \
PRBool * aResult );
#endif /* nsIP3PPreferences_h___ */

View File

@@ -0,0 +1,137 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Mozilla 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/MPL/
*
* 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 imitations under the License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is International
* Business Machines Corporation. Portions created by IBM
* Corporation are Copyright (C) 2000 International Business
* Machines Corporation. All Rights Reserved.
*
* Contributor(s): IBM Corporation.
*
*/
#ifndef nsIP3PPrivacyResult_h__
#define nsIP3PPrivacyResult_h__
#include "nsIP3PPolicy.h"
#include <nsCOMPtr.h>
#include <nsISupports.h>
#include <nsIRDFDataSource.h>
#include <nsISupportsArray.h>
#include <nsString.h>
#define NS_IP3PPRIVACYRESULT_IID_STR "31430e5d-d43d-11d3-9781-002035aee991"
#define NS_IP3PPRIVACYRESULT_IID {0x31430e5d, 0xd43d, 0x11d3, { 0x97, 0x81, 0x00, 0x20, 0x35, 0xae, 0xe9, 0x91 }}
// Class: nsIP3PPrivacyResult
//
// This class represents the Privacy results and information associated with
// a URI and DocShellTreeItem.
//
class nsIP3PPrivacyResult : public nsISupports {
public:
NS_DEFINE_STATIC_IID_ACCESSOR(NS_IP3PPRIVACYRESULT_IID)
// Function: Sets the URI spec associated with this PrivacyResult object
//
// Parms: 1. In The URI spec
NS_IMETHOD_( void ) SetURISpec( nsString& aURISpec ) = 0;
// Function: Sets the Privacy information.
//
// Parms: 1. In The result of the comparison between the Policy and the user's preferences
// 2. In The Policy object used
NS_IMETHOD SetPrivacyResult( nsresult aPrivacyResult,
nsIP3PPolicy *aPolicy ) = 0;
// Function: Sets the overall Privacy result based upon the supplied Privacy result.
//
// Parms: 1. In The Privacy result
NS_IMETHOD SetOverallPrivacyResult( nsresult aPrivacyResult,
PRBool aChildCalling ) = 0;
// Function: Gets the RDF description of the Privacy information.
//
// Parms: 1. Out The RDFDataSource describing the Privacy information
NS_IMETHOD GetPrivacyInfo( nsIRDFDataSource **aDataSource ) = 0;
// Function: Creates the RDF description of the Privacy information.
//
// Parms: 1. In The "about" attribute to be used to access the Privacy information
// 2. In The "title" attribute to be used to describe the Privacy information
// 3. Out The RDFDataSource describing the Privacy information
NS_IMETHOD CreateRDFDescription( nsString& aAbout,
nsString& aTitle,
nsIRDFDataSource **aDataSource ) = 0;
// Function: Adds the PrivacyResult object as a child.
//
// Parms: 1. In The child PrivacyResult object to add
NS_IMETHOD AddChild( nsIP3PPrivacyResult *aChild ) = 0;
// Function: Removes the PrivacyResult object as a child.
//
// Parms: 1. In The child PrivacyResult object to remove
NS_IMETHOD RemoveChild( nsIP3PPrivacyResult *aChild ) = 0;
// Function: Removes all PrivacyResult object children
//
// Parms: 1. None
NS_IMETHOD_( void ) RemoveChildren( ) = 0;
// Function: Gets the PrivacyResult object children.
//
// Parms: 1. Out The PrivacyResult object children
NS_IMETHOD GetChildren( nsISupportsArray **aChildren ) = 0;
// Function: Sets the parent of the PrivacyResult object.
//
// Parms: 1. In The parent PrivacyResult object
NS_IMETHOD_( void ) SetParent( nsIP3PPrivacyResult *aParent ) = 0;
// Function: Gets the parent PrivacyResult object.
//
// Parms: 1. Out The parent PrivacyResult object
NS_IMETHOD GetParent( nsIP3PPrivacyResult **aParent ) = 0;
// Function: Sets the indicator that this PrivacyResult object was indirectly created.
//
// Parms: None
NS_IMETHOD_( void ) IndirectlyCreated( ) = 0;
};
#define NS_DECL_NSIP3PPRIVACYRESULT \
NS_IMETHOD_( void ) SetURISpec( nsString& aURISpec ); \
NS_IMETHOD SetPrivacyResult( nsresult aPrivacyResult, \
nsIP3PPolicy *aPolicy ); \
NS_IMETHOD SetOverallPrivacyResult( nsresult aPrivacyResult, \
PRBool aChildCalling ); \
NS_IMETHOD GetPrivacyInfo( nsIRDFDataSource **aDataSource ); \
NS_IMETHOD CreateRDFDescription( nsString& aAbout, \
nsString& aTitle, \
nsIRDFDataSource **aDataSource ); \
NS_IMETHOD AddChild( nsIP3PPrivacyResult *aChild ); \
NS_IMETHOD RemoveChild( nsIP3PPrivacyResult *aChild ); \
NS_IMETHOD_( void ) RemoveChildren( ); \
NS_IMETHOD GetChildren( nsISupportsArray **aChildren ); \
NS_IMETHOD_( void ) SetParent( nsIP3PPrivacyResult *aParent ); \
NS_IMETHOD GetParent( nsIP3PPrivacyResult **aParent ); \
NS_IMETHOD_( void ) IndirectlyCreated( );
#endif /* nsIP3PrivacyResult_h__ */

View File

@@ -0,0 +1,97 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Mozilla 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/MPL/
*
* 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 imitations under the License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is International
* Business Machines Corporation. Portions created by IBM
* Corporation are Copyright (C) 2000 International Business
* Machines Corporation. All Rights Reserved.
*
* Contributor(s): IBM Corporation.
*
*/
#ifndef nsIP3PReference_h__
#define nsIP3PReference_h__
#include "nsIP3PPolicyRefFile.h"
#include "nsIP3PPolicy.h"
#include <nsCOMPtr.h>
#include <nsISupports.h>
#include <nsVoidArray.h>
#include <nsString.h>
#define NS_IP3PREFERENCE_IID_STR "31430e5a-d43d-11d3-9781-002035aee991"
#define NS_IP3PREFERENCE_IID {0x31430e5a, 0xd43d, 0x11d3, { 0x97, 0x81, 0x00, 0x20, 0x35, 0xae, 0xe9, 0x91 }}
// Class: nsIP3PReference
//
// This class represents the PolicyRefFile objects associated with a particular host/port combination.
//
class nsIP3PReference : public nsISupports {
public:
NS_DEFINE_STATIC_IID_ACCESSOR(NS_IP3PREFERENCE_IID)
// Function: Returns the specified PolicyRefFile object if in the list of associated PolicyRefFile objects
//
// Parms: 1. In The PolicyRefFile URI spec
// 2. Out The PolicyRefFile object
NS_IMETHOD GetPolicyRefFile( nsString& aPolicyRefFileURISpec,
nsIP3PPolicyRefFile **aPolicyRefFile ) = 0;
// Function: Adds the PolicyRefFile object to the list of associated PolicyRefFile objects
//
// Parms: 1. In The PolicyRefFile URI spec
// 2. In The PolicyRefFile object
NS_IMETHOD AddPolicyRefFile( nsString& aPolicyRefFileURISpec,
nsIP3PPolicyRefFile *aPolicyRefFile ) = 0;
// Function: Gets the Policy object for a given access method and path.
// Returns the spec of an expired PolicyRefFile if encountered.
//
// Parms: 1. In An indicator as to whether this check is for an embedded object
// 2. In The URI access method used
// 3. In The URI path
// 4. Out The reading PolicyRefFile URI spec
// 5. Out The point where the reference was made (ie. HTTP header, HTML <LINK> tag)
// 6. Out The expired PolicyRefFile URI spec
// 7. Out The point where the reference was made (ie. HTTP header, HTML <LINK> tag)
// 8. Out The Policy object
NS_IMETHOD GetPolicy( PRBool aEmbedCheck,
nsString& aURIMethod,
nsString& aURIPath,
nsString& aReadingPolicyRefFileURISpec,
PRInt32& aReadingReferencePoint,
nsString& aExpiredPolicyRefFileURISpec,
PRInt32& aExpiredReferencePoint,
nsIP3PPolicy **aPolicy ) = 0;
};
#define NS_DECL_NSIP3PREFERENCE \
NS_IMETHOD GetPolicyRefFile( nsString& aPolicyRefFileURISpec, \
nsIP3PPolicyRefFile **aPolicyRefFile ); \
NS_IMETHOD AddPolicyRefFile( nsString& aPolicyRefFileURISpec, \
nsIP3PPolicyRefFile *aPolicyRefFile ); \
NS_IMETHOD GetPolicy( PRBool aEmbedCheck, \
nsString& aURIMethod, \
nsString& aURIPath, \
nsString& aReadingPolicyRefFileURISpec, \
PRInt32& aReadingReferencePoint, \
nsString& aExpiredPolicyRefFileURISpec, \
PRInt32& aExpiredReferencePoint, \
nsIP3PPolicy **aPolicy );
#endif /* nsIP3PReference_h__ */

View File

@@ -0,0 +1,163 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Mozilla 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/MPL/
*
* 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 imitations under the License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is International
* Business Machines Corporation. Portions created by IBM
* Corporation are Copyright (C) 2000 International Business
* Machines Corporation. All Rights Reserved.
*
* Contributor(s): IBM Corporation.
*
*/
#ifndef nsIP3PTag_h__
#define nsIP3PTag_h__
#include <nsCOMPtr.h>
#include <nsISupports.h>
#include <nsIDOMNode.h>
#include <nsString.h>
#include <nsISupportsArray.h>
#include <nsISimpleEnumerator.h>
#define NS_IP3PTAG_IID_STR "31430e5e-d43d-11d3-9781-002035aee991"
#define NS_IP3PTAG_IID {0x31430e5e, 0xd43d, 0x11d3, { 0x97, 0x81, 0x00, 0x20, 0x35, 0xae, 0xe9, 0x91 }}
// Class: nsIP3PTag
//
// This class represents a P3P related XML tag (such as <POLICY>, etc.).
// All of the associated attributes for each tag (such as "discuri", etc.) and
// representations of valid child tags (such as <STATEMENT>, etc.) are saved.
//
class nsIP3PTag : public nsISupports {
public:
NS_DEFINE_STATIC_IID_ACCESSOR( NS_IP3PTAG_IID )
// Function: Validates and saves the information related to the P3P XML tag.
//
// Parms: None
NS_IMETHOD ProcessTag( ) = 0;
// Function: Gets the DOMNode associated with this Tag object.
//
// Parms: 1. Out The DOMNode associated with this Tag object
NS_IMETHOD GetDOMNode( nsIDOMNode **aDOMNode ) = 0;
// Function: Gets the name of this Tag object (the name of the P3P XML tag).
//
// Parms: 1. Out The name of this Tag object
NS_IMETHOD_( void ) GetName( nsString& aName ) = 0;
// Function: Gets the namespace of this Tag object (the namespace of the P3P XML tag).
//
// Parms: 1. Out The namespace of this Tag object
NS_IMETHOD_( void ) GetNameSpace( nsString& aNameSpace ) = 0;
// Function: Gets the text of this Tag object (the text of the P3P XML tag).
//
// Parms: 1. Out The text of this Tag object
NS_IMETHOD_( void ) GetText( nsString& aText ) = 0;
// Function: Functions to get the value of an attribute of this Tag object (the
// attribute of the P3P XML tag) with the optional indicator as to whether
// the attribute was present (vs. just empty).
//
// Parms: 1. In The name of the attribute
// 2. In The namespace of the attribute
// 3. Out The value of the attribute
// 4. Out An indicator as to whether or not the attribute was present
NS_IMETHOD_( void ) GetAttribute( const char *aAttributeName,
const char *aAttributeNameSpace,
nsString& aAttributeValue,
PRBool *aAttributePresent = 0 ) = 0;
NS_IMETHOD_( void ) GetAttribute( nsString& aAttributeName,
nsString& aAttributeNameSpace,
nsString& aAttributeValue,
PRBool *aAttributePresent = 0 ) = 0;
// Function: Gets the parent Tag object.
//
// Parms: 1. Out The parent of this Tag object
NS_IMETHOD GetParent( nsIP3PTag **aTagParent ) = 0;
// Function: Sets the parent Tag object.
//
// Parms: 1. In The parent of this Tag object
NS_IMETHOD_( void ) SetParent( nsIP3PTag *aTagParent ) = 0;
// Function: Adds a child to the Tag object.
//
// Parms: 1. In The child Tag object to add
NS_IMETHOD AddChild( nsIP3PTag *aChild ) = 0;
// Function: Removes all the children of the Tag object.
//
// Parms: None
NS_IMETHOD_( void ) RemoveChildren( ) = 0;
// Function: Gets the Tag object children.
//
// Parms: 1. Out The Tag object children
NS_IMETHOD GetChildren( nsISupportsArray **aChildren ) = 0;
// Function: Creates a copy of the Tag object (at the node level only).
//
// Parms: 1. In The Tag object to make the parent of the cloned Tag object
// 2. Out The cloned Tag object
NS_IMETHOD CloneNode( nsIP3PTag *aParent,
nsIP3PTag **aNewTag ) = 0;
// Function: Creates a copy of the Tag object and it's children.
//
// Parms: 1. In The Tag object to make the parent of the cloned Tag object
// 2. Out The cloned Tag object
NS_IMETHOD CloneTree( nsIP3PTag *aParent,
nsIP3PTag **aNewTag ) = 0;
// Function: Removes all connections (parent/children) between Tag objects.
//
// Parms: None
NS_IMETHOD_( void ) DestroyTree( ) = 0;
};
#define NS_DECL_NSIP3PTAG \
NS_IMETHOD ProcessTag( ); \
NS_IMETHOD GetDOMNode( nsIDOMNode **aDOMNode ); \
NS_IMETHOD_( void ) GetName( nsString& aName ); \
NS_IMETHOD_( void ) GetNameSpace( nsString& aNameSpace ); \
NS_IMETHOD_( void ) GetText( nsString& aText ); \
NS_IMETHOD_( void ) GetAttribute( const char *aAttributeName, \
const char *aAttributeNameSpace, \
nsString& aAttributeValue, \
PRBool *aAttributePresent = 0 ); \
NS_IMETHOD_( void ) GetAttribute( nsString& aAttributeName, \
nsString& aAttributeNameSpace, \
nsString& aAttributeValue, \
PRBool *aAttributePresent = 0 ); \
NS_IMETHOD GetParent( nsIP3PTag **aTagParent ); \
NS_IMETHOD_( void ) SetParent( nsIP3PTag *aTagParent ); \
NS_IMETHOD AddChild( nsIP3PTag *aChild ); \
NS_IMETHOD_( void ) RemoveChildren( ); \
NS_IMETHOD GetChildren( nsISupportsArray **aChildren ); \
NS_IMETHOD CloneNode( nsIP3PTag *aParent, \
nsIP3PTag **aNewTag ); \
NS_IMETHOD CloneTree( nsIP3PTag *aParent, \
nsIP3PTag **aNewTag ); \
NS_IMETHOD_( void ) DestroyTree( );
#endif /* nsIP3PTag_h___ */

View File

@@ -0,0 +1,102 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Mozilla 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/MPL/
*
* 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 imitations under the License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is International
* Business Machines Corporation. Portions created by IBM
* Corporation are Copyright (C) 2000 International Business
* Machines Corporation. All Rights Reserved.
*
* Contributor(s): IBM Corporation.
*
*/
#ifndef nsIP3PUIService_h__
#define nsIP3PUIService_h__
#include "nsISupports.h"
#include "nsIP3PCUI.h"
#include <nsIDocShellTreeItem.h>
#include <nsIDOMWindowInternal.h>
#define NS_IP3PUISERVICE_IID_STR "31430e52-d43d-11d3-9781-002035aee991"
#define NS_IP3PUISERVICE_IID {0x31430e52, 0xd43d, 0x11d3, { 0x97, 0x81, 0x00, 0x20, 0x35, 0xae, 0xe9, 0x91 }}
#define NS_P3PUISERVICE_CONTRACTID "@mozilla.org/p3p-ui-service;1"
#define NS_P3PUISERVICE_CLASSNAME "P3P UI Service"
#define NS_P3PUISERVICE_CID {0x31430e53, 0xd43d, 0x11d3, { 0x97, 0x81, 0x00, 0x20, 0x35, 0xae, 0xe9, 0x91 }}
class nsIP3PUIService : public nsISupports {
public:
NS_DEFINE_STATIC_IID_ACCESSOR(NS_IP3PUISERVICE_IID)
NS_IMETHOD RegisterUIInstance( nsIDocShellTreeItem * aDocShellTreeItem,
nsIP3PCUI * P3PCUI ) = 0;
NS_IMETHOD DeregisterUIInstance( nsIDocShellTreeItem * aDocShellTreeItem,
nsIP3PCUI * P3PCUI ) = 0;
NS_IMETHOD MarkNoP3P( nsIDocShellTreeItem * aDocShellTreeItem ) = 0;
NS_IMETHOD MarkNoPrivacy( nsIDocShellTreeItem * aDocShellTreeItem ) = 0;
NS_IMETHOD MarkPrivate( nsIDocShellTreeItem * aDocShellTreeItem ) = 0;
NS_IMETHOD MarkNotPrivate( nsIDocShellTreeItem * aDocShellTreeItem ) = 0;
NS_IMETHOD MarkPartialPrivacy( nsIDocShellTreeItem * aDocShellTreeItem ) = 0;
NS_IMETHOD MarkPrivacyBroken( nsIDocShellTreeItem * aDocShellTreeItem ) = 0;
NS_IMETHOD MarkInProgress( nsIDocShellTreeItem * aDocShellTreeItem ) = 0;
NS_IMETHOD WarningNotPrivate( nsIDocShellTreeItem * aDocShellTreeItem ) = 0;
NS_IMETHOD WarningPartialPrivacy( nsIDocShellTreeItem * aDocShellTreeItem ) = 0;
NS_IMETHOD WarningPostToNotPrivate( nsIDOMWindowInternal * aDOMWindowInternal,
PRBool * aRetval ) = 0;
NS_IMETHOD WarningPostToBrokenPolicy( nsIDOMWindowInternal * aDOMWindowInternal,
PRBool * aRetval ) = 0;
NS_IMETHOD WarningPostToNoPolicy( nsIDOMWindowInternal * aDOMWindowInternal,
PRBool * aRetval ) = 0;
};
/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIP3PUISERVICE \
NS_IMETHOD RegisterUIInstance( nsIDocShellTreeItem * aDocShellTreeItem, \
nsIP3PCUI * P3PCUI ); \
NS_IMETHOD DeregisterUIInstance( nsIDocShellTreeItem * aDocShellTreeItem, \
nsIP3PCUI * P3PCUI ); \
NS_IMETHOD MarkNoP3P( nsIDocShellTreeItem * aDocShellTreeItem ); \
NS_IMETHOD MarkNoPrivacy( nsIDocShellTreeItem * aDocShellTreeItem ); \
NS_IMETHOD MarkPrivate( nsIDocShellTreeItem * aDocShellTreeItem ); \
NS_IMETHOD MarkNotPrivate( nsIDocShellTreeItem * aDocShellTreeItem ); \
NS_IMETHOD MarkPartialPrivacy( nsIDocShellTreeItem * aDocShellTreeItem ); \
NS_IMETHOD MarkPrivacyBroken( nsIDocShellTreeItem * aDocShellTreeItem ); \
NS_IMETHOD MarkInProgress( nsIDocShellTreeItem * aDocShellTreeItem ); \
NS_IMETHOD WarningNotPrivate( nsIDocShellTreeItem * aDocShellTreeItem ); \
NS_IMETHOD WarningPartialPrivacy( nsIDocShellTreeItem * aDocShellTreeItem ); \
NS_IMETHOD WarningPostToNotPrivate( nsIDOMWindowInternal * aDOMWindowInternal, \
PRBool * aRetval ); \
NS_IMETHOD WarningPostToBrokenPolicy( nsIDOMWindowInternal * aDOMWindowInternal, \
PRBool * aRetval ); \
NS_IMETHOD WarningPostToNoPolicy( nsIDOMWindowInternal * aDOMWindowInternal, \
PRBool * aRetval );
#endif /* nsIP3PUIService_h__ */

View File

@@ -0,0 +1,103 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Mozilla 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/MPL/
*
* 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 imitations under the License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is International
* Business Machines Corporation. Portions created by IBM
* Corporation are Copyright (C) 2000 International Business
* Machines Corporation. All Rights Reserved.
*
* Contributor(s): IBM Corporation.
*
*/
#ifndef nsIP3PURIInformation_h__
#define nsIP3PURIInformation_h__
#include <nsCOMPtr.h>
#include <nsISupports.h>
#include <nsIURI.h>
#include <nsString.h>
#include <nsVoidArray.h>
#define NS_IP3PURIINFORMATION_IID_STR "31430e58-d43d-11d3-9781-002035aee991"
#define NS_IP3PURIINFORMATION_IID {0x31430e58, 0xd43d, 0x11d3, { 0x97, 0x81, 0x00, 0x20, 0x35, 0xae, 0xe9, 0x91 }}
// Class: nsIP3PURIInformation (nsIP3PURIInformation)
//
// This class represents the information associated with a request for a URI
// (such as a PolicyRefFile or Set-Cookie header, etc.).
//
class nsIP3PURIInformation : public nsISupports {
public:
NS_DEFINE_STATIC_IID_ACCESSOR(NS_IP3PURIINFORMATION_IID)
// Function: Gets the "Referer" request header value associated with this URI.
//
// Parms: 1. Out The "Referer" request header value
NS_IMETHOD_( void ) GetRefererHeader( nsString& aRefererHeader ) = 0;
// Function: Sets the "Referer" request header value associated with this URI.
//
// Parms: 1. In The "Referer" request header value
NS_IMETHOD SetRefererHeader( nsString& aRefererHeader ) = 0;
// Function: Returns the PolicyRefFile URI specs associated with this URI.
//
// Parms: 1. Out The PolicyRefFile URI specs
//
NS_IMETHOD_( void ) GetPolicyRefFileURISpecs( nsStringArray *aPolicyRefFileURISpecs ) = 0;
// Function: Gets the point at which this PolicyRefFile URI spec was specified
// (ie. HTTP header or HTML <LINK> tag).
//
// Parms: 1. In The PolicyRefFile URI spec
// 2. Out The place where the reference was specified
//
NS_IMETHOD_( void ) GetPolicyRefFileReferencePoint( nsString& aPolicyRefFileURISpec,
PRInt32& aReferencePoint ) = 0;
// Function: Sets a PolicyRefFile URI spec associated with this URI.
//
// Parms: 1. In The point where the reference was made (ie. HTTP header, HTML <LINK> tag)
// 2. In The PolicyRefFile URI spec
//
NS_IMETHOD SetPolicyRefFileURISpec( PRInt32 aReferencePoint,
nsString& aPolicyRefFileURISpec ) = 0;
// Function: Gets the "Set-Cookie" response header value associated with this URI.
//
// Parms: 1. Out The "Set-Cookie" response header value
NS_IMETHOD_( void ) GetCookieHeader( nsString& aCookieHeader ) = 0;
// Function: Sets the "Set-Cookie" response header value associated with this URI.
//
// Parms: 1. In The "Set-Cookie" response header value
NS_IMETHOD SetCookieHeader( nsString& aCookieHeader ) = 0;
};
#define NS_DECL_NSIP3PURIINFORMATION \
NS_IMETHOD_( void ) GetRefererHeader( nsString& aRefererHeader ); \
NS_IMETHOD SetRefererHeader( nsString& aRefererHeader ); \
NS_IMETHOD_( void ) GetPolicyRefFileURISpecs( nsStringArray *aPolicyRefFileURISpecs ); \
NS_IMETHOD_( void ) GetPolicyRefFileReferencePoint( nsString& aPolicyRefFileURISpec, \
PRInt32& aReferencePoint ); \
NS_IMETHOD SetPolicyRefFileURISpec( PRInt32 aReferencePoint, \
nsString& aPolicyRefFileURISpec ); \
NS_IMETHOD_( void ) GetCookieHeader( nsString& aCookieHeader ); \
NS_IMETHOD SetCookieHeader( nsString& aCookieHeader );
#endif /* nsIP3PURIInformation_h__ */

View File

@@ -0,0 +1,57 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Mozilla 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/MPL/
*
* 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 imitations under the License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is International
* Business Machines Corporation. Portions created by IBM
* Corporation are Copyright (C) 2000 International Business
* Machines Corporation. All Rights Reserved.
*
* Contributor(s): IBM Corporation.
*
*/
#ifndef nsIP3PXMLListener_h__
#define nsIP3PXMLListener_h__
#include <nsCOMPtr.h>
#include <nsISupports.h>
#include <nsString.h>
#define NS_IP3PXMLLISTENER_IID_STR "31430e61-d43d-11d3-9781-002035aee991"
#define NS_IP3PXMLLISTENER_IID {0x31430e61, 0xd43d, 0x11d3, { 0x97, 0x81, 0x00, 0x20, 0x35, 0xae, 0xe9, 0x91 }}
// Class: nsIP3PXMLListener
//
// This class represents the callback interface for when a URI processed by an XMLProcessor
// (such as nsP3PPolicy, etc.) has been completed.
//
class nsIP3PXMLListener : public nsISupports {
public:
NS_DEFINE_STATIC_IID_ACCESSOR( NS_IP3PXMLLISTENER_IID )
// Function: Notification of the completion of a URI.
//
// Parms: 1. In The URI spec that has completed
// 2. In The data supplied on the intial processing request
NS_IMETHOD DocumentComplete( nsString& aProcessedURISpec,
nsISupports *aReaderData ) = 0;
};
#define NS_DECL_NSIP3PXMLLISTENER \
NS_IMETHOD DocumentComplete( nsString& aProcessedURISpec, \
nsISupports *aReaderData );
#endif /* nsIP3PXMLListener_h___ */

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,136 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Mozilla 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/MPL/
*
* 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 imitations under the License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is International
* Business Machines Corporation. Portions created by IBM
* Corporation are Copyright (C) 2000 International Business
* Machines Corporation. All Rights Reserved.
*
* Contributor(s): IBM Corporation.
*
*/
#ifndef nsP3PDataSchema_h__
#define nsP3PDataSchema_h__
#include "nsIP3PDataSchema.h"
#include "nsIP3PXMLListener.h"
#include "nsIP3PDataStruct.h"
#include <nsHashtable.h>
#include <nsVoidArray.h>
class nsP3PDataSchema : public nsIP3PDataSchema,
public nsIP3PXMLListener {
public:
// nsISupports
NS_DECL_ISUPPORTS
// nsIP3PDataSchema
NS_DECL_NSIP3PDATASCHEMA
// nsIP3PXMLListener
NS_DECL_NSIP3PXMLLISTENER
// nsP3PXMLProcessor method overrides
NS_IMETHOD PostInit( nsString& aURISpec );
NS_IMETHOD PreRead( PRInt32 aReadType,
nsIURI *aReadForURI );
NS_IMETHOD ProcessContent( PRInt32 aReadType );
NS_IMETHOD_( void ) CheckForComplete( );
// nsP3PDataSchema methods
nsP3PDataSchema( );
virtual ~nsP3PDataSchema( );
protected:
NS_METHOD_( void ) ProcessDataSchema( PRInt32 aReadType );
NS_METHOD ProcessDataSchemas( PRInt32 aReadType );
NS_METHOD ProcessDataStructTagDataSchema( nsIP3PTag *aTag,
PRInt32 aReadType );
NS_METHOD ProcessDataDefTagDataSchema( nsIP3PTag *aTag,
PRInt32 aReadType );
NS_METHOD AddDataSchema( nsString& aDataSchema,
PRInt32 aReadType );
NS_METHOD_( void ) SetNotValid( );
NS_METHOD_( void ) BuildDataModel( );
NS_METHOD BuildDataStructTagDataStruct( nsIP3PTag *aTag );
NS_METHOD BuildDataDefTagDataStruct( nsIP3PTag *aTag );
NS_METHOD CreateDataStruct( nsString& aName,
nsString& aStructRef,
nsString& aStructRefDataSchemaURISpec,
nsString& aStructRefDataStructName,
nsString& aShortDescription,
nsIP3PTag *aCategoriesTag,
nsIP3PTag *aLongDescriptionTag );
NS_METHOD FindChildDataStruct( nsString& aName,
nsIP3PDataStruct *aParent,
nsIP3PDataStruct **aChild );
NS_METHOD UpdateDataStruct( nsISupportsArray *aCategoryValueTags,
nsIP3PDataStruct *aDataStruct );
NS_METHOD UpdateDataStructBelow( nsISupportsArray *aCategoryValueTags,
nsIP3PDataStruct *aDataStruct );
NS_METHOD ReplaceDataStruct( nsString& aName,
nsString& aStructRef,
nsString& aStructRefDataSchemaURISpec,
nsString& aStructRefDataStructName,
nsString& aShortDescription,
nsIP3PTag *aLongDescriptionTag,
nsIP3PDataStruct *aParent,
nsIP3PDataStruct *aOldChild,
nsIP3PDataStruct **aNewChild );
NS_METHOD NewDataStruct( PRBool aExplicitCreate,
nsString& aName,
nsString& aStructRef,
nsString& aStructRefDataSchemaURISpec,
nsString& aStructRefDataStructName,
nsString& aShortDescription,
nsISupportsArray *aCategoryValueTags,
nsIP3PTag *aLongDescriptionTag,
nsIP3PDataStruct *aParent,
nsIP3PDataStruct **aChild );
NS_METHOD ResolveReferences( nsIP3PDataStruct *aDataStruct );
nsStringArray mDataSchemasToRead; // The list of DataSchemas required for this DataSchema object
nsSupportsHashtable mDataSchemas; // The collection of DataSchema objects created for this DataSchema object
nsCOMPtr<nsIP3PDataStruct> mDataStruct; // The head of the DataStruct model
};
extern
NS_EXPORT NS_METHOD NS_NewP3PDataSchema( nsString& aDataSchemaURISpec,
nsIP3PDataSchema **aDataSchema );
#endif /* nsP3PDataSchema_h__ */

View File

@@ -0,0 +1,804 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Mozilla 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/MPL/
*
* 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 imitations under the License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is International
* Business Machines Corporation. Portions created by IBM
* Corporation are Copyright (C) 2000 International Business
* Machines Corporation. All Rights Reserved.
*
* Contributor(s): IBM Corporation.
*
*/
#include "nsP3PDefines.h"
#include "nsP3PDataStruct.h"
#include "nsP3PTags.h"
#include "nsP3PSimpleEnumerator.h"
#include <nsIComponentManager.h>
// ****************************************************************************
// nsP3PDataStruct Implementation routines
// ****************************************************************************
// P3P Data Struct: nsISupports
NS_IMPL_ISUPPORTS1( nsP3PDataStruct, nsIP3PDataStruct );
// P3P Data Struct: Creation routine
NS_METHOD
NS_NewP3PDataStruct( PRBool aExplicitlyCreated,
nsString& aName,
nsString& aStructRef,
nsString& aStructRefDataSchemaURISpec,
nsString& aStructRefDataStructName,
nsString& aShortDescription,
nsISupportsArray *aCategoryValueTags,
nsIP3PTag *aLongDescriptionTag,
nsIP3PDataStruct **aDataStruct ) {
nsresult rv;
nsP3PDataStruct *pNewDataStruct = nsnull;
NS_ENSURE_ARG_POINTER( aDataStruct );
pNewDataStruct = new nsP3PDataStruct( );
if (pNewDataStruct) {
NS_ADDREF( pNewDataStruct );
rv = pNewDataStruct->Init( aExplicitlyCreated,
aName,
aStructRef,
aStructRefDataSchemaURISpec,
aStructRefDataStructName,
aShortDescription,
aCategoryValueTags,
aLongDescriptionTag );
if (NS_SUCCEEDED( rv )) {
rv = pNewDataStruct->QueryInterface( NS_GET_IID( nsIP3PDataStruct ),
(void **)aDataStruct );
}
NS_RELEASE( pNewDataStruct );
}
else {
NS_ASSERTION( 0, "P3P: DataStruct unable to be created.\n" );
rv = NS_ERROR_OUT_OF_MEMORY;
}
return rv;
}
// P3P Data Struct: Constructor
nsP3PDataStruct::nsP3PDataStruct( )
: mExplicitlyCreated( PR_FALSE ),
mReferenceResolved( PR_FALSE ) {
NS_INIT_ISUPPORTS( );
}
// P3P Data Struct: Destructor
nsP3PDataStruct::~nsP3PDataStruct( ) {
}
// P3P Data Struct: Init
//
// Function: Initalizes the DataStruct object.
//
// A DataStruct is not explicitly created when a parent has to be implicitly created for the DataStruct tree.
// ie. dynamic.http.useragent requires dynamic and http to be implicitly created if they do not exist,
// but useragent is explicitly created.
//
// Parms: 1. In An indicator as to whether this DataStruct is being explicitly created
// 2. In The DataStruct name
// 3. In The "structref" attribute value
// 4. In The DataSchema URI spec portion of the "structref" attribute value
// 5. In The DataStruct name portion of the "structref" attribute value
// 6. In The "short-description" attribute value
// 7. In The category value Tag objects
// 8. In The <LONG-DESCRIPTION> Tag object
// 9. In The Parent DataStruct object
//
NS_METHOD
nsP3PDataStruct::Init( PRBool aExplicitlyCreated,
nsString& aName,
nsString& aStructRef,
nsString& aStructRefDataSchemaURISpec,
nsString& aStructRefDataStructName,
nsString& aShortDescription,
nsISupportsArray *aCategoryValueTags,
nsIP3PTag *aLongDescriptionTag ) {
nsresult rv;
mExplicitlyCreated = aExplicitlyCreated;
mName = aName;
mStructRef = aStructRef;
mDataSchemaURISpec = aStructRefDataSchemaURISpec;
mDataStructName = aStructRefDataStructName;
mShortDescription = aShortDescription;
mLongDescriptionTag = aLongDescriptionTag;
// Set the reference resolved indicator
mReferenceResolved = IsBasicStruct( );
// Create a container for the data struct categories
mCategoryValueTags = do_CreateInstance( NS_SUPPORTSARRAY_CONTRACTID,
&rv );
if (NS_SUCCEEDED( rv ) && aCategoryValueTags) {
// Save the categories
rv = AddCategoryValues( aCategoryValueTags );
}
if (NS_SUCCEEDED( rv )) {
// Create a container for the children
mChildren = do_CreateInstance( NS_SUPPORTSARRAY_CONTRACTID,
&rv );
}
return rv;
}
// ****************************************************************************
// nsIP3PDataStruct routines
// ****************************************************************************
// P3P Data Struct: IsExplicitlyCreated
//
// Function: Returns an indicator as to whether the DataStruct object was explicitly created.
//
// A DataStruct is not explicitly created when a parent has to be implicitly created for the DataStruct tree.
// ie. dynamic.http.useragent requires dynamic and http to be implicitly created if they do not exist,
// but useragent is explicitly created.
//
// Parms: None
//
NS_IMETHODIMP_( PRBool )
nsP3PDataStruct::IsExplicitlyCreated( ) {
return mExplicitlyCreated;
}
// P3P Data Struct: GetName
//
// Function: Gets the name of the DataStruct object.
//
// Parms: 1. Out The name of the DataStruct object
//
NS_IMETHODIMP_( void )
nsP3PDataStruct::GetName( nsString& aName ) {
aName = mName;
return;
}
// P3P Data Struct: GetFullName
//
// Function: Gets the full name of the DataStruct object (this includes the parent DataStruct names).
//
// Parms: 1. Out The full name of the DataStruct object
//
NS_IMETHODIMP_( void )
nsP3PDataStruct::GetFullName( nsString& aName ) {
if (mParent) {
mParent->GetFullName( aName );
if (aName.Length( ) > 0) {
aName.AppendWithConversion( "." );
}
aName += mName;
}
else {
aName = mName;
}
return;
}
// P3P Data Struct: GetStructRef
//
// Function: Gets the "structref" attribute of the DataStruct object.
//
// Parms: 1. Out The "structref" attribute of the DataStruct object
//
NS_IMETHODIMP_( void )
nsP3PDataStruct::GetStructRef( nsString& aStructRef ) {
aStructRef = mStructRef;
return;
}
// P3P Data Struct: GetDataSchemaURISpec
//
// Function: Gets the DataSchema URI spec portion of the "structref" attribute of the DataStruct object.
//
// Parms: 1. Out The DataSchema URI spec of the "structref" attribute of the DataStruct object
//
NS_IMETHODIMP_( void )
nsP3PDataStruct::GetDataSchemaURISpec( nsString& aDataSchemaURISpec ) {
aDataSchemaURISpec = mDataSchemaURISpec;
return;
}
// P3P Data Struct: GetDataStruct
//
// Function: Gets the DataSchema struct of the "structref" attribute of the DataStruct object.
//
// Parms: 1. Out The DataSchema struct of the "structref" attribute of the DataStruct object
//
NS_IMETHODIMP_( void )
nsP3PDataStruct::GetDataStructName( nsString& aDataStructName ) {
aDataStructName = mDataStructName;
return;
}
// P3P Data Struct: GetShortDescription
//
// Function: Gets the "short-description" attribute of the DataStruct object.
//
// Parms: 1. Out The "short-description" attribute of the DataStruct object
//
NS_IMETHODIMP_( void )
nsP3PDataStruct::GetShortDescription( nsString& aShortDescription ) {
aShortDescription = mShortDescription;
return;
}
// P3P Data Struct: GetCategoryValues
//
// Function: Gets the category value Tag objects of the DataStruct object.
//
// Parms: 1. Out The category value Tag objects of the DataStruct object
//
NS_IMETHODIMP
nsP3PDataStruct::GetCategoryValues( nsISupportsArray **aCategoryValueTags ) {
NS_ENSURE_ARG_POINTER( aCategoryValueTags );
*aCategoryValueTags = mCategoryValueTags;
NS_IF_ADDREF( *aCategoryValueTags );
return NS_OK;
}
// P3P Data Struct: AddCategoryValues
//
// Function: Add category value Tag objects to the DataStruct object.
//
// Parms: 1. In The category value Tag objects to add to the DataStruct object
//
NS_IMETHODIMP
nsP3PDataStruct::AddCategoryValues( nsISupportsArray *aCategoryValueTags ) {
nsresult rv;
nsCOMPtr<nsISimpleEnumerator> pEnumerator;
nsCOMPtr<nsIP3PTag> pTag;
PRBool bMoreTags;
// Loop through the list of categories and add them to this data struct
rv = NS_NewP3PSimpleEnumerator( aCategoryValueTags,
getter_AddRefs( pEnumerator ) );
if (NS_SUCCEEDED( rv )) {
rv = pEnumerator->HasMoreElements(&bMoreTags );
while (NS_SUCCEEDED( rv ) && bMoreTags) {
rv = pEnumerator->GetNext( getter_AddRefs( pTag ) );
if (NS_SUCCEEDED( rv )) {
rv = AddCategoryValues( pTag );
}
if (NS_SUCCEEDED( rv )) {
rv = pEnumerator->HasMoreElements(&bMoreTags );
}
}
}
return rv;
}
// P3P Data Struct: AddCategoryValues
//
// Function: Add category value Tag objects to the DataStruct object.
//
// Parms: 1. In The category value Tag objects to add to the DataStruct object
//
NS_IMETHODIMP
nsP3PDataStruct::AddCategoryValues( nsIP3PTag *aCategoryValueTag ) {
nsresult rv;
nsAutoString sName,
sNewName;
nsCOMPtr<nsISimpleEnumerator> pEnumerator;
nsCOMPtr<nsIP3PTag> pTag,
pNewTag;
PRBool bMoreTags,
bFound;
aCategoryValueTag->GetName( sNewName );
// Loop through the list of this data struct's categories to see if the
// category is already present
rv = NS_NewP3PSimpleEnumerator( mCategoryValueTags,
getter_AddRefs( pEnumerator ) );
if (NS_SUCCEEDED( rv )) {
rv = pEnumerator->HasMoreElements(&bMoreTags );
bFound = PR_FALSE;
while (NS_SUCCEEDED( rv ) && !bFound && bMoreTags) {
rv = pEnumerator->GetNext( getter_AddRefs( pTag ) );
if (NS_SUCCEEDED( rv )) {
pTag->GetName( sName );
if (sName == sNewName) {
bFound = PR_TRUE;
}
}
if (NS_SUCCEEDED( rv )) {
rv = pEnumerator->HasMoreElements(&bMoreTags );
}
}
if (NS_SUCCEEDED( rv ) && !bFound) {
// Copy the category value and add it to the list
aCategoryValueTag->CloneTree( nsnull,
getter_AddRefs( pNewTag ) );
if (!mCategoryValueTags->AppendElement( pNewTag )) {
rv = NS_ERROR_FAILURE;
}
}
}
return rv;
}
// P3P Data Struct: GetLongDescription
//
// Function: Gets the <LONG-DESCRIPTION> Tag object of the DataStruct object.
//
// Parms: 1. Out The <LONG-DESCRIPTION> Tag object of the DataStruct object
//
NS_IMETHODIMP
nsP3PDataStruct::GetLongDescription( nsIP3PTag **aLongDescriptionTag ) {
NS_ENSURE_ARG_POINTER( aLongDescriptionTag );
*aLongDescriptionTag = mLongDescriptionTag;
NS_IF_ADDREF( *aLongDescriptionTag );
return NS_OK;
}
// P3P Data Struct: AddChild
//
// Function: Adds a child to the DataStruct object.
//
// Parms: 1. In The child DataStruct object to add
//
NS_IMETHODIMP
nsP3PDataStruct::AddChild( nsIP3PDataStruct *aChild ) {
nsresult rv = NS_OK;
if (mChildren->AppendElement( aChild )) {
aChild->SetParent( this );
}
else {
rv = NS_ERROR_FAILURE;
}
return rv;
}
// P3P Data Struct: RemoveChild
//
// Function: Removes a child from the DataStruct object.
//
// Parms: 1. In The child DataStruct object to remove
//
NS_IMETHODIMP
nsP3PDataStruct::RemoveChild( nsIP3PDataStruct *aChild ) {
aChild->SetParent( nsnull );
mChildren->RemoveElement( aChild );
return NS_OK;
}
// P3P Data Struct: RemoveChildren
//
// Function: Removes all children from the DataStruct object.
//
// Parms: None
//
NS_IMETHODIMP_( void )
nsP3PDataStruct::RemoveChildren( ) {
nsresult rv;
nsCOMPtr<nsISimpleEnumerator> pEnumerator;
nsCOMPtr<nsIP3PDataStruct> pDataStruct;
PRBool bMoreDataStructs;
// Loop through all of the children and set their parent to null
rv = NS_NewP3PSimpleEnumerator( mChildren,
getter_AddRefs( pEnumerator ) );
if (NS_SUCCEEDED( rv )) {
rv = pEnumerator->HasMoreElements(&bMoreDataStructs );
while (NS_SUCCEEDED( rv ) && bMoreDataStructs) {
rv = pEnumerator->GetNext( getter_AddRefs( pDataStruct ) );
if (NS_SUCCEEDED( rv )) {
pDataStruct->SetParent( nsnull );
}
if (NS_SUCCEEDED( rv )) {
rv = pEnumerator->HasMoreElements(&bMoreDataStructs );
}
}
}
mChildren->Clear( );
return;
}
// P3P Data Struct: GetChildren
//
// Function: Gets the DataStruct object children.
//
// Parms: 1. Out The DataStruct object children
//
NS_IMETHODIMP
nsP3PDataStruct::GetChildren( nsISupportsArray **aChildren ) {
NS_ENSURE_ARG_POINTER( aChildren );
*aChildren = mChildren;
NS_IF_ADDREF( *aChildren );
return NS_OK;
}
// P3P Data Struct: GetParent
//
// Function: Gets the parent of the DataStruct object.
//
// Parms: 1. Out The parent DataStruct object
//
NS_IMETHODIMP
nsP3PDataStruct::GetParent( nsIP3PDataStruct **aParent ) {
NS_ENSURE_ARG_POINTER( aParent );
*aParent = mParent;
NS_IF_ADDREF( *aParent );
return NS_OK;
}
// P3P Data Struct: SetParent
//
// Function: Sets the parent of the DataStruct object.
//
// Parms: 1. In The parent DataStruct object
//
NS_IMETHODIMP_( void )
nsP3PDataStruct::SetParent( nsIP3PDataStruct *aParent ) {
mParent = aParent;
return;
}
// P3P Data Struct: CloneNode
//
// Function: Creates a copy of the DataStruct object (at the node level only).
//
// Parms: 1. In The DataStruct object to make the parent of the cloned DataStruct object
// 2. Out The cloned DataStruct object
//
NS_IMETHODIMP
nsP3PDataStruct::CloneNode( nsIP3PDataStruct *aParent,
nsIP3PDataStruct **aNewDataStruct ) {
nsresult rv = NS_OK;
nsCOMPtr<nsIP3PTag> pLongDescriptionTag;
NS_ENSURE_ARG_POINTER( aNewDataStruct );
*aNewDataStruct = nsnull;
if (mLongDescriptionTag) {
// Copy the <LONG-DESCRIPTION> Tag object for the new data struct
rv = mLongDescriptionTag->CloneTree( nsnull,
getter_AddRefs( pLongDescriptionTag ) );
}
if (NS_SUCCEEDED( rv )) {
// Create a copy of the data struct
rv = NS_NewP3PDataStruct( mExplicitlyCreated,
mName,
mStructRef,
mDataSchemaURISpec,
mDataStructName,
mShortDescription,
mCategoryValueTags,
pLongDescriptionTag,
aNewDataStruct );
if (NS_SUCCEEDED( rv )) {
if (aParent) {
// Parent specified, add the child to the parent
rv = aParent->AddChild( *aNewDataStruct );
}
if (NS_SUCCEEDED( rv )) {
if (mReferenceResolved) {
// Set the reference resolved flag
(*aNewDataStruct)->SetReferenceResolved( );
}
}
}
}
return rv;
}
// P3P Data Struct: CloneTree
//
// Function: Creates a copy of the DataStruct object and it's children.
//
// Parms: 1. In The DataStruct object to make the parent of the cloned DataStruct object
// 2. Out The cloned DataStruct object
//
NS_IMETHODIMP
nsP3PDataStruct::CloneTree( nsIP3PDataStruct *aParent,
nsIP3PDataStruct **aNewDataStruct ) {
nsresult rv;
nsCOMPtr<nsIP3PDataStruct> pNewDataStruct;
nsCOMPtr<nsISupportsArray> pChildren;
nsCOMPtr<nsISimpleEnumerator> pEnumerator;
nsCOMPtr<nsIP3PDataStruct> pDataStruct,
pDataStructTree;
PRBool bMoreDataStructs;
NS_ENSURE_ARG_POINTER( aNewDataStruct );
*aNewDataStruct = nsnull;
// Copy the node
rv = CloneNode( aParent,
getter_AddRefs( pNewDataStruct ) );
if (NS_SUCCEEDED( rv )) {
rv = GetChildren( getter_AddRefs( pChildren ) );
if (NS_SUCCEEDED( rv )) {
// Loop through all of the children and copy them
rv = NS_NewP3PSimpleEnumerator( pChildren,
getter_AddRefs( pEnumerator ) );
if (NS_SUCCEEDED( rv )) {
rv = pEnumerator->HasMoreElements(&bMoreDataStructs );
while (NS_SUCCEEDED( rv ) && bMoreDataStructs) {
rv = pEnumerator->GetNext( getter_AddRefs( pDataStruct ) );
if (NS_SUCCEEDED( rv )) {
rv = pDataStruct->CloneTree( pNewDataStruct,
getter_AddRefs( pDataStructTree ) );
}
if (NS_SUCCEEDED( rv )) {
rv = pEnumerator->HasMoreElements(&bMoreDataStructs );
}
}
}
}
}
if (NS_SUCCEEDED( rv )) {
rv = pNewDataStruct->QueryInterface( NS_GET_IID( nsIP3PDataStruct ),
(void **)aNewDataStruct );
}
return rv;
}
// P3P Data Struct: CloneChildren
//
// Function: Creates a copy of the children of the DataStruct object and their children.
//
// Parms: 1. In The DataStruct object to make the parent of the cloned children
//
NS_IMETHODIMP
nsP3PDataStruct::CloneChildren( nsIP3PDataStruct *aParent ) {
nsresult rv;
nsCOMPtr<nsISupportsArray> pChildren;
nsCOMPtr<nsISimpleEnumerator> pEnumerator;
nsCOMPtr<nsIP3PDataStruct> pDataStruct,
pDataStructTree;
PRBool bMoreDataStructs;
rv = GetChildren( getter_AddRefs( pChildren ) );
if (NS_SUCCEEDED( rv )) {
// Loop through all the children and copy them
rv = NS_NewP3PSimpleEnumerator( pChildren,
getter_AddRefs( pEnumerator ) );
if (NS_SUCCEEDED( rv )) {
rv = pEnumerator->HasMoreElements(&bMoreDataStructs );
while (NS_SUCCEEDED( rv ) && bMoreDataStructs) {
rv = pEnumerator->GetNext( getter_AddRefs( pDataStruct ) );
if (NS_SUCCEEDED( rv )) {
rv = pDataStruct->CloneTree( aParent,
getter_AddRefs( pDataStructTree ) );
}
if (NS_SUCCEEDED( rv )) {
rv = pEnumerator->HasMoreElements(&bMoreDataStructs );
}
}
}
}
return rv;
}
// P3P Data Struct: DestroyTree
//
// Function: Removes all connections (parent/children) between DataStruct objects.
//
// Parms: None
NS_IMETHODIMP_( void )
nsP3PDataStruct::DestroyTree( ) {
nsresult rv;
nsCOMPtr<nsISimpleEnumerator> pEnumerator;
nsCOMPtr<nsIP3PDataStruct> pDataStruct;
PRBool bMoreDataStructs;
// Loop through all of the children and destroy their tree
rv = NS_NewP3PSimpleEnumerator( mChildren,
getter_AddRefs( pEnumerator ) );
if (NS_SUCCEEDED( rv )) {
rv = pEnumerator->HasMoreElements(&bMoreDataStructs );
while (NS_SUCCEEDED( rv ) && bMoreDataStructs) {
rv = pEnumerator->GetNext( getter_AddRefs( pDataStruct ) );
if (NS_SUCCEEDED( rv )) {
pDataStruct->DestroyTree( );
}
if (NS_SUCCEEDED( rv )) {
rv = pEnumerator->HasMoreElements(&bMoreDataStructs );
}
}
}
RemoveChildren( );
return;
}
// P3P Data Struct: ReferenceResolved
//
// Function: Sets the indicator that says this datastruct has resolved it's reference.
//
// Parms: None
NS_IMETHODIMP_( void )
nsP3PDataStruct::SetReferenceResolved( ) {
mReferenceResolved = PR_TRUE;
return;
}
// P3P Data Struct: IsReferenceResolved
//
// Function: Returns the indicator that says whether or not the reference for this datastruct
// has been resolved.
//
// Parms: None
NS_IMETHODIMP_( PRBool )
nsP3PDataStruct::IsReferenceResolved( ) {
return mReferenceResolved;
}
// ****************************************************************************
// nsP3PDataStruct routines
// ****************************************************************************
// P3P Data Struct: IsPrimitiveStruct
//
// Function: Determines whether the DataStruct object is a basic DataStruct
//
// Parms: None
//
NS_METHOD_( PRBool )
nsP3PDataStruct::IsBasicStruct( ) {
return (mDataStructName.Length( ) == 0);
}

View File

@@ -0,0 +1,89 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Mozilla 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/MPL/
*
* 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 imitations under the License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is International
* Business Machines Corporation. Portions created by IBM
* Corporation are Copyright (C) 2000 International Business
* Machines Corporation. All Rights Reserved.
*
* Contributor(s): IBM Corporation.
*
*/
#ifndef nsP3PDataStruct_h__
#define nsP3PDataStruct_h__
#include "nsIP3PDataStruct.h"
#include <nsVoidArray.h>
class nsP3PDataStruct : public nsIP3PDataStruct {
public:
// nsISupports
NS_DECL_ISUPPORTS
// nsIP3PDataStruct methods
NS_DECL_NSIP3PDATASTRUCT
// nsP3PDataStruct methods
nsP3PDataStruct( );
virtual ~nsP3PDataStruct( );
NS_METHOD Init( PRBool aExplicitlyCreated,
nsString& aName,
nsString& aStructRef,
nsString& aStructRefDataSchemaURISpec,
nsString& aStructRefDataStructName,
nsString& aShortDescription,
nsISupportsArray *aCategoryValueTags,
nsIP3PTag *aLongDescriptionTag );
protected:
NS_METHOD_( PRBool ) IsBasicStruct( );
PRBool mExplicitlyCreated, // Indicates that the DataStruct object was explicitly created
mReferenceResolved; // Indicates that the DataStruct reference has been resolved
nsString mName; // DataStruct name
nsString mStructRef; // "structref" attribute value
nsString mDataSchemaURISpec, // DataSchema URI spec portion of the "structref" attribute value
mDataStructName; // DataStruct name portion of the "structref" attribute value
nsString mShortDescription; // "short-description" attribute value
nsCOMPtr<nsISupportsArray> mCategoryValueTags; // Category value Tag objects
nsCOMPtr<nsIP3PTag> mLongDescriptionTag; // <LONG-DESCRIPTION> Tag object
nsCOMPtr<nsIP3PDataStruct> mParent; // Parent DataStruct object
nsCOMPtr<nsISupportsArray> mChildren; // Children DataStruct objects
};
extern
NS_EXPORT NS_METHOD NS_NewP3PDataStruct( PRBool aExplicitlyCreated,
nsString& aName,
nsString& aStructRef,
nsString& aStructRefDataSchemaURISpec,
nsString& aStructRefDataStructName,
nsString& aShortDescription,
nsISupportsArray *aCategoryValueTags,
nsIP3PTag *aLongDescriptionTag,
nsIP3PDataStruct **aDataStruct );
#endif /* nsP3PDataStruct_h___ */

View File

@@ -0,0 +1,329 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Mozilla 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/MPL/
*
* 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 imitations under the License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is International
* Business Machines Corporation. Portions created by IBM
* Corporation are Copyright (C) 2000 International Business
* Machines Corporation. All Rights Reserved.
*
* Contributor(s): IBM Corporation.
*
*/
#ifndef nsP3PDefines_h__
#define nsP3PDefines_h__
#define P3P_PREF "P3P."
#define P3P_PREF_ENABLED P3P_PREF"enabled"
#define P3P_PREF_WARNINGNOTPRIVATE P3P_PREF"warningnotprivate"
#define P3P_PREF_WARNINGPARTIALPRIVACY P3P_PREF"warningpartialprivacy"
#define P3P_PREF_WARNINGPOSTTONOTPRIVATE P3P_PREF"warningposttonotprivate"
#define P3P_PREF_WARNINGPOSTTOBROKENPOLICY P3P_PREF"warningposttobrokenpolicy"
#define P3P_PREF_WARNINGPOSTTONOPOLICY P3P_PREF"warningposttonopolicy"
// HTTP headers and values related to P3P
// Example: P3P: policyref="http://www.anysite.com/policyrefs.xml"
//
// Note: Mozilla converts all header keys to lower case when stored
// so lower case key values are required
#define P3P_HTTPEXT_P3P_KEY "p3p"
#define P3P_HTTPEXT_POLICYREF_KEY "policyref="
#define P3P_HTTP_USERAGENT_KEY "user-agent"
#define P3P_HTTP_REFERER_KEY "referer"
#define P3P_HTTP_COOKIE_KEY "Cookie"
#define P3P_HTTP_SETCOOKIE_KEY "set-cookie"
#define P3P_HTTP_CONTENTTYPE_KEY "content-type"
#define P3P_HTTP_PRAGMA_KEY "pragma"
#define P3P_HTTP_CACHECONTROL_KEY "cache-control"
#define P3P_HTTP_EXPIRES_KEY "expires"
#define P3P_HTTP_DATE_KEY "date"
#define P3P_CACHECONTROL_NOCACHE "no-cache"
#define P3P_CACHECONTROL_MAXAGE "max-age"
#define P3P_PRAGMA_NOCACHE "no-cache"
#define P3P_DOCUMENT_DEFAULT_LIFETIME 86400 // 24 hours in seconds
// HTML/XML LINK tags related to P3P
// Example: <LINK rel="P3Pv1"
// href="http://www.anysite.com/policyrefs.xml">
#define P3P_LINK_REL "rel"
#define P3P_LINK_P3P_VALUE "\"P3Pv1\""
#define P3P_LINK_HREF "href"
// Constants used to indicate where the reference to the PolicyRefFile occurred
#define P3P_REFERENCE_WELL_KNOWN 0
#define P3P_REFERENCE_HTTP_HEADER 4
#define P3P_REFERENCE_LINK_TAG 8
// Constant to define the P3P well known location
#define P3P_WELL_KNOWN_LOCATION "/w3c/p3p.xml"
// Constant used to indicate any request METHOD
#define P3P_ANY_METHOD "ANYMETHOD"
// Constants used to identify the type of XML Processor
#define P3P_DOCUMENT_POLICYREFFILE 4
#define P3P_DOCUMENT_POLICY 8
#define P3P_DOCUMENT_DATASCHEMA 12
// Constants used to define the state of the privacy check
#define P3P_CHECK_WELLKNOWN_POLICYREFFILE 0
#define P3P_CHECK_SPECIFIED_POLICYREFFILE 4
#define P3P_CHECK_EXPIRED_POLICYREFFILE 8
#define P3P_CHECK_READING_POLICYREFFILE 12
#define P3P_CHECK_POLICY_REFERENCE 16
#define P3P_CHECK_POLICY 20
#define P3P_CHECK_COMPLETE 24
#define P3P_CHECK_INITIAL_STATE P3P_CHECK_WELLKNOWN_POLICYREFFILE
// Constants used to indicate Asynchronous vs. Synchronous read mode
#define P3P_ASYNC_READ 0
#define P3P_SYNC_READ 4
// Constants used to indicate the type of check being performed
#define P3P_OBJECT_CHECK 0
#define P3P_FORM_SUBMISSION_CHECK 4
// Return values used for Privacy Check
#define P3P_PRIVACY_NONE NS_ERROR_GENERATE_SUCCESS( 0, 0 )
#define P3P_PRIVACY_IN_PROGRESS NS_ERROR_GENERATE_SUCCESS( 0, 4 )
#define P3P_PRIVACY_NOT_MET NS_ERROR_GENERATE_SUCCESS( 0, 8 )
#define P3P_PRIVACY_PARTIAL NS_ERROR_GENERATE_SUCCESS( 0, 12 )
#define P3P_PRIVACY_MET NS_ERROR_GENERATE_SUCCESS( 0, 16 )
// P3P XML tag optionality defines
#define P3P_TAG_OPTIONAL PR_TRUE
#define P3P_TAG_MANDATORY PR_FALSE
// P3P Policy Ref File tags
#define P3P_META_TAG "META"
#define P3P_POLICYREFERENCES_TAG "POLICY-REFERENCES"
#define P3P_EXPIRY_TAG "EXPIRY"
#define P3P_RDF_TAG "RDF"
#define P3P_POLICIES_TAG "POLICIES"
#define P3P_POLICYREF_TAG "POLICY-REF"
#define P3P_INCLUDE_TAG "INCLUDE"
#define P3P_EXCLUDE_TAG "EXCLUDE"
#define P3P_EMBEDDEDINCLUDE_TAG "EMBEDDED-INCLUDE"
#define P3P_EMBEDDEDEXCLUDE_TAG "EMBEDDED-EXCLUDE"
#define P3P_METHOD_TAG "METHOD"
// P3P Policy tags
#define P3P_POLICY_TAG "POLICY"
#define P3P_ENTITY_TAG "ENTITY"
#define P3P_ACCESS_TAG "ACCESS"
#define P3P_DISPUTESGROUP_TAG "DISPUTES-GROUP"
#define P3P_DISPUTES_TAG "DISPUTES"
#define P3P_IMG_TAG "IMG"
#define P3P_REMEDIES_TAG "REMEDIES"
#define P3P_STATEMENT_TAG "STATEMENT"
#define P3P_CONSEQUENCE_TAG "CONSEQUENCE"
#define P3P_RECIPIENT_TAG "RECIPIENT"
#define P3P_PURPOSE_TAG "PURPOSE"
#define P3P_RETENTION_TAG "RETENTION"
#define P3P_DATAGROUP_TAG "DATA-GROUP"
#define P3P_DATA_TAG "DATA"
// P3P Data Schema tags
#define P3P_DATASCHEMA_TAG "DATASCHEMA"
#define P3P_DATASTRUCT_TAG "DATA-STRUCT"
#define P3P_DATADEF_TAG "DATA-DEF"
// P3P multi-use tags
#define P3P_EXTENSION_TAG "EXTENSION"
#define P3P_CATEGORIES_TAG "CATEGORIES"
#define P3P_LONGDESCRIPTION_TAG "LONG-DESCRIPTION"
// P3P ACCESS tags
#define P3P_ACCESS_NONIDENT "nonident"
#define P3P_ACCESS_IDENT_CONTACT "ident_contact"
#define P3P_ACCESS_OTHER_IDENT "other_ident"
#define P3P_ACCESS_CONTACT_AND_OTHER "contact_and_other"
#define P3P_ACCESS_ALL "all"
#define P3P_ACCESS_NONE "none"
// P3P REMEDIES tags
#define P3P_REMEDIES_CORRECT "correct"
#define P3P_REMEDIES_MONEY "money"
#define P3P_REMEDIES_LAW "law"
// P3P RECIPIENT tags
#define P3P_RECIPIENT_OURS "ours"
#define P3P_RECIPIENT_SAME "same"
#define P3P_RECIPIENT_OTHERRECIPIENT "other-recipient"
#define P3P_RECIPIENT_DELIVERY "delivery"
#define P3P_RECIPIENT_PUBLIC "public"
#define P3P_RECIPIENT_UNRELATED "unrelated"
// P3P RECIPIENT-DESCRIPTION tag
#define P3P_RECIPIENTDESCRIPTION_TAG "recipient-description"
// P3P PURPOSE tags
#define P3P_PURPOSE_CURRENT "current"
#define P3P_PURPOSE_ADMIN "admin"
#define P3P_PURPOSE_DEVELOP "develop"
#define P3P_PURPOSE_CUSTOMIZATION "customization"
#define P3P_PURPOSE_TAILORING "tailoring"
#define P3P_PURPOSE_PSEUDOANALYSIS "pseudo-analysis"
#define P3P_PURPOSE_PSEUDODECISION "pseudo-decision"
#define P3P_PURPOSE_INDIVIDUALANALYSIS "individual-analysis"
#define P3P_PURPOSE_INDIVIDUALDECISION "individual-decision"
#define P3P_PURPOSE_CONTACT "contact"
#define P3P_PURPOSE_HISTORICAL "historical"
#define P3P_PURPOSE_TELEMARKETING "telemarketing"
#define P3P_PURPOSE_OTHERPURPOSE "other-purpose"
// P3P RETENTION tags
#define P3P_RETENTION_NORETENTION "no-retention"
#define P3P_RETENTION_STATEDPURPOSE "stated-purpose"
#define P3P_RETENTION_LEGALREQUIREMENT "legal-requirement"
#define P3P_RETENTION_INDEFINITELY "indefinitely"
#define P3P_RETENTION_BUSINESSPRACTICES "business-practices"
// P3P CATEGORIES tags
#define P3P_CATEGORIES_PHYSICAL "physical"
#define P3P_CATEGORIES_ONLINE "online"
#define P3P_CATEGORIES_UNIQUEID "uniqueid"
#define P3P_CATEGORIES_PURCHASE "purchase"
#define P3P_CATEGORIES_FINANCIAL "financial"
#define P3P_CATEGORIES_COMPUTER "computer"
#define P3P_CATEGORIES_NAVIGATION "navigation"
#define P3P_CATEGORIES_INTERACTIVE "interactive"
#define P3P_CATEGORIES_DEMOGRAPHIC "demographic"
#define P3P_CATEGORIES_CONTENT "content"
#define P3P_CATEGORIES_STATE "state"
#define P3P_CATEGORIES_POLITICAL "political"
#define P3P_CATEGORIES_HEALTH "health"
#define P3P_CATEGORIES_PREFERENCE "preference"
#define P3P_CATEGORIES_LOCATION "location"
#define P3P_CATEGORIES_GOVERNMENT "government"
#define P3P_CATEGORIES_OTHER "other"
// P3P tag attributes
#define P3P_DATE_ATTRIBUTE "date"
#define P3P_MAXAGE_ATTRIBUTE "max-age"
#define P3P_ABOUT_ATTRIBUTE "about"
#define P3P_DISCURI_ATTRIBUTE "discuri"
#define P3P_OPTURI_ATTRIBUTE "opturi"
#define P3P_NAME_ATTRIBUTE "name"
#define P3P_RESOLUTIONTYPE_ATTRIBUTE "resolution-type"
#define P3P_SERVICE_ATTRIBUTE "service"
#define P3P_VERIFICATION_ATTRIBUTE "verification"
#define P3P_SHORTDESCRIPTION_ATTRIBUTE "short-description"
#define P3P_SRC_ATTRIBUTE "src"
#define P3P_WIDTH_ATTRIBUTE "width"
#define P3P_HEIGHT_ATTRIBUTE "height"
#define P3P_ALT_ATTRIBUTE "alt"
#define P3P_REQUIRED_ATTRIBUTE "required"
#define P3P_BASE_ATTRIBUTE "base"
#define P3P_REF_ATTRIBUTE "ref"
#define P3P_OPTIONAL_ATTRIBUTE "optional"
#define P3P_STRUCTREF_ATTRIBUTE "structref"
// P3P tag attribute values
#define P3P_SERVICE_VALUE "service"
#define P3P_INDEPENDENT_VALUE "independent"
#define P3P_COURT_VALUE "court"
#define P3P_LAW_VALUE "law"
#define P3P_YES_VALUE "yes"
#define P3P_NO_VALUE "no"
#define P3P_ALWAYS_VALUE "always"
#define P3P_OPTIN_VALUE "opt_in"
#define P3P_OPTOUT_VALUE "opt_out"
// P3P Related NameSpaces for the Policy Ref File and Policy File
#define P3P_P3P_NAMESPACE "http://www.w3.org/2000/09/15/P3Pv1"
#define P3P_RDF_NAMESPACE "http://www.w3.org/1999/02/22-rdf-syntax-ns#"
// P3P Base DataSchema URI
#define P3P_BASE_DATASCHEMA "http://www.w3.org/TR/P3P/base"
#define P3P_BASE_DATASCHEMA_LOCAL_NAME "P3PBaseDataSchema.xml"
#define P3P_PROPERTIES_FILE "chrome://communicator/locale/P3P.properties"
#define P3P_PRINT_REQUEST_HEADERS( _httpchannel ) \
{ nsCOMPtr<nsIURI> pURIDebug; \
nsXPIDLCString xcsURISpecDebug; \
nsCOMPtr<nsIAtom> pMethodDebug; \
nsAutoString sMethodDebug; \
nsCAutoString csMethodDebug; \
\
_httpchannel->GetURI( getter_AddRefs( pURIDebug ) ); \
pURIDebug->GetSpec( getter_Copies( xcsURISpecDebug ) ); \
printf( "P3P: Getting Document: %s\n", (const char *)xcsURISpecDebug ); \
\
pHTTPChannel->GetRequestMethod( getter_AddRefs( pMethodDebug ) ); \
pMethodDebug->ToString( sMethodDebug ); \
csMethodDebug.AssignWithConversion( sMethodDebug ); \
printf( "P3P: Request Method: %s\n", (const char *)csMethodDebug ); \
\
nsCOMPtr<nsISimpleEnumerator> pHeadersDebug; \
nsCOMPtr<nsIHTTPHeader> pHeaderDebug; \
nsXPIDLCString xcsKeyDebug, xcsValueDebug; \
PRBool bMoreElementsDebug; \
\
rv = _httpchannel->GetRequestHeaderEnumerator( getter_AddRefs( pHeadersDebug ) ); \
if (NS_SUCCEEDED( rv )) { \
rv = pHeadersDebug->HasMoreElements(&bMoreElementsDebug ); \
while (NS_SUCCEEDED( rv ) && bMoreElementsDebug) { \
rv = pHeadersDebug->GetNext( getter_AddRefs( pHeaderDebug ) ); \
if (NS_SUCCEEDED( rv )) { \
rv = pHeaderDebug->GetFieldName( getter_Copies( xcsKeyDebug ) ); \
rv = pHeaderDebug->GetValue( getter_Copies( xcsValueDebug ) ); \
printf( "P3P: Header - %s: %s\n", (const char *)xcsKeyDebug, \
(const char *)xcsValueDebug ); \
} \
rv = pHeadersDebug->HasMoreElements(&bMoreElementsDebug ); \
} \
} \
}
#define P3P_PRINT_RESPONSE_HEADERS( _httpchannel ) \
{ nsCOMPtr<nsIURI> pURIDebug; \
nsXPIDLCString xcsURISpecDebug, xcsStatusDebug; \
PRUint32 uiStatusDebug; \
\
_httpchannel->GetURI( getter_AddRefs( pURIDebug ) ); \
pURIDebug->GetSpec( getter_Copies( xcsURISpecDebug ) ); \
printf( "P3P: Receiving Document: %s\n", (const char *)xcsURISpecDebug ); \
\
_httpchannel->GetResponseStatus(&uiStatusDebug ); \
_httpchannel->GetResponseString( getter_Copies( xcsStatusDebug ) ); \
printf( "P3P: Response: %i %s\n", uiStatusDebug, (const char *)xcsStatusDebug ); \
\
nsCOMPtr<nsISimpleEnumerator> pHeadersDebug; \
nsCOMPtr<nsIHTTPHeader> pHeaderDebug; \
nsXPIDLCString xcsKeyDebug, xcsValueDebug; \
PRBool bMoreElementsDebug; \
\
rv = _httpchannel->GetResponseHeaderEnumerator( getter_AddRefs( pHeadersDebug ) ); \
if (NS_SUCCEEDED( rv )) { \
rv = pHeadersDebug->HasMoreElements(&bMoreElementsDebug ); \
while (NS_SUCCEEDED( rv ) && bMoreElementsDebug) { \
rv = pHeadersDebug->GetNext( getter_AddRefs( pHeaderDebug ) ); \
if (NS_SUCCEEDED( rv )) { \
rv = pHeaderDebug->GetFieldName( getter_Copies( xcsKeyDebug ) ); \
rv = pHeaderDebug->GetValue( getter_Copies( xcsValueDebug ) ); \
printf( "P3P: Header - %s: %s\n", (const char *)xcsKeyDebug, \
(const char *)xcsValueDebug ); \
} \
rv = pHeadersDebug->HasMoreElements(&bMoreElementsDebug ); \
} \
} \
}
#endif /* nsP3PDefines_h__ */

View File

@@ -0,0 +1,946 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Mozilla 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/MPL/
*
* 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 imitations under the License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is International
* Business Machines Corporation. Portions created by IBM
* Corporation are Copyright (C) 2000 International Business
* Machines Corporation. All Rights Reserved.
*
* Contributor(s): IBM Corporation.
*
*/
#include "nsP3PDefines.h"
#include "nsP3PHTTPNotify.h"
#include "nsP3PLogging.h"
#include <nsIServiceManager.h>
#include <nsIHTTPHeader.h>
#include <nsIURI.h>
#include <nsILoadGroup.h>
#include <nsIInterfaceRequestor.h>
#include <nsIDocumentLoader.h>
#include <nsString.h>
#include <nsXPIDLString.h>
// ****************************************************************************
// nsP3PHTTPNotify Implementation routines
// ****************************************************************************
static NS_DEFINE_CID( kNetModuleMgrCID, NS_NETMODULEMGR_CID );
// P3P HTTP Notify: nsISupports
NS_IMPL_ISUPPORTS2( nsP3PHTTPNotify, nsIHTTPNotify,
nsINetNotify );
// P3P HTTP Notify: Creation routine
NS_METHOD
NS_NewP3PHTTPNotify( nsIHTTPNotify **aHTTPNotify ) {
nsresult rv;
nsP3PHTTPNotify *pNewHTTPNotify = nsnull;
#ifdef DEBUG_P3P
printf("P3P: HTTPNotify initializing.\n");
#endif
NS_ENSURE_ARG_POINTER( aHTTPNotify );
*aHTTPNotify = nsnull;
pNewHTTPNotify = new nsP3PHTTPNotify( );
if (pNewHTTPNotify) {
NS_ADDREF( pNewHTTPNotify );
rv = pNewHTTPNotify->Init( );
if (NS_SUCCEEDED( rv )) {
rv = pNewHTTPNotify->QueryInterface( NS_GET_IID( nsIHTTPNotify ),
(void **)aHTTPNotify );
}
NS_RELEASE( pNewHTTPNotify );
}
else {
NS_ASSERTION( 0, "P3P: HTTPNotify unable to be created.\n" );
rv = NS_ERROR_OUT_OF_MEMORY;
}
return rv;
}
// P3P HTTP Notify constructor
nsP3PHTTPNotify::nsP3PHTTPNotify( )
: mP3PIsEnabled( PR_FALSE ) {
NS_INIT_ISUPPORTS( );
}
// P3P HTTP Notify destructor
nsP3PHTTPNotify::~nsP3PHTTPNotify( ) {
if (mNetModuleMgr) {
mNetModuleMgr->UnregisterModule( NS_NETWORK_MODULE_MANAGER_HTTP_RESPONSE_CONTRACTID,
this );
#ifdef DEBUG_P3P
mNetModuleMgr->UnregisterModule( NS_NETWORK_MODULE_MANAGER_HTTP_REQUEST_CONTRACTID,
this );
#endif
}
}
// P3P HTTP Notify: Init
//
// Function: Initialization routine for the HTTP Notify listener.
//
// Parms: None
//
NS_METHOD
nsP3PHTTPNotify::Init( ) {
nsresult rv;
PR_LOG( gP3PLogModule,
PR_LOG_NOTICE,
("P3PHTTPNotify: Init, initializing.\n") );
// Create the "P3P" atom
mP3PHeader = NS_NewAtom( P3P_HTTPEXT_P3P_KEY );
if (!mP3PHeader) {
PR_LOG( gP3PLogModule,
PR_LOG_ERROR,
("P3PHTTPNotify: Init, NS_NewAtom for \"P3P\" failed.\n") );
NS_ASSERTION( 0, "P3P: P3PHTTPNotify unable to create \"P3P\" atom.\n" );
rv = NS_ERROR_OUT_OF_MEMORY;
}
if (NS_SUCCEEDED( rv )) {
// Create the "Set-Cookie" atom
mSetCookieHeader = NS_NewAtom( P3P_HTTP_SETCOOKIE_KEY );
if (!mSetCookieHeader) {
PR_LOG( gP3PLogModule,
PR_LOG_ERROR,
("P3PHTTPNotify: Init, NS_NewAtom for \"Set-Cookie\" failed.\n") );
NS_ASSERTION( 0, "P3P: P3PHTTPNotify unable to create \"Set-Cookie\" atom.\n" );
rv = NS_ERROR_OUT_OF_MEMORY;
}
}
if (NS_SUCCEEDED( rv )) {
// Create the "Content-Type" atom
mContentTypeHeader = NS_NewAtom( P3P_HTTP_CONTENTTYPE_KEY );
if (!mContentTypeHeader) {
PR_LOG( gP3PLogModule,
PR_LOG_ERROR,
("P3PHTTPNotify: Init, NS_NewAtom for \"Content-Type\" failed.\n") );
NS_ASSERTION( 0, "P3P: P3PHTTPNotify unable to create \"Content-Type\" atom.\n" );
rv = NS_ERROR_OUT_OF_MEMORY;
}
}
if (NS_SUCCEEDED( rv )) {
// Create the "Referer" atom
mRefererHeader = NS_NewAtom( P3P_HTTP_REFERER_KEY );
if (!mRefererHeader) {
PR_LOG( gP3PLogModule,
PR_LOG_ERROR,
("P3PHTTPNotify: Init, NS_NewAtom for \"Referer\" failed.\n") );
NS_ASSERTION( 0, "P3P: P3PHTTPNotify unable to create \"Referer\" atom.\n" );
rv = NS_ERROR_OUT_OF_MEMORY;
}
}
if (NS_SUCCEEDED( rv )) {
// Get the Network Module Manager service to register the listeners
mNetModuleMgr = do_GetService( kNetModuleMgrCID,
&rv );
if (NS_SUCCEEDED( rv )) {
// Register this object to listen for response headers
rv = mNetModuleMgr->RegisterModule( NS_NETWORK_MODULE_MANAGER_HTTP_RESPONSE_CONTRACTID,
this );
if (NS_SUCCEEDED( rv )) {
#ifdef DEBUG_P3P
// Only register for request headers for debug build
rv = mNetModuleMgr->RegisterModule( NS_NETWORK_MODULE_MANAGER_HTTP_REQUEST_CONTRACTID,
this );
if (NS_FAILED( rv )) {
printf( "P3P: HTTPNotify Request registration failed: %X\n", rv );
PR_LOG( gP3PLogModule,
PR_LOG_ERROR,
("P3PHTTPNotify: Init, mNetModuleMgr->RegisterModule for HTTP responses failed - %X.\n", rv) );
}
#endif
}
else {
#ifdef DEBUG_P3P
printf( "P3P: HTTPNotify Response registration failed: %X\n", rv );
#endif
PR_LOG( gP3PLogModule,
PR_LOG_ERROR,
("P3PHTTPNotify: Init, mNetModuleMgr->RegisterModule for HTTP responses failed - %X.\n", rv) );
}
}
else {
#ifdef DEBUG_P3P
printf( "P3P: Unable to obtain Network Module Manager Service: %X\n", rv );
#endif
PR_LOG( gP3PLogModule,
PR_LOG_ERROR,
("P3PHTTPNotify: Init, do_GetService for Network Module Manager service failed - %X.\n", rv) );
}
}
return rv;
}
// ****************************************************************************
// nsIHTTPNotify routines
// ****************************************************************************
// P3P HTTP Notify: ModifyRequest
//
// Function: Allows modification to the request headers before they are sent to the server.
//
// Parms: 1. In The HTTPChannel object of the request
//
NS_IMETHODIMP
nsP3PHTTPNotify::ModifyRequest( nsISupports *aContext ) {
// Not used in retail build, just satisfying the interface
#ifdef DEBUG_P3P
nsresult rv;
nsCOMPtr<nsIHTTPChannel> pHTTPChannel;
nsCOMPtr<nsIURI> pURI;
// Get the P3P service and check if it is enabled
rv = GetP3PService( );
if (NS_SUCCEEDED( rv ) && mP3PIsEnabled) {
// Make sure we have an HTTP channel
pHTTPChannel = do_QueryInterface( aContext,
&rv );
if (NS_SUCCEEDED( rv )) {
rv = pHTTPChannel->GetURI( getter_AddRefs( pURI ) );
if (NS_SUCCEEDED( rv )) {
if (!mP3PService->IsP3PRelatedURI( pURI )) {
P3P_PRINT_REQUEST_HEADERS( pHTTPChannel );
}
}
}
}
#endif
return NS_OK;
}
// P3P HTTP Notify: AsyncExamineResponse
//
// Function: Allows examination of the response headers received from a server.
//
// Parms: 1. In The HTTPChannel object of the response
//
NS_IMETHODIMP
nsP3PHTTPNotify::AsyncExamineResponse( nsISupports *aContext ) {
nsresult rv;
nsCOMPtr<nsIHTTPChannel> pHTTPChannel;
nsXPIDLCString xcsURISpec,
xcsStatus;
PRUint32 uiStatus;
nsXPIDLCString xcsHeaderKey,
xcsHeaderValue;
nsCOMPtr<nsIURI> pURI;
nsCOMPtr<nsIAtom> pRequestMethod;
nsAutoString sRequestMethod;
nsCOMPtr<nsIDocShellTreeItem> pDocShellTreeItem;
// Get the P3P service and check if it is enabled
rv = GetP3PService( );
if (NS_SUCCEEDED( rv ) && mP3PIsEnabled) {
// Make sure we have an HTTP channel
pHTTPChannel = do_QueryInterface( aContext,
&rv );
if (NS_SUCCEEDED( rv )) {
rv = pHTTPChannel->GetURI( getter_AddRefs( pURI ) );
if (NS_SUCCEEDED( rv )) {
if (!mP3PService->IsP3PRelatedURI( pURI )) {
#ifdef DEBUG_P3P
{ P3P_PRINT_RESPONSE_HEADERS( pHTTPChannel );
}
#endif
pURI->GetSpec( getter_Copies( xcsURISpec ) );
pHTTPChannel->GetResponseStatus(&uiStatus );
pHTTPChannel->GetResponseString( getter_Copies( xcsStatus ) );
PR_LOG( gP3PLogModule,
PR_LOG_NOTICE,
("P3PHTTPNotify: AsyncExamineRequest, Receiving document %s - %i %s.\n", (const char *)xcsURISpec, uiStatus, (const char *)xcsStatus) );
// Process the request headers related to and important to P3P
ProcessRequestHeaders( pHTTPChannel );
// Process the response headers related to and important to P3P
ProcessResponseHeaders( pHTTPChannel );
if (((uiStatus / 100) != 1) && ((uiStatus / 100) != 3)) {
// Not an informational or redirection status
// Look for the "content-type" response header
rv = pHTTPChannel->GetResponseHeader( mContentTypeHeader,
getter_Copies( xcsHeaderValue ) );
if (NS_SUCCEEDED( rv )) {
PRBool bCheckPrivacy = PR_FALSE;
if ((uiStatus / 100) == 2) {
// OK response, so "content-type" should be valid
if (xcsHeaderValue) {
nsCAutoString csHeaderValue((const char *)xcsHeaderValue );
if (!IsHTMLorXML( csHeaderValue )) {
// Not HTML or XML, so we don't have to wait for <LINK> tag detection
bCheckPrivacy = PR_TRUE;
}
}
else {
// No "content-type" header, check privacy
bCheckPrivacy = PR_TRUE;
}
}
else {
// Not an OK response, so perform the check
bCheckPrivacy = PR_TRUE;
}
if (bCheckPrivacy) {
// Privacy Check to be performed now
#ifdef DEBUG_P3P
{ printf( "P3P: Non HTML/XML or unknown content encountered, complete processing\n" );
}
#endif
PR_LOG( gP3PLogModule,
PR_LOG_NOTICE,
("P3PHTTPNotify: AsyncExamineRequest, Non HTML/XML or unknown content encountered.\n") );
// Obtain the request method used
rv = pHTTPChannel->GetRequestMethod( getter_AddRefs( pRequestMethod ) );
if (NS_SUCCEEDED( rv )) {
rv = pRequestMethod->ToString( sRequestMethod );
if (NS_SUCCEEDED( rv )) {
// Get the DocShellTreeItem associated with the request
rv = GetDocShellTreeItem( pHTTPChannel,
getter_AddRefs( pDocShellTreeItem ) );
if (NS_SUCCEEDED( rv )) {
// Check the privacy
rv = mP3PService->CheckPrivacy( sRequestMethod,
pURI,
pDocShellTreeItem,
nsnull );
if (rv == P3P_PRIVACY_NOT_MET) {
// Delete set-cookie header and the cookie
#ifdef DEBUG_P3P
{ printf( "P3P: Privacy not met, removing \"Set-Cookie\" header and cookie\n" );
}
#endif
rv = DeleteCookies( pHTTPChannel );
}
}
}
else {
PR_LOG( gP3PLogModule,
PR_LOG_ERROR,
("P3PHTTPNotify: AsyncExamineResponse, pRequestMethod->ToString failed - %X.\n", rv) );
}
}
else {
PR_LOG( gP3PLogModule,
PR_LOG_ERROR,
("P3PHTTPNotify: AsyncExamineResponse, pHTTPChannel->GetRequestMethod failed - %X.\n", rv) );
}
}
}
else {
PR_LOG( gP3PLogModule,
PR_LOG_ERROR,
("P3PHTTPNotify: AsyncExamineResponse, pHTTPChannel->GetResponseHeader failed - %X.\n", rv) );
}
}
}
}
else {
PR_LOG( gP3PLogModule,
PR_LOG_ERROR,
("P3PHTTPNotify: AsyncExamineResponse, pHTTPChannel->GetURI failed - %X.\n", rv) );
}
}
}
return NS_OK;
}
// ****************************************************************************
// nsP3PHTTPNotify routines
// ****************************************************************************
// P3P HTTP Notify: ProcessRequestHeaders
//
// Function: Examines the request headers looking for the "Referer" request header.
//
// The "Referer" request header value is saved for later processing.
//
// Parms: 1. In The HTTPChannel object of the response
//
NS_METHOD_( void )
nsP3PHTTPNotify::ProcessRequestHeaders( nsIHTTPChannel *aHTTPChannel ) {
nsresult rv;
nsCOMPtr<nsIURI> pURI;
nsXPIDLCString xcsRefererValue;
nsAutoString sRefererValue;
nsCOMPtr<nsIDocShellTreeItem> pDocShellTreeItem;
rv = aHTTPChannel->GetURI( getter_AddRefs( pURI ) );
if (NS_SUCCEEDED( rv )) {
// Look for the "referer" request header
rv = aHTTPChannel->GetRequestHeader( mRefererHeader,
getter_Copies( xcsRefererValue ) );
if (NS_SUCCEEDED( rv )) {
// Process the "referer" request header value
sRefererValue.AssignWithConversion((const char *)xcsRefererValue );
// Get the DocShellTreeItem associated with the request
rv = GetDocShellTreeItem( aHTTPChannel,
getter_AddRefs( pDocShellTreeItem ) );
if (NS_SUCCEEDED( rv )) {
mP3PService->SetRefererHeader( pDocShellTreeItem,
pURI,
sRefererValue );
}
}
else if (NS_FAILED( rv )) {
PR_LOG( gP3PLogModule,
PR_LOG_ERROR,
("P3PHTTPNotify: ProcessRequestHeaders, pHTTPChannel->GetRequestHeader \"Referer\" failed - %X.\n", rv) );
}
}
return;
}
// P3P HTTP Notify: ProcessResponseHeaders
//
// Function: Examines the response headers looking for the "P3P" response header
// and the "Set-Cookie" response header.
//
// If an "P3P" response header is present further processing is
// performed using other routines.
//
// The "Set-Cookie" response header value is saved for later processing.
//
// Parms: 1. In The HTTPChannel object of the response
//
NS_METHOD_( void )
nsP3PHTTPNotify::ProcessResponseHeaders( nsIHTTPChannel *aHTTPChannel ) {
nsresult rv;
nsCOMPtr<nsIURI> pURI;
nsXPIDLCString xcsP3PKey,
xcsP3PValue;
nsXPIDLCString xcsSetCookieKey,
xcsSetCookieValues;
nsCAutoString csP3PValue;
nsAutoString sSetCookieValues;
nsCOMPtr<nsIDocShellTreeItem> pDocShellTreeItem;
rv = aHTTPChannel->GetURI( getter_AddRefs( pURI ) );
if (NS_SUCCEEDED( rv )) {
// Look for the "P3P" response header
rv = aHTTPChannel->GetResponseHeader( mP3PHeader,
getter_Copies( xcsP3PValue ) );
if (NS_SUCCEEDED( rv ) && xcsP3PValue) {
// Process the "P3P" response header value(s)
csP3PValue = xcsP3PValue;
ProcessP3PHeaders( csP3PValue,
aHTTPChannel );
}
else if (NS_FAILED( rv )) {
PR_LOG( gP3PLogModule,
PR_LOG_ERROR,
("P3PHTTPNotify: ProcessResponseHeaders, aHTTPChannel->GetResponseHeader \"P3P\" failed - %X.\n", rv) );
}
}
else {
PR_LOG( gP3PLogModule,
PR_LOG_ERROR,
("P3PHTTPNotify: ProcessResponseHeaders, aHTTPChannel->GetURI failed - %X.\n", rv) );
}
if (NS_SUCCEEDED( rv )) {
// Look for the "set-cookie" response header
rv = aHTTPChannel->GetResponseHeader( mSetCookieHeader,
getter_Copies( xcsSetCookieValues ) );
if (NS_SUCCEEDED( rv ) && xcsSetCookieValues) {
// Process the "set-cookie" response header value(s)
sSetCookieValues.AssignWithConversion((const char *)xcsSetCookieValues );
// Get the DocShellTreeItem associated with the request
rv = GetDocShellTreeItem( aHTTPChannel,
getter_AddRefs( pDocShellTreeItem ) );
if (NS_SUCCEEDED( rv )) {
mP3PService->SetCookieHeader( pDocShellTreeItem,
pURI,
sSetCookieValues );
}
}
else if (NS_FAILED( rv )) {
PR_LOG( gP3PLogModule,
PR_LOG_ERROR,
("P3PHTTPNotify: ProcessResponseHeaders, pHTTPChannel->GetResponseHeader \"Set-Cookie\" failed - %X.\n", rv) );
}
}
return;
}
// P3P HTTP Notify: ProcessP3PHeaders
//
// Function: Process all the HTTP "P3P" response headers values
//
// Parms: 1. In The P3P response header value
// 2. In The HTTPChannel object of the response
//
NS_METHOD
nsP3PHTTPNotify::ProcessP3PHeaders( nsCString& aP3PValues,
nsIHTTPChannel *aHTTPChannel ) {
nsresult rv;
PRInt32 iCharOffset;
nsCAutoString csValues,
csWork;
#ifdef DEBUG_P3P
printf( "P3P: P3P: %s\n", (const char *)aP3PValues );
#endif
PR_LOG( gP3PLogModule,
PR_LOG_NOTICE,
("P3PHTTPNotify: ProcessP3PHeaders, processing P3P header(s): %s.\n", (const char *)aP3PValues) );
// Loop through all "P3P" response header values
csValues = aP3PValues;
do {
iCharOffset = csValues.FindChar( ',' );
csValues.Left( csWork,
iCharOffset );
csValues.Cut( 0,
iCharOffset + 1 );
rv = ProcessIndividualP3PHeader( csWork,
aHTTPChannel );
} while (iCharOffset != kNotFound);
return rv;
}
// P3P HTTP Notify: ProcessIndividualP3PHeader
//
// Function: Process each HTTP "P3P" response headers value
//
// Parms: 1. In The P3P response header value
// 2. In The HTTPChannel object of the response
//
NS_METHOD
nsP3PHTTPNotify::ProcessIndividualP3PHeader( nsCString& aP3PValue,
nsIHTTPChannel *aHTTPChannel ) {
nsresult rv;
nsCOMPtr<nsIURI> pURI;
PRInt32 iLocation;
nsAutoString sPolicyRefFileURISpec;
nsCOMPtr<nsIDocShellTreeItem> pDocShellTreeItem;
PR_LOG( gP3PLogModule,
PR_LOG_NOTICE,
("P3PHTTPNotify: ProcessIndividualP3PHeader, processing P3P header: %s.\n", (const char *)aP3PValue) );
rv = aHTTPChannel->GetURI( getter_AddRefs( pURI ) );
if (NS_SUCCEEDED( rv )) {
#ifdef DEBUG_P3P
{ nsXPIDLCString xcsURISpec;
rv = pURI->GetSpec( getter_Copies( xcsURISpec ) );
printf( " URI: %s\n", (const char *)xcsURISpec );
}
#endif
iLocation = aP3PValue.Find( P3P_HTTPEXT_POLICYREF_KEY,
PR_TRUE );
if (iLocation >= 0) {
nsCAutoString csPolicyRefURISpec;
iLocation = aP3PValue.Find( "=" );
aP3PValue.Right( csPolicyRefURISpec,
aP3PValue.Length( ) - (iLocation + 1) );
csPolicyRefURISpec.Trim( "\"" );
if (csPolicyRefURISpec.Length( ) > 0) {
#ifdef DEBUG_P3P
{ printf( " Policy Ref File: %s\n", (const char *)csPolicyRefURISpec );
}
#endif
PR_LOG( gP3PLogModule,
PR_LOG_NOTICE,
("P3PHTTPNotify: ProcessIndividualP3PHeader, P3P PolicyRef header found - %s.\n", (const char *)csPolicyRefURISpec) );
sPolicyRefFileURISpec.AssignWithConversion( csPolicyRefURISpec );
// Get the DocShellTreeItem associated with the request
rv = GetDocShellTreeItem( aHTTPChannel,
getter_AddRefs( pDocShellTreeItem ) );
if (NS_SUCCEEDED( rv )) {
// Save the PolicyRefFile URI spec
mP3PService->SetPolicyRefFileURISpec( pDocShellTreeItem,
pURI,
P3P_REFERENCE_HTTP_HEADER,
sPolicyRefFileURISpec );
}
}
}
}
else {
PR_LOG( gP3PLogModule,
PR_LOG_ERROR,
("P3PHTTPNotify: ProcessIndividualP3PHeader, aHTTPChannel->GetURI failed - %X.\n", rv) );
}
return rv;
}
// P3P HTTP Notify: IsHTMLorXML
//
// Function: Determines if the content type of the URI object is HTML or XML.
//
// Parms: 1. In The Content-Type response header value
//
NS_METHOD_( PRBool )
nsP3PHTTPNotify::IsHTMLorXML( nsCString& aContentType ) {
nsCAutoString csContentType( aContentType );
if (csContentType.Find( ";" ) >= 0) {
nsCAutoString csWork;
csContentType.Left( csWork,
csContentType.Find( ";" ) );
csContentType = csWork;
}
return (csContentType.EqualsIgnoreCase( "text/html" ) ||
csContentType.EqualsIgnoreCase( "text/xml" ));
}
// P3P HTTP Notify: GetDocShellTreeItem
//
// Function: Finds the DocShellTreeItem object associated with this request.
//
// Parms: 1. In The HTTPChannel object of the request
// 2. Out The DocShellTreeItem object
//
NS_METHOD
nsP3PHTTPNotify::GetDocShellTreeItem( nsIHTTPChannel *aHTTPChannel,
nsIDocShellTreeItem **aDocShellTreeItem ) {
nsresult rv;
nsCOMPtr<nsIInterfaceRequestor> pNotificationCallbacks;
nsCOMPtr<nsILoadGroup> pLoadGroup;
nsCOMPtr<nsIRequest> pRequest;
nsCOMPtr<nsIChannel> pChannel;
nsCOMPtr<nsIDocumentLoader> pDocumentLoader;
nsCOMPtr<nsIDocShellTreeItem> pDocShellTreeItem;
NS_ENSURE_ARG_POINTER( aDocShellTreeItem );
*aDocShellTreeItem = nsnull;
// Get the notification callbacks for the HTTP channel
rv = aHTTPChannel->GetNotificationCallbacks( getter_AddRefs( pNotificationCallbacks ) );
if (NS_SUCCEEDED( rv )) {
if (!pNotificationCallbacks) {
// No notification callbacks for the HTTP channel, check the default channel
PR_LOG( gP3PLogModule,
PR_LOG_NOTICE,
("P3PHTTPNotify: GetDocShellTreeItem, No notification callbacks on current channel, getting default channel.\n") );
// Get the loadgroup for the HTTP channel
rv = aHTTPChannel->GetLoadGroup( getter_AddRefs( pLoadGroup ) );
if (NS_SUCCEEDED( rv ) && pLoadGroup) {
// Get the default load channel
rv = pLoadGroup->GetDefaultLoadRequest( getter_AddRefs( pRequest ) );
if (NS_SUCCEEDED( rv ) && pRequest) {
pChannel = do_QueryInterface( pRequest,
&rv );
if (NS_SUCCEEDED( rv ) && pChannel) {
// Get the notification callbacks for the default channel
rv = pChannel->GetNotificationCallbacks( getter_AddRefs( pNotificationCallbacks ) );
}
}
}
else if (NS_FAILED( rv )) {
PR_LOG( gP3PLogModule,
PR_LOG_ERROR,
("P3PHTTPNotify: GetDocShellTreeItem, aHTTPChannel->GetLoadGroup failed - %X.\n", rv) );
}
}
if (NS_SUCCEEDED( rv ) && pNotificationCallbacks) {
// Check if the notification callback is a DocumentLoader
pDocumentLoader = do_QueryInterface( pNotificationCallbacks,
&rv );
if (pDocumentLoader) {
// It's a DocumentLoader
nsCOMPtr<nsISupports> pContainer;
// Get the container for the DocumentLoader
rv = pDocumentLoader->GetContainer( getter_AddRefs( pContainer ) );
if (NS_SUCCEEDED( rv )) {
// Check if the container is a DocShellTreeItem
pDocShellTreeItem = do_QueryInterface( pContainer,
&rv );
}
else {
PR_LOG( gP3PLogModule,
PR_LOG_ERROR,
("P3PHTTPNotify: GetDocShellTreeItem, pDocumentLoader->GetContainer failed - %X.\n", rv) );
}
}
else {
// It's not a DocumentLoader, check if the notification callback is a DocShellTreeItem
pDocShellTreeItem = do_QueryInterface( pNotificationCallbacks,
&rv );
}
}
else if (NS_SUCCEEDED( rv )) {
PR_LOG( gP3PLogModule,
PR_LOG_ERROR,
("P3PHTTPNotify: GetDocShellTreeItem, unable to obtain NotificationCallbacks.\n") );
}
}
else {
PR_LOG( gP3PLogModule,
PR_LOG_ERROR,
("P3PHTTPNotify: GetDocShellTreeItem, aHTTPChannel->GetNotificationCallbacks failed - %X.\n", rv) );
}
if (NS_SUCCEEDED( rv )) {
if (pDocShellTreeItem) {
*aDocShellTreeItem = pDocShellTreeItem;
NS_ADDREF( *aDocShellTreeItem );
}
else {
PR_LOG( gP3PLogModule,
PR_LOG_ERROR,
("P3PHTTPNotify: GetDocShellTreeItem, unable to obtain DocShellTreeItem.\n") );
rv = NS_ERROR_FAILURE;
}
}
return rv;
}
// P3P HTTP Notify: DeleteCookies
//
// Function: Deletes any "Set-Cookie" response headers.
//
// Parms: 1. In The HTTPChannel object of the request
//
NS_METHOD
nsP3PHTTPNotify::DeleteCookies( nsIHTTPChannel *aHTTPChannel ) {
nsresult rv;
nsXPIDLCString xcsSetCookieValues;
PR_LOG( gP3PLogModule,
PR_LOG_NOTICE,
("P3PHTTPNotify: DeleteCookies, deleting \"Set-Cookie\" response header.\n") );
// Look for the "set-cookie" response header
rv = aHTTPChannel->GetResponseHeader( mSetCookieHeader,
getter_Copies( xcsSetCookieValues ) );
if (NS_SUCCEEDED( rv ) && xcsSetCookieValues) {
#ifdef DEBUG_P3P
printf( "P3P: Set-Cookie: %s\n", (const char *)xcsSetCookieValues );
#endif
// Clear the "set-cookie" response header
aHTTPChannel->SetResponseHeader( mSetCookieHeader,
nsnull );
#ifdef DEBUG_P3P
{
aHTTPChannel->GetResponseHeader( mSetCookieHeader,
getter_Copies( xcsSetCookieValues ) );
if (xcsSetCookieValues) {
printf( "P3P: Set-Cookie: %s\n", (const char *)xcsSetCookieValues );
}
}
#endif
}
else if (NS_FAILED( rv )) {
PR_LOG( gP3PLogModule,
PR_LOG_ERROR,
("P3PHTTPNotify: DeleteCookies, aHTTPChannel->GetResponseHeader failed - %X.\n", rv) );
}
return rv;
}
// P3P HTTP Notify: GetP3PService
//
// Function: Obtain the P3P service and determine if it is enabled.
//
// Parms: None
//
NS_METHOD
nsP3PHTTPNotify::GetP3PService( ) {
nsresult rv = NS_OK;
if (!mP3PService) {
mP3PService = do_GetService( NS_P3PSERVICE_CONTRACTID,
&rv );
if (NS_FAILED( rv )) {
PR_LOG( gP3PLogModule,
PR_LOG_ERROR,
("P3PHTTPNotify: GetP3PService, do_GetService for P3P service failed - %X.\n", rv) );
}
}
if (mP3PService) {
rv = mP3PService->P3PIsEnabled(&mP3PIsEnabled );
if (NS_SUCCEEDED( rv ) && !mP3PIsEnabled) {
PR_LOG( gP3PLogModule,
PR_LOG_NOTICE,
("P3PHTTPNotify: GetP3PService, P3P Service is not enabled.\n") );
}
else if (NS_FAILED( rv )) {
PR_LOG( gP3PLogModule,
PR_LOG_ERROR,
("P3PHTTPNotify: GetP3PService, mP3PService->P3PIsEnabled failed - %X.\n", rv) );
}
}
return rv;
}

View File

@@ -0,0 +1,91 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Mozilla 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/MPL/
*
* 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 imitations under the License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is International
* Business Machines Corporation. Portions created by IBM
* Corporation are Copyright (C) 2000 International Business
* Machines Corporation. All Rights Reserved.
*
* Contributor(s): IBM Corporation.
*
*/
#ifndef nsP3PHTTPNotify_h___
#define nsP3PHTTPNotify_h___
#include "nsIP3PCService.h"
#include <nsCOMPtr.h>
#include <nsISupports.h>
#include <nsIHttpNotify.h>
#include <nsINetModuleMgr.h>
#include <nsIHTTPChannel.h>
#include <nsIDocShellTreeItem.h>
#include <nsIAtom.h>
class nsP3PHTTPNotify : public nsIHTTPNotify {
public:
// nsISupports
NS_DECL_ISUPPORTS
// nsIHTTPNotify methods
NS_DECL_NSIHTTPNOTIFY
// nsP3PHTTPNotify methods
nsP3PHTTPNotify( );
virtual ~nsP3PHTTPNotify( );
NS_METHOD Init( );
protected:
NS_METHOD_( void ) ProcessRequestHeaders( nsIHTTPChannel *aHTTPChannel );
NS_METHOD_( void ) ProcessResponseHeaders( nsIHTTPChannel *aHTTPChannel );
NS_METHOD ProcessP3PHeaders( nsCString& aP3PValues,
nsIHTTPChannel *aHTTPChannel );
NS_METHOD ProcessIndividualP3PHeader( nsCString& aP3PValue,
nsIHTTPChannel *aHTTPChannel );
NS_METHOD_( PRBool ) IsHTMLorXML( nsCString& aContentType );
NS_METHOD GetDocShellTreeItem( nsIHTTPChannel *aHTTPChannel,
nsIDocShellTreeItem **aDocShellTreeItem );
NS_METHOD DeleteCookies( nsIHTTPChannel *aHTTPChannel );
NS_METHOD GetP3PService( );
nsCOMPtr<nsIP3PCService> mP3PService; // The P3P Service
PRBool mP3PIsEnabled; // An indicator as to whether the P3P Service is enabled
nsCOMPtr<nsINetModuleMgr> mNetModuleMgr; // The Network Module Manager
nsCOMPtr<nsIAtom> mP3PHeader, // Various request and response header types
mSetCookieHeader,
mContentTypeHeader,
mRefererHeader;
};
extern
NS_EXPORT NS_METHOD NS_NewP3PHTTPNotify( nsIHTTPNotify **aHTTPNotify );
#endif /* nsP3PHTTPNotify_h___ */

View File

@@ -0,0 +1,37 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Mozilla 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/MPL/
*
* 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 imitations under the License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is International
* Business Machines Corporation. Portions created by IBM
* Corporation are Copyright (C) 2000 International Business
* Machines Corporation. All Rights Reserved.
*
* Contributor(s): IBM Corporation.
*
*/
#ifndef nsP3PLogging_h__
#define nsP3PLogging_h__
#include <prlog.h>
#ifndef P3P_LOG_DEFINITION
extern PRLogModuleInfo *gP3PLogModule;
#else
PRLogModuleInfo *gP3PLogModule = nsnull;
#endif
#endif /* nsP3PLogging_h__ */

View File

@@ -0,0 +1,67 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Mozilla 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/MPL/
*
* 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 imitations under the License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is International
* Business Machines Corporation. Portions created by IBM
* Corporation are Copyright (C) 2000 International Business
* Machines Corporation. All Rights Reserved.
*
* Contributor(s): IBM Corporation.
*
*/
#include "nsP3PService.h"
#include "nsP3PUIService.h"
#include "nsP3PUI.h"
#include <nsIGenericFactory.h>
// Define a table of CIDs implemented by this module:
// Description
// Class ID
// Prog ID
// Instance creation function
static
nsModuleComponentInfo gP3PComponents[] = {
{ NS_P3PSERVICE_CLASSNAME,
NS_P3PSERVICE_CID,
NS_P3PSERVICE_CONTRACTID,
nsP3PService::Create,
nsP3PService::CategoryRegister,
nsP3PService::CategoryUnregister },
{ NS_P3PUISERVICE_CLASSNAME,
NS_P3PUISERVICE_CID,
NS_P3PUISERVICE_CONTRACTID,
nsP3PUIService::Create},
{ NS_P3PUI_CLASSNAME,
NS_P3PUI_CID,
NS_P3PUI_CONTRACTID,
nsP3PUI::Create}
};
// Implement the NSGetModule() exported function for your module
// and the entire implementation of the module object.
NS_IMPL_NSGETMODULE( "nsP3PModule", gP3PComponents )
// Define the tags that the ElementObserver will be observing.
extern
const char * gObserveElements[] = {
"LINK",
nsnull
};

View File

@@ -0,0 +1,267 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Mozilla 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/MPL/
*
* 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 imitations under the License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is International
* Business Machines Corporation. Portions created by IBM
* Corporation are Copyright (C) 2000 International Business
* Machines Corporation. All Rights Reserved.
*
* Contributor(s): IBM Corporation.
*
*/
#include "nsP3PDefines.h"
#include "nsP3PLogging.h"
#include "nsP3PObserverFormSubmit.h"
#include <nsIServiceManager.h>
#include <nsIPresShell.h>
#include <nsString.h>
// ****************************************************************************
// nsP3PObserverFormSubmit Implementation routines
// ****************************************************************************
static NS_DEFINE_CID( kP3PServiceCID, NS_P3PSERVICE_CID );
// P3P Observer Form Submit: nsISupports
NS_IMPL_ISUPPORTS2( nsP3PObserverFormSubmit, nsIObserver,
nsIFormSubmitObserver );
// P3P Observer Form Submit: Creation routine
NS_METHOD
NS_NewP3PObserverFormSubmit( nsIObserver **aObserverFormSubmit ) {
nsresult rv;
nsP3PObserverFormSubmit *pNewObserverFormSubmit = nsnull;
#ifdef DEBUG_P3P
printf("P3P: ObserverFormSubmit initializing.\n");
#endif
NS_ENSURE_ARG_POINTER( aObserverFormSubmit );
*aObserverFormSubmit = nsnull;
pNewObserverFormSubmit = new nsP3PObserverFormSubmit( );
if (pNewObserverFormSubmit) {
NS_ADDREF( pNewObserverFormSubmit );
rv = pNewObserverFormSubmit->Init( );
if (NS_SUCCEEDED( rv )) {
rv = pNewObserverFormSubmit->QueryInterface( NS_GET_IID( nsIObserver ),
(void **)aObserverFormSubmit );
}
NS_RELEASE( pNewObserverFormSubmit );
}
else {
NS_ASSERTION( 0, "P3P: ObserverFormSubmit unable to be created.\n" );
rv = NS_ERROR_OUT_OF_MEMORY;
}
return rv;
}
// P3P Observer Form Submit: Constructor
nsP3PObserverFormSubmit::nsP3PObserverFormSubmit( )
: mP3PIsEnabled( PR_FALSE ) {
NS_INIT_ISUPPORTS( );
}
// P3P Observer Form Submit: Destructor
nsP3PObserverFormSubmit::~nsP3PObserverFormSubmit( ) {
if (mObserverService) {
mObserverService->RemoveObserver( this,
mObserverTopic.GetUnicode( ) );
}
}
// P3P Observer Form Submit: Init
//
// Function: Initialization routine for the Form Submission observer.
//
// Parms: None
//
NS_METHOD
nsP3PObserverFormSubmit::Init( ) {
nsresult rv;
PR_LOG( gP3PLogModule,
PR_LOG_NOTICE,
("P3PObserverFormSubmit: Init, initializing.\n") );
// Set the topic to be observed
mObserverTopic.AssignWithConversion( NS_FORMSUBMIT_SUBJECT );
// Get the Observer service
mObserverService = do_GetService( NS_OBSERVERSERVICE_CONTRACTID,
&rv );
if (NS_SUCCEEDED( rv )) {
// Register to observe form submissions
rv = mObserverService->AddObserver( this,
mObserverTopic.GetUnicode( ) );
if (NS_FAILED( rv )) {
#ifdef DEBUG_P3P
printf( "P3P: Unable to register with Observer Service for form submission topic: %X\n", rv );
#endif
PR_LOG( gP3PLogModule,
PR_LOG_ERROR,
("P3PObserverFormSubmit: Init, mObserverService->AddObserver failed - %X.\n", rv) );
}
}
else {
#ifdef DEBUG_P3P
printf( "P3P: Unable to obtain Observer Service: %X\n", rv );
#endif
PR_LOG( gP3PLogModule,
PR_LOG_ERROR,
("P3PObserverFormSubmit: Init, do_GetService for Observer service failed - %X.\n", rv) );
}
return rv;
}
// ****************************************************************************
// nsIObserver routines
// ****************************************************************************
// P3P Observer Form Submit: Observe
//
// Function: Not used, only here to satisfy the interface.
//
NS_IMETHODIMP
nsP3PObserverFormSubmit::Observe( nsISupports *aSubject,
const PRUnichar *aTopic,
const PRUnichar *aSomeData ) {
return NS_OK;
}
// ****************************************************************************
// nsIFormSubmitObserver routines
// ****************************************************************************
// P3P Observer Form Submit: Notify
//
// Function: Allows for determination of whether to allow the form submission.
//
// Parms: 1. In The <FORM> Content object
// 2. In The DOMWindowInternal associated with the form submission
// 3. In The URI object of the form submission target
//
NS_IMETHODIMP
nsP3PObserverFormSubmit::Notify( nsIContent *aContent,
nsIDOMWindowInternal *aDOMWindowInternal,
nsIURI *aURI,
PRBool *aCancelSubmit ) {
nsresult rv;
// Initially allow the submit to occur
*aCancelSubmit = PR_FALSE;
// Get the P3P service and check if it is enabled
rv = GetP3PService( );
if (NS_SUCCEEDED( rv ) && mP3PIsEnabled) {
#ifdef DEBUG_P3P
printf( "P3P: ObserverFormSubmit has been notified\n" );
aContent->List( );
#endif
PR_LOG( gP3PLogModule,
PR_LOG_ERROR,
("P3PObserverFormSubmit: Notify, form submission privacy check in progress.\n") );
// Check the privacy
rv = mP3PService->CheckPrivacyFormSubmit( aURI,
aDOMWindowInternal,
aContent,
aCancelSubmit );
#ifdef DEBUG_P3P
printf( "P3P: Submission %s\n", *aCancelSubmit ? "CANCELLED" : "ALLOWED" );
#endif
PR_LOG( gP3PLogModule,
PR_LOG_NOTICE,
("P3PObserverFormSubmit: Notify, form submission %s.\n", *aCancelSubmit ? "CANCELLED" : "ALLOWED") );
}
return NS_OK;
}
// ****************************************************************************
// nsP3PObserverFormSubmit routines
// ****************************************************************************
// P3P Observer Form Submit: GetP3PService
//
// Function: Obtain the P3P service and determine if it is enabled.
//
// Parms: None
//
NS_METHOD
nsP3PObserverFormSubmit::GetP3PService( ) {
nsresult rv = NS_OK;
if (!mP3PService) {
mP3PService = do_GetService( NS_P3PSERVICE_CONTRACTID,
&rv );
if (NS_FAILED( rv )) {
PR_LOG( gP3PLogModule,
PR_LOG_ERROR,
("P3PObserverFormSubmit: GetP3PService, do_GetService for P3P service failed - %X.\n", rv) );
}
}
if (mP3PService) {
rv = mP3PService->P3PIsEnabled(&mP3PIsEnabled );
if (NS_SUCCEEDED( rv ) && !mP3PIsEnabled) {
PR_LOG( gP3PLogModule,
PR_LOG_NOTICE,
("P3PObserverFormSubmit: GetP3PService, P3P Service is not enabled.\n") );
}
else if (NS_FAILED( rv )) {
PR_LOG( gP3PLogModule,
PR_LOG_ERROR,
("P3PObserverFormSubmit: GetP3PService, mP3PService->P3PIsEnabled failed - %X.\n", rv) );
}
}
return rv;
}

View File

@@ -0,0 +1,80 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Mozilla 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/MPL/
*
* 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 imitations under the License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is International
* Business Machines Corporation. Portions created by IBM
* Corporation are Copyright (C) 2000 International Business
* Machines Corporation. All Rights Reserved.
*
* Contributor(s): IBM Corporation.
*
*/
#ifndef nsP3PObserverFormSubmit_h__
#define nsP3PObserverFormSubmit_h__
#include "nsIP3PCService.h"
#include <nsCOMPtr.h>
#include <nsISupports.h>
#include <nsIObserver.h>
#include <nsIContent.h> // nsIFormSubmitObserver.h does not include nsIContent...
#include <nsIFormSubmitObserver.h>
#include <nsIObserverService.h>
#include <nsIContent.h>
#include <nsIDOMWindowInternal.h>
#include <nsIURI.h>
class nsP3PObserverFormSubmit : public nsIObserver,
public nsIFormSubmitObserver {
public:
// nsISupports
NS_DECL_ISUPPORTS
// nsIObserver
NS_DECL_NSIOBSERVER
// nsIFromSubmitObserver
// NS_DECL_NSIFORMSUBMITOBSERVER
NS_IMETHOD Notify( nsIContent *aContent,
nsIDOMWindowInternal *aDOMWindowInternal,
nsIURI *aURI,
PRBool *aCancelSubmit );
// nsP3PObserver HTML methods
nsP3PObserverFormSubmit( );
virtual ~nsP3PObserverFormSubmit( );
NS_METHOD Init( );
protected:
NS_METHOD GetP3PService( );
nsCOMPtr<nsIP3PCService> mP3PService; // The P3P Service
PRBool mP3PIsEnabled; // An indicator as to whether the P3P Service is enabled
nsString mObserverTopic; // The topic to be observed
nsCOMPtr<nsIObserverService> mObserverService; // The Observer Service
};
extern
NS_EXPORT NS_METHOD NS_NewP3PObserverFormSubmit( nsIObserver **aObserverFormSubmit );
#endif /* nsP3PObserverFormSubmit_h__ */

View File

@@ -0,0 +1,481 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Mozilla 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/MPL/
*
* 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 imitations under the License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is International
* Business Machines Corporation. Portions created by IBM
* Corporation are Copyright (C) 2000 International Business
* Machines Corporation. All Rights Reserved.
*
* Contributor(s): IBM Corporation.
*
*/
#include "nsP3PDefines.h"
#include "nsP3PObserverHTML.h"
#include "nsP3PObserverUtils.h"
#include "nsP3PLogging.h"
#include <nsIServiceManager.h>
#include <nsIParser.h>
#include <nsIDocShell.h>
#include <nsIDocShellTreeItem.h>
#include <nsIWebNavigation.h>
#include <nsIDocument.h>
#include <nsString.h>
#include <nsXPIDLString.h>
// ****************************************************************************
// nsP3PObserverHTML Implementation routines
// ****************************************************************************
static NS_DEFINE_CID( kP3PServiceCID, NS_P3PSERVICE_CID );
// P3P Observer HTML nsISupports
NS_IMPL_ISUPPORTS3( nsP3PObserverHTML, nsIObserver,
nsIElementObserver,
nsISupportsWeakReference );
// P3P Observer HTML creation routine
NS_METHOD
NS_NewP3PObserverHTML( nsIObserver **aObserverHTML ) {
nsresult rv;
nsP3PObserverHTML *pNewObserverHTML = nsnull;
#ifdef DEBUG_P3P
printf("P3P: ObserverHTML initializing.\n");
#endif
NS_ENSURE_ARG_POINTER( aObserverHTML );
*aObserverHTML = nsnull;
pNewObserverHTML = new nsP3PObserverHTML( );
if (pNewObserverHTML) {
NS_ADDREF( pNewObserverHTML );
rv = pNewObserverHTML->Init( );
if (NS_SUCCEEDED( rv )) {
rv = pNewObserverHTML->QueryInterface( NS_GET_IID( nsIObserver ),
(void **)aObserverHTML );
}
NS_RELEASE( pNewObserverHTML );
}
else {
NS_ASSERTION( 0, "P3P: ObserverHTML unable to be created.\n" );
rv = NS_ERROR_OUT_OF_MEMORY;
}
return rv;
}
// P3P Observer HTML: Constructor
nsP3PObserverHTML::nsP3PObserverHTML( )
: mP3PIsEnabled( PR_FALSE ) {
NS_INIT_ISUPPORTS( );
}
// P3P Observer HTML: Destructor
nsP3PObserverHTML::~nsP3PObserverHTML( ) {
if (mObserverService) {
mObserverService->RemoveObserver( this,
mObserverTopic.GetUnicode( ) );
}
}
// P3P Observer HTML: Init
//
// Function: Initialization routine for the HTML Tag observer.
//
// Parms: None
//
NS_METHOD
nsP3PObserverHTML::Init( ) {
nsresult rv;
PR_LOG( gP3PLogModule,
PR_LOG_NOTICE,
("P3PObserverHTML: Init, initializing.\n") );
// Set the topic to be observed
mObserverTopic.AssignWithConversion( kHTMLTextContentType );
// Get the Observer service
mObserverService = do_GetService( NS_OBSERVERSERVICE_CONTRACTID,
&rv );
if (NS_SUCCEEDED( rv )) {
// Register to observe HTML tags
rv = mObserverService->AddObserver( this,
mObserverTopic.GetUnicode( ) );
if (NS_FAILED( rv )) {
#ifdef DEBUG_P3P
printf( "P3P: Unable to register with Observer Service for HTML tag notification topic: %X\n", rv );
#endif
PR_LOG( gP3PLogModule,
PR_LOG_ERROR,
("P3PObserverHTML: Init, mObserverService->AddObserver failed - %X.\n", rv) );
}
}
else {
#ifdef DEBUG_P3P
printf( "P3P: Unable to obtain Observer Service: %X\n", rv );
#endif
PR_LOG( gP3PLogModule,
PR_LOG_ERROR,
("P3PObserverHTML: Init, do_GetService for Observer service failed - %X.\n", rv) );
}
return rv;
}
// ****************************************************************************
// nsIObserver routines
// ****************************************************************************
// P3P Observer HTML: Observe
//
// Function: Not used, only here to satisfy the interface.
//
NS_IMETHODIMP
nsP3PObserverHTML::Observe( nsISupports *aSubject,
const PRUnichar *aTopic,
const PRUnichar *aSomeData ) {
return NS_OK;
}
// ****************************************************************************
// nsIElementObserver routines
// ****************************************************************************
// P3P Observer HTML: GetTagNameAt
//
// Function: Returns the HTML tags that this observer wants to be notified about.
//
// Parms: 1. In The index or count of this call
//
NS_IMETHODIMP_(const char *)
nsP3PObserverHTML::GetTagNameAt( PRUint32 aTagIndex ) {
// Return the tag(s) to be observed
return gObserveElements[aTagIndex];
}
// P3P Observer HTML: Notify
//
// Function: Allows for processing based upon the presence of an HTML tag.
//
// Parms: 1. In The Document object
// 2. In The HTML tag found
// 3. In The number of attributes associated with the HTML tag
// 4. In The attribute names
// 5. In The attribute values
//
NS_IMETHODIMP
nsP3PObserverHTML::Notify( PRUint32 aDocumentID,
eHTMLTags aTag,
PRUint32 aNumOfAttributes,
const PRUnichar *aNameArray[],
const PRUnichar *aValueArray[] ) {
nsresult rv = NS_OK;
nsCOMPtr<nsIDocument> pDocument;
nsCOMPtr<nsIDocShellTreeItem> pDocShellTreeItem;
nsIURI *pURI = nsnull;
rv = GetP3PService( );
if (NS_SUCCEEDED( rv ) && mP3PIsEnabled) {
#ifdef DEBUG_P3P
{ if (aTag == eHTMLTag_link)
printf( "P3P: ObserverHTML #1 has been notified of LINK tag.\n" );
else
printf( "P3P: ObserverHTML #1 has been notified of UNKNOWN tag.\n" );
}
#endif
if (aTag == eHTMLTag_link) {
pDocument = do_QueryInterface((nsISupports *)aDocumentID,
&rv );
if (NS_SUCCEEDED( rv )) {
pDocShellTreeItem = do_QueryInterface( pDocument,
&rv );
if (NS_SUCCEEDED( rv )) {
pURI = pDocument->GetDocumentURL( );
if (pURI) {
rv = nsP3PObserverUtils::ExamineLINKTag( pURI,
aNumOfAttributes,
aNameArray,
aValueArray,
pDocShellTreeItem,
mP3PService );
NS_RELEASE( pURI );
}
}
}
}
}
return rv;
}
// P3P Observer HTML: Notify
//
// Function: Allows for processing based upon the presence of an HTML tag.
//
// Parms: 1. In The Document object
// 2. In The HTML tag found
// 3. In The number of attributes associated with the HTML tag
// 4. In The attribute names
// 5. In The attribute values
//
NS_IMETHODIMP
nsP3PObserverHTML::Notify( PRUint32 aDocumentID,
const PRUnichar *aTag,
PRUint32 aNumOfAttributes,
const PRUnichar *aNameArray[],
const PRUnichar *aValueArray[] ) {
nsresult rv = NS_OK;
nsCOMPtr<nsIDocument> pDocument;
nsCOMPtr<nsIDocShellTreeItem> pDocShellTreeItem;
nsIURI *pURI = nsnull;
rv = GetP3PService( );
if (NS_SUCCEEDED( rv ) && mP3PIsEnabled) {
#ifdef DEBUG_P3P
{ nsCAutoString csTag;
csTag.AssignWithConversion( aTag );
printf( "P3P: ObserverHTML #2 has been notified of %s tag.\n", (const char *)csTag );
}
#endif
if (nsCRT::strcasecmp( aTag, "LINK" ) == 0) {
pDocument = do_QueryInterface((nsISupports *)aDocumentID,
&rv );
if (NS_SUCCEEDED( rv )) {
pDocShellTreeItem = do_QueryInterface( pDocument,
&rv );
if (NS_SUCCEEDED( rv )) {
pURI = pDocument->GetDocumentURL( );
if (pURI) {
rv = nsP3PObserverUtils::ExamineLINKTag( pURI,
aNumOfAttributes,
aNameArray,
aValueArray,
pDocShellTreeItem,
mP3PService );
NS_RELEASE( pURI );
}
}
}
}
}
return rv;
}
// P3P Observer HTML: Notify
//
// Function: Allows for processing based upon the presence of an HTML tag.
//
// Parms: 1. In The ParserBundle object
// 2. In The HTML tag found
// 3. In The attribute names
// 4. In The attribute values
//
NS_IMETHODIMP
nsP3PObserverHTML::Notify( nsISupports *aDocumentID,
const PRUnichar *aTag,
const nsStringArray *aKeys,
const nsStringArray *aValues ) {
nsresult rv = NS_OK;
nsCOMPtr<nsISupportsParserBundle> pParserBundle;
nsAutoString sDocumentKey;
nsCOMPtr<nsIDocShell> pDocShell;
nsCOMPtr<nsIDocShellTreeItem> pDocShellTreeItem;
nsCOMPtr<nsIWebNavigation> pWebNavigation;
nsCOMPtr<nsIURI> pURI;
// Get the P3P service and check if it is enabled
rv = GetP3PService( );
if (NS_SUCCEEDED( rv ) && mP3PIsEnabled) {
#ifdef DEBUG_P3P
{ nsCAutoString csTag;
csTag.AssignWithConversion( aTag );
printf( "P3P: ObserverHTML #3 has been notified of %s tag.\n", (const char *)csTag );
}
#endif
if (nsCRT::strcasecmp( aTag, "LINK" ) == 0) {
// Notified of a LINK tag
PR_LOG( gP3PLogModule,
PR_LOG_NOTICE,
("P3PObserverHTML: Notify, notified of \"LINK\" tag.\n") );
// Get the ParserBundle
pParserBundle = do_QueryInterface( aDocumentID,
&rv );
if (NS_SUCCEEDED( rv )) {
// Extract the DocShell from the ParserBundle
sDocumentKey.AssignWithConversion( "docshell" );
rv = pParserBundle->GetDataFromBundle( sDocumentKey,
getter_AddRefs( pDocShell ) );
if (NS_SUCCEEDED( rv ) && pDocShell) {
pDocShellTreeItem = do_QueryInterface( pDocShell,
&rv );
if (NS_SUCCEEDED( rv )) {
pWebNavigation = do_QueryInterface( pDocShell,
&rv );
if (NS_SUCCEEDED( rv )) {
rv = pWebNavigation->GetCurrentURI( getter_AddRefs( pURI ) );
if (NS_SUCCEEDED( rv ) && pURI) {
// Process the LINK tag
rv = nsP3PObserverUtils::ExamineLINKTag( pURI,
aKeys,
aValues,
pDocShellTreeItem,
mP3PService );
}
else if (NS_FAILED( rv )) {
PR_LOG( gP3PLogModule,
PR_LOG_ERROR,
("P3PObserverHTML: Notify, pWebNavigation->GetCurrentURI failed - %X.\n", rv) );
}
}
else {
PR_LOG( gP3PLogModule,
PR_LOG_ERROR,
("P3PObserverHTML: Notify, do_QueryInterface for WebNavigation failed - %X.\n", rv) );
}
}
else {
PR_LOG( gP3PLogModule,
PR_LOG_ERROR,
("P3PObserverHTML: Notify, do_QueryInterface for DocShellTreeItem failed - %X.\n", rv) );
}
}
else if (NS_FAILED( rv )) {
PR_LOG( gP3PLogModule,
PR_LOG_ERROR,
("P3PObserverHTML: Notify, pParserBundle->GetDataFromBundle failed - %X.\n", rv) );
}
}
else {
PR_LOG( gP3PLogModule,
PR_LOG_ERROR,
("P3PObserverHTML: Notify, do_QueryInterface for ParserBundle failed - %X.\n", rv) );
}
}
}
return rv;
}
// ****************************************************************************
// nsP3PObserverHTML routines
// ****************************************************************************
// P3P Observer HTML: GetP3PService
//
// Function: Obtain the P3P service and determine if it is enabled.
//
// Parms: None
//
NS_METHOD
nsP3PObserverHTML::GetP3PService( ) {
nsresult rv = NS_OK;
if (!mP3PService) {
mP3PService = do_GetService( NS_P3PSERVICE_CONTRACTID,
&rv );
if (NS_FAILED( rv )) {
PR_LOG( gP3PLogModule,
PR_LOG_ERROR,
("P3PObserverHTML: GetP3PService, do_GetService for P3P service failed - %X.\n", rv) );
}
}
if (mP3PService) {
rv = mP3PService->P3PIsEnabled(&mP3PIsEnabled );
if (NS_SUCCEEDED( rv ) && !mP3PIsEnabled) {
PR_LOG( gP3PLogModule,
PR_LOG_NOTICE,
("P3PObserverHTML: GetP3PService, P3P Service is not enabled.\n") );
}
else if (NS_FAILED( rv )) {
PR_LOG( gP3PLogModule,
PR_LOG_ERROR,
("P3PObserverHTML: GetP3PService, mP3PService->P3PIsEnabled failed - %X.\n", rv) );
}
}
return rv;
}

View File

@@ -0,0 +1,91 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Mozilla 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/MPL/
*
* 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 imitations under the License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is International
* Business Machines Corporation. Portions created by IBM
* Corporation are Copyright (C) 2000 International Business
* Machines Corporation. All Rights Reserved.
*
* Contributor(s): IBM Corporation.
*
*/
#ifndef nsP3PObserverHTML_h__
#define nsP3PObserverHTML_h__
#include "nsIP3PCService.h"
#include <nsCOMPtr.h>
#include <nsISupports.h>
#include <nsIObserver.h>
#include <nsIElementObserver.h>
#include <nsWeakReference.h>
#include <nsIObserverService.h>
extern
const char *gObserveElements[];
class nsP3PObserverHTML : public nsIObserver,
public nsIElementObserver,
public nsSupportsWeakReference {
public:
// nsISupports
NS_DECL_ISUPPORTS
// nsIObserver
NS_DECL_NSIOBSERVER
// nsIElementObserver
// NS_DECL_NSIELEMENTOBSERVER
NS_IMETHOD_(const char *) GetTagNameAt( PRUint32 aTagIndex );
NS_IMETHOD Notify( PRUint32 aDocumentID,
eHTMLTags aTag,
PRUint32 aNumOfAttributes,
const PRUnichar *aNameArray[],
const PRUnichar *aValueArray[] );
NS_IMETHOD Notify( PRUint32 aDocumentID,
const PRUnichar *aTag,
PRUint32 aNumOfAttributes,
const PRUnichar *aNameArray[],
const PRUnichar *aValueArray[] );
NS_IMETHOD Notify( nsISupports *aDocumentID,
const PRUnichar *aTag,
const nsStringArray *aKeys,
const nsStringArray *aValues );
// nsP3PObserver HTML methods
nsP3PObserverHTML( );
virtual ~nsP3PObserverHTML( );
NS_METHOD Init( );
protected:
NS_METHOD GetP3PService( );
nsCOMPtr<nsIP3PCService> mP3PService; // The P3P Service
PRBool mP3PIsEnabled; // An indicator as to whether the P3P Service is enabled
nsString mObserverTopic; // The topic to be observed
nsCOMPtr<nsIObserverService> mObserverService; // The Observer Service
};
extern
NS_EXPORT NS_METHOD NS_NewP3PObserverHTML( nsIObserver **aObserverHTML );
#endif /* nsP3PObserverHTML_h__ */

View File

@@ -0,0 +1,433 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Mozilla 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/MPL/
*
* 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 imitations under the License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is International
* Business Machines Corporation. Portions created by IBM
* Corporation are Copyright (C) 2000 International Business
* Machines Corporation. All Rights Reserved.
*
* Contributor(s): IBM Corporation.
*
*/
#include "nsP3PDefines.h"
#include "nsP3PObserverLayout.h"
#include "nsP3PLogging.h"
#include <nsCOMPtr.h>
#include <nsIServiceManager.h>
#include <nsIPresShell.h>
#include <nsIDocShellTreeItem.h>
#include <nsIWebNavigation.h>
#include <nsCURILoader.h>
#include <nsIURILoader.h>
#include <nsILoadGroup.h>
#include <nsIHTTPChannel.h>
#include <nsISimpleEnumerator.h>
#include <nsString.h>
#include <nsXPIDLString.h>
// ****************************************************************************
// nsP3PObserverLayout Implementation routines
// ****************************************************************************
static NS_DEFINE_CID( kP3PServiceCID, NS_P3PSERVICE_CID );
// P3P Observer Layout nsISupports
NS_IMPL_ISUPPORTS2( nsP3PObserverLayout, nsIObserver,
nsISupportsWeakReference );
// P3P Observer Layout creation routine
NS_METHOD
NS_NewP3PObserverLayout( nsIObserver **aObserverLayout ) {
nsresult rv;
nsP3PObserverLayout *pNewObserverLayout = nsnull;
#ifdef DEBUG_P3P
printf("P3P: ObserverLayout initializing.\n");
#endif
NS_ENSURE_ARG_POINTER( aObserverLayout );
*aObserverLayout = nsnull;
pNewObserverLayout = new nsP3PObserverLayout( );
if (pNewObserverLayout) {
NS_ADDREF( pNewObserverLayout );
rv = pNewObserverLayout->Init( );
if (NS_SUCCEEDED( rv )) {
rv = pNewObserverLayout->QueryInterface( NS_GET_IID( nsIObserver ),
(void **)aObserverLayout );
}
NS_RELEASE( pNewObserverLayout );
}
else {
NS_ASSERTION( 0, "P3P: ObserverLayout unable to be created.\n" );
rv = NS_ERROR_OUT_OF_MEMORY;
}
return rv;
}
// P3P Observer Layout Constructor
nsP3PObserverLayout::nsP3PObserverLayout( )
: mP3PIsEnabled( PR_FALSE ) {
NS_INIT_ISUPPORTS( );
}
// P3P Observer Layout Destructor
nsP3PObserverLayout::~nsP3PObserverLayout( ) {
if (mObserverService) {
mObserverService->RemoveObserver( this,
mObserverTopic.GetUnicode( ) );
}
}
// P3P Observer Layout: Init
//
// Function: Initialization routine for the Layout observer.
//
// Parms: None
//
NS_METHOD
nsP3PObserverLayout::Init( ) {
nsresult rv;
PR_LOG( gP3PLogModule,
PR_LOG_NOTICE,
("P3PObserverLayout: Init, initializing.\n") );
// Set the topic to be observed
mObserverTopic.AssignWithConversion( NS_PRESSHELL_REFLOW_TOPIC );
// Get the Observer service
mObserverService = do_GetService( NS_OBSERVERSERVICE_CONTRACTID,
&rv );
if (NS_SUCCEEDED( rv )) {
// Register to observe Reflows
rv = mObserverService->AddObserver( this,
mObserverTopic.GetUnicode( ) );
if (NS_FAILED( rv )) {
#ifdef DEBUG_P3P
printf( "P3P: Unable to register with Observer Service for Layout notification topic: %X\n", rv );
#endif
PR_LOG( gP3PLogModule,
PR_LOG_ERROR,
("P3PObserverLayout: Init, mObserverService->AddObserver failed - %X.\n", rv) );
}
}
else {
#ifdef DEBUG_P3P
printf( "P3P: Unable to obtain Observer Service: %X\n", rv );
#endif
PR_LOG( gP3PLogModule,
PR_LOG_ERROR,
("P3PObserverLayout: Init, do_GetService for Observer service failed - %X.\n", rv) );
}
if (NS_SUCCEEDED( rv )) {
mURILoader = do_GetService( NS_URI_LOADER_CONTRACTID,
&rv );
if (NS_FAILED( rv )) {
PR_LOG( gP3PLogModule,
PR_LOG_ERROR,
("P3PObserverLayout: Init, do_GetService for URI Loader service failed - %X.\n", rv) );
}
}
return rv;
}
// ****************************************************************************
// nsIObserver routines
// ****************************************************************************
// P3P Observer Layout: Observe
//
// Function: Allows for processing before the specified type of layout processing begins.
//
// Parms: 1. In The DocShell object associated with the layout
// 2. In The observer topic
// 3. In The type of layout being done
//
NS_IMETHODIMP
nsP3PObserverLayout::Observe( nsISupports *aSubject,
const PRUnichar *aTopic,
const PRUnichar *aSomeData ) {
nsresult rv = NS_OK;
nsCOMPtr<nsIDocShell> pDocShell;
nsCOMPtr<nsIDocShellTreeItem> pDocShellTreeItem;
nsCOMPtr<nsIWebNavigation> pWebNavigation;
nsCOMPtr<nsIURI> pURI;
nsAutoString sRequestMethod;
// Get the P3P service and check if it is enabled
rv = GetP3PService( );
if (NS_SUCCEEDED( rv ) && mP3PIsEnabled) {
#ifdef DEBUG_P3P
{ nsCString csTopic, csData;
csTopic.AssignWithConversion( aTopic ),
csData.AssignWithConversion( aSomeData );
printf( "P3P: Observer invoked: Topic is %s, Data is %s\n", (const char *)csTopic, (const char *)csData );
}
#endif
if (nsCRT::strcmp( aSomeData, NS_PRESSHELL_INITIAL_REFLOW ) == 0) {
// Initial reflow - start of layout for a page
PR_LOG( gP3PLogModule,
PR_LOG_NOTICE,
("P3PObserverLayout: Observe, notified of initial reflow.\n") );
// Get the DocShell
pDocShell = do_QueryInterface( aSubject,
&rv );
if (NS_SUCCEEDED( rv )) {
// Get the DocShellTreeItem
pDocShellTreeItem = do_QueryInterface( pDocShell,
&rv );
if (NS_SUCCEEDED( rv )) {
pWebNavigation = do_QueryInterface( pDocShell,
&rv );
if (NS_SUCCEEDED( rv )) {
// Get the URI
rv = pWebNavigation->GetCurrentURI( getter_AddRefs( pURI ) );
if (NS_SUCCEEDED( rv )) {
// Get the request method used
rv = GetRequestMethod( pDocShell,
pURI,
sRequestMethod );
if (NS_SUCCEEDED( rv )) {
// Check the privacy
mP3PService->CheckPrivacy( sRequestMethod,
pURI,
pDocShellTreeItem,
nsnull );
}
}
else {
PR_LOG( gP3PLogModule,
PR_LOG_ERROR,
("P3PObserverLayout: Observe, pDocShell->GetCurrentURI failed - %X.\n", rv) );
}
}
else {
PR_LOG( gP3PLogModule,
PR_LOG_ERROR,
("P3PObserverLayout: Observe, do_QueryInterface for WebNavigation failed - %X.\n", rv) );
}
}
else {
PR_LOG( gP3PLogModule,
PR_LOG_ERROR,
("P3PObserverLayout: Observe, do_QueryInterface for DocShellTreeItem failed - %X.\n", rv) );
}
}
else {
PR_LOG( gP3PLogModule,
PR_LOG_ERROR,
("P3PObserverLayout: Observe, do_QueryInterface for DocShell failed - %X.\n", rv) );
}
}
}
return rv;
}
// ****************************************************************************
// nsP3PObserverLayout routines
// ****************************************************************************
// P3P Observer Layout: GetRequestMethod
//
// Function: Determines the request <METHOD> associated with the DocShell object.
//
// Parms: 1. In The DocShell object
// 2. In The URI object
// 3. Out The request <METHOD>
//
NS_METHOD
nsP3PObserverLayout::GetRequestMethod( nsIDocShell *aDocShell,
nsIURI *aURI,
nsString& aRequestMethod ) {
nsresult rv;
nsCOMPtr<nsILoadGroup> pLoadGroup;
nsCOMPtr<nsISimpleEnumerator> pEnumerator;
PRBool bMoreRequests,
bURIMatch;
nsCOMPtr<nsIRequest> pRequest;
nsCOMPtr<nsIHTTPChannel> pHTTPChannel;
nsCOMPtr<nsIURI> pURI;
nsCOMPtr<nsIAtom> pRequestMethod;
// Get the load group associated with this DocShell
rv = mURILoader->GetLoadGroupForContext( aDocShell,
getter_AddRefs( pLoadGroup ) );
if (NS_SUCCEEDED( rv ) && pLoadGroup) {
// Get the channels in the load group
rv = pLoadGroup->GetRequests( getter_AddRefs( pEnumerator ) );
if (NS_SUCCEEDED( rv )) {
// Loop through the channels looking for the channel that matches this DocShell
bURIMatch = PR_FALSE;
rv = pEnumerator->HasMoreElements(&bMoreRequests );
while (NS_SUCCEEDED( rv ) && !bURIMatch && bMoreRequests) {
rv = pEnumerator->GetNext( getter_AddRefs( pRequest ) );
if (NS_SUCCEEDED( rv )) {
pHTTPChannel = do_QueryInterface( pRequest );
if (pHTTPChannel) {
rv = pHTTPChannel->GetURI( getter_AddRefs( pURI ) );
if (NS_SUCCEEDED( rv )) {
// Compare the URIs
rv = pURI->Equals( aURI,
&bURIMatch );
if (bURIMatch) {
// They match, so get the request method
rv = pHTTPChannel->GetRequestMethod( getter_AddRefs( pRequestMethod ) );
if (NS_SUCCEEDED( rv )) {
rv = pRequestMethod->ToString( aRequestMethod );
if (NS_FAILED( rv )) {
PR_LOG( gP3PLogModule,
PR_LOG_ERROR,
("P3PObserverLayout: GetRequestMethod, pRequestMethod->ToString failed - %X.\n", rv) );
}
}
else {
PR_LOG( gP3PLogModule,
PR_LOG_ERROR,
("P3PObserverLayout: GetRequestMethod, pHTTPChannel->GetRequestMethod failed - %X.\n", rv) );
}
}
}
else {
PR_LOG( gP3PLogModule,
PR_LOG_ERROR,
("P3PObserverLayout: GetRequestMethod, pHTTPChannel->GetURI failed - %X.\n", rv) );
}
}
}
if (NS_SUCCEEDED( rv )) {
rv = pEnumerator->HasMoreElements(&bMoreRequests );
}
}
}
else {
PR_LOG( gP3PLogModule,
PR_LOG_ERROR,
("P3PObserverLayout: GetRequestMethod, pLoadGroup->GetRequests failed - %X.\n", rv) );
}
}
else {
PR_LOG( gP3PLogModule,
PR_LOG_ERROR,
("P3PObserverLayout: GetRequestMethod, mURILoader->GetLoadGroupForContext failed - %X.\n", rv) );
}
return rv;
}
// P3P Observer Layout: GetP3PService
//
// Function: Obtain the P3P service and determine if it is enabled.
//
// Parms: None
//
NS_METHOD
nsP3PObserverLayout::GetP3PService( ) {
nsresult rv = NS_OK;
if (!mP3PService) {
mP3PService = do_GetService( NS_P3PSERVICE_CONTRACTID,
&rv );
if (NS_FAILED( rv )) {
PR_LOG( gP3PLogModule,
PR_LOG_ERROR,
("P3PObserverLayout: GetP3PService, do_GetService for P3P service failed - %X.\n", rv) );
}
}
if (mP3PService) {
rv = mP3PService->P3PIsEnabled(&mP3PIsEnabled );
if (NS_SUCCEEDED( rv ) && !mP3PIsEnabled) {
PR_LOG( gP3PLogModule,
PR_LOG_NOTICE,
("P3PObserverLayout: GetP3PService, P3P Service is not enabled.\n") );
}
else if (NS_FAILED( rv )) {
PR_LOG( gP3PLogModule,
PR_LOG_ERROR,
("P3PObserverLayout: GetP3PService, mP3PService->P3PIsEnabled failed - %X.\n", rv) );
}
}
return rv;
}

View File

@@ -0,0 +1,77 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Mozilla 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/MPL/
*
* 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 imitations under the License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is International
* Business Machines Corporation. Portions created by IBM
* Corporation are Copyright (C) 2000 International Business
* Machines Corporation. All Rights Reserved.
*
* Contributor(s): IBM Corporation.
*
*/
#ifndef nsP3PObserverLayout_h__
#define nsP3PObserverLayout_h__
#include "nsIP3PCService.h"
#include <nsCOMPtr.h>
#include <nsISupports.h>
#include <nsIObserver.h>
#include <nsWeakReference.h>
#include <nsIObserverService.h>
#include <nsIDocShell.h>
#include <nsIURI.h>
class nsP3PObserverLayout : public nsIObserver,
public nsSupportsWeakReference {
public:
// nsISupports
NS_DECL_ISUPPORTS
// nsIObserver
NS_DECL_NSIOBSERVER
// nsP3PObserverLayout methods
nsP3PObserverLayout( );
virtual ~nsP3PObserverLayout( );
NS_METHOD Init( );
protected:
NS_METHOD GetRequestMethod( nsIDocShell *aDocShell,
nsIURI *aURI,
nsString& aRequestMethod );
NS_METHOD GetP3PService( );
nsCOMPtr<nsIP3PCService> mP3PService; // The P3P Service
PRBool mP3PIsEnabled; // An indicator as to whether the P3P Service is enabled
nsString mObserverTopic; // The topic to be observed
nsCOMPtr<nsIObserverService> mObserverService; // The Observer Service
nsCOMPtr<nsIURILoader> mURILoader; // The URI Loader service
};
extern
NS_EXPORT NS_METHOD NS_NewP3PObserverLayout( nsIObserver **aObserverLayout );
#endif /* nsP3PObserverLayout_h__ */

View File

@@ -0,0 +1,187 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Mozilla 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/MPL/
*
* 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 imitations under the License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is International
* Business Machines Corporation. Portions created by IBM
* Corporation are Copyright (C) 2000 International Business
* Machines Corporation. All Rights Reserved.
*
* Contributor(s): IBM Corporation.
*
*/
#include "nsP3PDefines.h"
#include "nsP3PObserverUtils.h"
#include "nsP3PLogging.h"
#include <nsString.h>
#include <nsXPIDLString.h>
// P3P Observer Utils: ExamineLINKTag
//
// Function: Examines the content of an HTML <LINK> tag.
//
// Parms: 1. In The URI object associated with the HTML <LINK> tag
// 2. In The number of attributes associated with the <LINK> tag
// 3. In The attribute names
// 4. In The attribute values
// 5. In The P3P Service
//
NS_METHOD
nsP3PObserverUtils::ExamineLINKTag( nsIURI *aReferencingURI,
PRUint32 aNumOfAttributes,
const PRUnichar *aNameArray[],
const PRUnichar *aValueArray[],
nsIDocShellTreeItem *aDocShellTreeItem,
nsIP3PCService *aP3PService ) {
nsAutoString sPolicyRefFileURISpec;
#ifdef DEBUG_P3P
{ nsXPIDLCString xcsURISpec;
aReferencingURI->GetSpec( getter_Copies( xcsURISpec ) );
printf( " Referencing URI: %s\n", (const char *)xcsURISpec );
}
#endif
for (PRUint32 i = 0;
i < aNumOfAttributes;
i++) {
if (nsCRT::strcasecmp( aNameArray[i], P3P_LINK_REL ) == 0) {
if (nsCRT::strcmp( aValueArray[i], P3P_LINK_P3P_VALUE ) == 0) {
for (PRUint32 j = 0;
j < aNumOfAttributes;
j++) {
if (nsCRT::strcasecmp( aNameArray[j], P3P_LINK_HREF ) == 0) {
sPolicyRefFileURISpec = aValueArray[j];
sPolicyRefFileURISpec.Trim( "\"" );
#ifdef DEBUG_P3P
{ nsCString csRel,
csHref;
csRel.AssignWithConversion( aValueArray[i] );
csHref.AssignWithConversion( aValueArray[j] );
printf( " P3P LINK tag found: %s %s\n", (const char *)csRel,
(const char *)csHref );
}
#endif
}
}
}
if (sPolicyRefFileURISpec.Length( ) > 0) {
aP3PService->SetPolicyRefFileURISpec( aDocShellTreeItem,
aReferencingURI,
P3P_REFERENCE_LINK_TAG,
sPolicyRefFileURISpec );
}
}
}
return NS_OK;
}
// P3P Observer Utils: ExamineLINKTag
//
// Function: Examines the content of an HTML <LINK> tag.
//
// Parms: 1. In The URI object associated with the HTML <LINK> tag
// 2. In The attribute names
// 3. In The attribute values
// 4. In The P3P Service
//
NS_METHOD
nsP3PObserverUtils::ExamineLINKTag( nsIURI *aReferencingURI,
const nsStringArray *aNames,
const nsStringArray *aValues,
nsIDocShellTreeItem *aDocShellTreeItem,
nsIP3PCService *aP3PService ) {
nsAutoString sName,
sRelValue,
sHrefValue,
sPolicyRefFileURISpec;
nsCAutoString csHref;
#ifdef DEBUG_P3P
{ nsXPIDLCString xcsURISpec;
aReferencingURI->GetSpec( getter_Copies( xcsURISpec ) );
printf( " Referencing URI: %s\n", (const char *)xcsURISpec );
}
#endif
// Loop through the attribute names looking for the "rel" attribute with the P3P release value
for (PRInt32 i = 0;
i < aNames->Count( );
i++) {
aNames->StringAt( i, sName );
if (sName.EqualsIgnoreCase( P3P_LINK_REL )) {
// "rel" attribute found
aValues->StringAt( i, sRelValue );
if (sRelValue.EqualsWithConversion( P3P_LINK_P3P_VALUE )) {
// P3P release value found
PR_LOG( gP3PLogModule,
PR_LOG_NOTICE,
("P3PObserverUtils: ExamineLinkTag, P3P rel attribute found - %s.\n", P3P_LINK_P3P_VALUE) );
// Loop through the attributes names looking for the "href" attribute with the PolicyRefFile value
for (PRInt32 j = 0;
j < aNames->Count( );
j++) {
aNames->StringAt( j, sName );
if (sName.EqualsIgnoreCase( P3P_LINK_HREF )) {
// "href" attribute found, set PolicyRefFile URI spec
aValues->StringAt( j, sHrefValue );
csHref.AssignWithConversion( sHrefValue );
sPolicyRefFileURISpec = sHrefValue;
sPolicyRefFileURISpec.Trim( "\"" );
#ifdef DEBUG_P3P
{ nsCString csRel;
csRel.AssignWithConversion( sRelValue );
printf( " P3P LINK tag found: %s %s\n", (const char *)csRel, (const char *)csHref );
}
#endif
PR_LOG( gP3PLogModule,
PR_LOG_NOTICE,
("P3PObserverUtils: ExamineLinkTag, P3P href attribute found - %s.\n", (const char *)csHref) );
}
}
}
if (sPolicyRefFileURISpec.Length( ) > 0) {
aP3PService->SetPolicyRefFileURISpec( aDocShellTreeItem,
aReferencingURI,
P3P_REFERENCE_LINK_TAG,
sPolicyRefFileURISpec );
}
}
}
return NS_OK;
}

View File

@@ -0,0 +1,56 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Mozilla 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/MPL/
*
* 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 imitations under the License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is International
* Business Machines Corporation. Portions created by IBM
* Corporation are Copyright (C) 2000 International Business
* Machines Corporation. All Rights Reserved.
*
* Contributor(s): IBM Corporation.
*
*/
#ifndef nsP3PObserverUtils_h__
#define nsP3PObserverUtils_h__
#include "nsIP3PCService.h"
#include <nsCom.h>
#include <nsIURI.h>
#include <nsIDocShellTreeItem.h>
#include <nsVoidArray.h>
class nsP3PObserverUtils {
public:
static
NS_METHOD ExamineLINKTag( nsIURI *aReferencingURI,
PRUint32 aNumOfAttributes,
const PRUnichar *aNameArray[],
const PRUnichar *aValueArray[],
nsIDocShellTreeItem *aDocShellTreeItem,
nsIP3PCService *aP3PService );
static
NS_METHOD ExamineLINKTag( nsIURI *aReferencingURI,
const nsStringArray *aNames,
const nsStringArray *aValues,
nsIDocShellTreeItem *aDocShellTreeItem,
nsIP3PCService *aP3PService );
};
#endif /* nsP3PObserverUtils_h__ */

View File

@@ -0,0 +1,480 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Mozilla 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/MPL/
*
* 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 imitations under the License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is International
* Business Machines Corporation. Portions created by IBM
* Corporation are Copyright (C) 2000 International Business
* Machines Corporation. All Rights Reserved.
*
* Contributor(s): IBM Corporation.
*
*/
#include "nsP3PDefines.h"
#include "nsP3PObserverXML.h"
#include "nsP3PObserverUtils.h"
#include "nsP3PLogging.h"
#include <nsIServiceManager.h>
#include <nsIParser.h>
#include <nsIDocShell.h>
#include <nsIDocShellTreeItem.h>
#include <nsIWebNavigation.h>
#include <nsIDocument.h>
#include <nsString.h>
#include <nsXPIDLString.h>
// ****************************************************************************
// nsP3PObserverXML Implementation routines
// ****************************************************************************
static NS_DEFINE_CID( kP3PServiceCID, NS_P3PSERVICE_CID );
// P3P Observer XML nsISupports
NS_IMPL_ISUPPORTS3( nsP3PObserverXML, nsIObserver,
nsIElementObserver,
nsISupportsWeakReference );
// P3P Observer XML creation routine
NS_METHOD
NS_NewP3PObserverXML( nsIObserver **aObserverXML ) {
nsresult rv;
nsP3PObserverXML *pNewObserverXML = nsnull;
#ifdef DEBUG_P3P
printf("P3P: ObserverXML initializing.\n");
#endif
NS_ENSURE_ARG_POINTER( aObserverXML );
*aObserverXML = nsnull;
pNewObserverXML = new nsP3PObserverXML( );
if (pNewObserverXML) {
NS_ADDREF( pNewObserverXML );
rv = pNewObserverXML->Init( );
if (NS_SUCCEEDED( rv )) {
rv = pNewObserverXML->QueryInterface( NS_GET_IID( nsIObserver ),
(void **)aObserverXML );
}
NS_RELEASE( pNewObserverXML );
}
else {
NS_ASSERTION( 0, "P3P: ObserverXML unable to be created.\n" );
rv = NS_ERROR_OUT_OF_MEMORY;
}
return rv;
}
// P3P Observer XML: Constructor
nsP3PObserverXML::nsP3PObserverXML( )
: mP3PIsEnabled( PR_FALSE ) {
NS_INIT_ISUPPORTS( );
}
// P3P Observer XML: Destructor
nsP3PObserverXML::~nsP3PObserverXML( ) {
if (mObserverService) {
mObserverService->RemoveObserver( this,
mObserverTopic.GetUnicode( ) );
}
}
// P3P Observer XML: Init
//
// Function: Initialization routine for the XML Tag observer.
//
// Parms: None
//
NS_METHOD
nsP3PObserverXML::Init( ) {
nsresult rv;
PR_LOG( gP3PLogModule,
PR_LOG_NOTICE,
("P3PObserverXML: Init, initializing.\n") );
// Set the topic to be observed
mObserverTopic.AssignWithConversion( kXMLTextContentType );
// Get the observer service
mObserverService = do_GetService( NS_OBSERVERSERVICE_CONTRACTID,
&rv );
if (NS_SUCCEEDED( rv )) {
// Register to observer XML tags
rv = mObserverService->AddObserver( this,
mObserverTopic.GetUnicode( ) );
if (NS_FAILED( rv )) {
#ifdef DEBUG_P3P
printf( "P3P: Unable to register with Observer Service for XML tag notification topic: %X\n", rv );
#endif
PR_LOG( gP3PLogModule,
PR_LOG_ERROR,
("P3PObserverXML: Init, mObserverService->AddObserver failed - %X.\n", rv) );
}
}
else {
#ifdef DEBUG_P3P
printf( "P3P: Unable to obtain Observer Service: %X\n", rv );
#endif
PR_LOG( gP3PLogModule,
PR_LOG_ERROR,
("P3PObserverXML: Init, do_GetService for Observer service failed - %X.\n", rv) );
}
return rv;
}
// ****************************************************************************
// nsIObserver routines
// ****************************************************************************
// P3P Observer XML: Observe
//
// Function: Not used, only here to satisfy the interface.
//
NS_IMETHODIMP
nsP3PObserverXML::Observe( nsISupports *aSubject,
const PRUnichar *aTopic,
const PRUnichar *aSomeData ) {
return NS_OK;
}
// ****************************************************************************
// nsIElementObserver routines
// ****************************************************************************
// P3P Observer XML: GetTagNameAt
//
// Function: Returns the XML tags that this observer wants to be notified about.
//
// Parms: 1. In The index or count of this call
//
NS_IMETHODIMP_(const char *)
nsP3PObserverXML::GetTagNameAt( PRUint32 aTagIndex ) {
// Return the tag(s) to be observed
return gObserveElements[aTagIndex];
}
// P3P Observer XML: Notify
//
// Function: Allows for processing based upon the presence of an XML tag.
//
// Parms: 1. In The Document object
// 2. In The XML tag found
// 3. In The number of attributes associated with the XML tag
// 4. In The attribute names
// 5. In The attribute values
//
NS_IMETHODIMP
nsP3PObserverXML::Notify( PRUint32 aDocumentID,
eHTMLTags aTag,
PRUint32 aNumOfAttributes,
const PRUnichar *aNameArray[],
const PRUnichar *aValueArray[] ) {
nsresult rv = NS_OK;
nsCOMPtr<nsIDocument> pDocument;
nsCOMPtr<nsIDocShellTreeItem> pDocShellTreeItem;
nsIURI *pURI = nsnull;
rv = GetP3PService( );
if (NS_SUCCEEDED( rv ) && mP3PIsEnabled) {
#ifdef DEBUG_P3P
{ if (aTag == eHTMLTag_link)
printf( "P3P: ObserverXML #1 has been notified of LINK tag.\n" );
else
printf( "P3P: ObserverXML #1 has been notified of UNKNOWN tag.\n" );
}
#endif
if (aTag == eHTMLTag_link) {
pDocument = do_QueryInterface((nsISupports *)aDocumentID,
&rv );
if (NS_SUCCEEDED( rv )) {
pDocShellTreeItem = do_QueryInterface( pDocument,
&rv );
if (NS_SUCCEEDED( rv )) {
pURI = pDocument->GetDocumentURL( );
if (pURI) {
rv = nsP3PObserverUtils::ExamineLINKTag( pURI,
aNumOfAttributes,
aNameArray,
aValueArray,
pDocShellTreeItem,
mP3PService );
NS_RELEASE( pURI );
}
}
}
}
}
return rv;
}
// P3P Observer XML: Notify
//
// Function: Allows for processing based upon the presence of an XML tag.
//
// Parms: 1. In The Document object
// 2. In The XML tag found
// 3. In The number of attributes associated with the XML tag
// 4. In The attribute names
// 5. In The attribute values
//
NS_IMETHODIMP
nsP3PObserverXML::Notify( PRUint32 aDocumentID,
const PRUnichar *aTag,
PRUint32 aNumOfAttributes,
const PRUnichar *aNameArray[],
const PRUnichar *aValueArray[] ) {
nsresult rv = NS_OK;
nsCOMPtr<nsIDocument> pDocument;
nsCOMPtr<nsIDocShellTreeItem> pDocShellTreeItem;
nsIURI *pURI = nsnull;
rv = GetP3PService( );
if (NS_SUCCEEDED( rv ) && mP3PIsEnabled) {
#ifdef DEBUG_P3P
{ nsCAutoString csTag;
csTag.AssignWithConversion( aTag );
printf( "P3P: ObserverXML #2 has been notified of %s tag.\n", (const char *)csTag );
}
#endif
if (nsCRT::strcasecmp(aTag, "LINK") == 0) {
pDocument = do_QueryInterface((nsISupports *)aDocumentID,
&rv );
if (NS_SUCCEEDED( rv )) {
pDocShellTreeItem = do_QueryInterface( pDocument,
&rv );
if (NS_SUCCEEDED( rv )) {
pURI = pDocument->GetDocumentURL( );
if (pURI) {
rv = nsP3PObserverUtils::ExamineLINKTag( pURI,
aNumOfAttributes,
aNameArray,
aValueArray,
pDocShellTreeItem,
mP3PService );
NS_RELEASE( pURI );
}
}
}
}
}
return rv;
}
// P3P Observer XML: Notify
//
// Function: Allows for processing based upon the presence of an XML tag.
//
// Parms: 1. In The ParserBundle object
// 2. In The XML tag found
// 3. In The attribute names
// 4. In The attribute values
//
NS_IMETHODIMP
nsP3PObserverXML::Notify( nsISupports *aDocumentID,
const PRUnichar *aTag,
const nsStringArray *aKeys,
const nsStringArray *aValues ) {
nsresult rv = NS_OK;
nsCOMPtr<nsISupportsParserBundle> pParserBundle;
nsAutoString sDocumentKey;
nsCOMPtr<nsIDocShell> pDocShell;
nsCOMPtr<nsIDocShellTreeItem> pDocShellTreeItem;
nsCOMPtr<nsIWebNavigation> pWebNavigation;
nsCOMPtr<nsIURI> pURI;
// Get the P3P service and check if it is enabled
rv = GetP3PService( );
if (NS_SUCCEEDED( rv ) && mP3PIsEnabled) {
#ifdef DEBUG_P3P
{ nsCAutoString csTag;
csTag.AssignWithConversion( aTag );
printf( "P3P: ObserverXML #3 has been notified of %s tag.\n", (const char *)csTag );
}
#endif
if (nsCRT::strcasecmp( aTag, "LINK" ) == 0) {
// Notified of a "LINK" tag
PR_LOG( gP3PLogModule,
PR_LOG_NOTICE,
("P3PObserverXML: Notify, notified of \"LINK\" tag.\n") );
// Get the ParserBundle
pParserBundle = do_QueryInterface( aDocumentID,
&rv );
if (NS_SUCCEEDED( rv )) {
// Extract the DocShell from the ParserBundle
sDocumentKey.AssignWithConversion( "docshell" );
rv = pParserBundle->GetDataFromBundle( sDocumentKey,
getter_AddRefs( pDocShell ) );
if (NS_SUCCEEDED( rv ) && pDocShell) {
pDocShellTreeItem = do_QueryInterface( pDocShell,
&rv );
if (NS_SUCCEEDED( rv )) {
pWebNavigation = do_QueryInterface( pDocShell,
&rv );
if (NS_SUCCEEDED( rv )) {
rv = pWebNavigation->GetCurrentURI( getter_AddRefs( pURI ) );
if (NS_SUCCEEDED( rv ) && pURI) {
// Process the LINK tag
rv = nsP3PObserverUtils::ExamineLINKTag( pURI,
aKeys,
aValues,
pDocShellTreeItem,
mP3PService );
}
else if (NS_FAILED( rv )) {
PR_LOG( gP3PLogModule,
PR_LOG_ERROR,
("P3PObserverXML: Notify, pWebNavigation->GetCurrentURI failed - %X.\n", rv) );
}
}
else {
PR_LOG( gP3PLogModule,
PR_LOG_ERROR,
("P3PObserverXML: Notify, do_QueryInterface for WebNavigation failed - %X.\n", rv) );
}
}
else {
PR_LOG( gP3PLogModule,
PR_LOG_ERROR,
("P3PObserverXML: Notify, do_QueryInterface for DocShellTreeItem failed - %X.\n", rv) );
}
}
else if (NS_FAILED( rv )) {
PR_LOG( gP3PLogModule,
PR_LOG_ERROR,
("P3PObserverXML: Notify, pParserBundle->GetDataFromBundle failed - %X.\n", rv) );
}
}
else {
PR_LOG( gP3PLogModule,
PR_LOG_ERROR,
("P3PObserverXML: Notify, do_QueryInterface for ParserBundle failed - %X.\n", rv) );
}
}
}
return rv;
}
// ****************************************************************************
// nsP3PObserverXML routines
// ****************************************************************************
// P3P Observer XML: GetP3PService
//
// Function: Obtain the P3P service and determine if it is enabled.
//
// Parms: None
//
NS_METHOD
nsP3PObserverXML::GetP3PService( ) {
nsresult rv = NS_OK;
if (!mP3PService) {
mP3PService = do_GetService( NS_P3PSERVICE_CONTRACTID,
&rv );
if (NS_FAILED( rv )) {
PR_LOG( gP3PLogModule,
PR_LOG_ERROR,
("P3PObserverXML: GetP3PService, do_GetService for P3P service failed - %X.\n", rv) );
}
}
if (mP3PService) {
rv = mP3PService->P3PIsEnabled(&mP3PIsEnabled );
if (NS_SUCCEEDED( rv ) && !mP3PIsEnabled) {
PR_LOG( gP3PLogModule,
PR_LOG_NOTICE,
("P3PObserverXML: GetP3PService, P3P Service is not enabled.\n") );
}
else if (NS_FAILED( rv )) {
PR_LOG( gP3PLogModule,
PR_LOG_ERROR,
("P3PObserverXML: GetP3PService, mP3PService->P3PIsEnabled failed - %X.\n", rv) );
}
}
return rv;
}

Some files were not shown because too many files have changed in this diff Show More