зеркало из https://github.com/mozilla/gecko-dev.git
Bug 451909 - kill MOZ_XUL_APP now that all apps set it; files removal; r=ted.mielczarek
This commit is contained in:
Родитель
18b833c041
Коммит
7c8fe9b1d4
|
@ -1,28 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
<RDF:RDF xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:chrome="http://www.mozilla.org/rdf/chrome#">
|
||||
|
||||
<!-- list all the packages being supplied by this jar -->
|
||||
<RDF:Seq about="urn:mozilla:package:root">
|
||||
<RDF:li resource="urn:mozilla:package:xslt-qa"/>
|
||||
</RDF:Seq>
|
||||
|
||||
<!-- package information -->
|
||||
<RDF:Description about="urn:mozilla:package:xslt-qa"
|
||||
chrome:displayName="XSLT QA Tools"
|
||||
chrome:author="mozilla.org"
|
||||
chrome:name="xslt-qa"
|
||||
#expand chrome:localeVersion="__MOZILLA_LOCALE_VERSION__"
|
||||
#expand chrome:skinVersion="__MOZILLA_SKIN_VERSION__">
|
||||
</RDF:Description>
|
||||
|
||||
<!-- overlay information -->
|
||||
<RDF:Seq about="urn:mozilla:overlays">
|
||||
<RDF:li resource="chrome://communicator/content/tasksOverlay.xul"/>
|
||||
</RDF:Seq>
|
||||
|
||||
<RDF:Seq about="chrome://communicator/content/tasksOverlay.xul">
|
||||
<RDF:li>chrome://xslt-qa/content/xslt-qa-overlay.xul</RDF:li>
|
||||
</RDF:Seq>
|
||||
|
||||
</RDF:RDF>
|
|
@ -1,47 +0,0 @@
|
|||
#
|
||||
# ***** BEGIN LICENSE BLOCK *****
|
||||
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
#
|
||||
# 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 limitations under the
|
||||
# License.
|
||||
#
|
||||
# The Original Code is the Mozilla browser.
|
||||
#
|
||||
# The Initial Developer of the Original Code is
|
||||
# Christopher Blizzard.
|
||||
# Portions created by the Initial Developer are Copyright (C) 1999
|
||||
# the Initial Developer. All Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
# Christopher Blizzard <blizzard@mozilla.org>
|
||||
#
|
||||
# Alternatively, the contents of this file may be used under the terms of
|
||||
# either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
# in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
# of those above. If you wish to allow use of your version of this file only
|
||||
# under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
# use your version of this file under the terms of the MPL, indicate your
|
||||
# decision by deleting the provisions above and replace them with the notice
|
||||
# and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
# the provisions above, a recipient may use your version of this file under
|
||||
# the terms of any one of the MPL, the GPL or the LGPL.
|
||||
#
|
||||
# ***** END LICENSE BLOCK *****
|
||||
|
||||
DEPTH = ../../..
|
||||
topsrcdir = @top_srcdir@
|
||||
srcdir = @srcdir@
|
||||
VPATH = @srcdir@
|
||||
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
|
@ -1,17 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
<RDF:RDF xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:chrome="http://www.mozilla.org/rdf/chrome#">
|
||||
|
||||
<!-- list all the packages being supplied by this jar -->
|
||||
<RDF:Seq about="urn:mozilla:package:root">
|
||||
<RDF:li resource="urn:mozilla:package:embed"/>
|
||||
</RDF:Seq>
|
||||
|
||||
<!-- xmlterm package information -->
|
||||
<RDF:Description about="urn:mozilla:package:embed"
|
||||
chrome:displayName="Embed"
|
||||
chrome:author="mozilla.org"
|
||||
chrome:name="embed">
|
||||
</RDF:Description>
|
||||
|
||||
</RDF:RDF>
|
|
@ -1,259 +0,0 @@
|
|||
/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* 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 limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is mozilla.org code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corporation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 1998
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
const nsIWebNavigation = Components.interfaces.nsIWebNavigation;
|
||||
|
||||
var commandHandler = null;
|
||||
var gURLBar = null;
|
||||
|
||||
function nsCommandHandler()
|
||||
{
|
||||
}
|
||||
|
||||
nsCommandHandler.prototype =
|
||||
{
|
||||
QueryInterface : function(iid)
|
||||
{
|
||||
if (iid.equals(Components.interfaces.nsICommandHandler) ||
|
||||
iid.equals(Components.interfaces.nsISupports))
|
||||
{
|
||||
return this;
|
||||
}
|
||||
throw Components.results.NS_NOINTERFACE;
|
||||
},
|
||||
|
||||
exec : function(command, params)
|
||||
{
|
||||
},
|
||||
query : function(command, params, result)
|
||||
{
|
||||
result = "";
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
|
||||
function nsBrowserStatusHandler()
|
||||
{
|
||||
this.init();
|
||||
}
|
||||
|
||||
nsBrowserStatusHandler.prototype =
|
||||
{
|
||||
QueryInterface : function(aIID)
|
||||
{
|
||||
if (aIID.equals(Components.interfaces.nsIWebProgressListener) ||
|
||||
aIID.equals(Components.interfaces.nsISupportsWeakReference) ||
|
||||
aIID.equals(Components.interfaces.nsISupports))
|
||||
{
|
||||
return this;
|
||||
}
|
||||
throw Components.results.NS_NOINTERFACE;
|
||||
},
|
||||
|
||||
init : function()
|
||||
{
|
||||
this.urlBar = document.getElementById("urlbar");
|
||||
},
|
||||
|
||||
destroy : function()
|
||||
{
|
||||
this.urlBar = null;
|
||||
},
|
||||
|
||||
onStateChange : function(aWebProgress, aRequest, aStateFlags, aStatus)
|
||||
{
|
||||
},
|
||||
|
||||
onProgressChange : function(aWebProgress, aRequest, aCurSelfProgress, aMaxSelfProgress, aCurTotalProgress, aMaxTotalProgress)
|
||||
{
|
||||
},
|
||||
|
||||
onLocationChange : function(aWebProgress, aRequest, aLocation)
|
||||
{
|
||||
domWindow = aWebProgress.DOMWindow;
|
||||
// Update urlbar only if there was a load on the root docshell
|
||||
if (domWindow == domWindow.top) {
|
||||
this.urlBar.value = location;
|
||||
}
|
||||
},
|
||||
|
||||
onStatusChange : function(aWebProgress, aRequest, aStatus, aMessage)
|
||||
{
|
||||
},
|
||||
|
||||
onSecurityChange : function(aWebProgress, aRequest, aState)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
var gBrowserStatusHandler;
|
||||
function MiniNavStartup()
|
||||
{
|
||||
dump("*** MiniNavStartup\n");
|
||||
|
||||
try {
|
||||
gBrowserStatusHandler = new nsBrowserStatusHandler();
|
||||
var webNavigation = getWebNavigation();
|
||||
webNavigation.sessionHistory = Components.classes["@mozilla.org/browser/shistory;1"]
|
||||
.createInstance(Components.interfaces.nsISHistory);
|
||||
|
||||
var interfaceRequestor = getBrowser().docShell.QueryInterface(Components.interfaces.nsIInterfaceRequestor);
|
||||
var webProgress = interfaceRequestor.getInterface(Components.interfaces.nsIWebProgress);
|
||||
webProgress.addProgressListener(gBrowserStatusHandler, Components.interfaces.nsIWebProgress.NOTIFY_LOCATION);
|
||||
} catch (e) {
|
||||
alert("Error opening a mini-nav window");
|
||||
dump(e+"\n");
|
||||
window.close();
|
||||
return;
|
||||
}
|
||||
|
||||
// create the embedding command handler
|
||||
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
|
||||
var commandHandlerInit = Components
|
||||
.classes["@mozilla.org/embedding/browser/nsCommandHandler;1"]
|
||||
.createInstance(Components.interfaces.nsICommandHandlerInit);
|
||||
|
||||
// Attach it to the window
|
||||
commandHandlerInit.window = window;
|
||||
commandHandler = commandHandlerInit.QueryInterface(Components.interfaces.nsICommandHandler);
|
||||
|
||||
gURLBar = document.getElementById("urlbar");
|
||||
dump("gURLBar " + gURLBar + "\n");
|
||||
}
|
||||
|
||||
function MiniNavShutdown()
|
||||
{
|
||||
dump("*** MiniNavShutdown\n");
|
||||
if (gBrowserStatusHandler)
|
||||
gBrowserStatusHandler.destroy();
|
||||
}
|
||||
|
||||
function getBrowser()
|
||||
{
|
||||
return document.getElementById("content");
|
||||
}
|
||||
|
||||
function getWebNavigation()
|
||||
{
|
||||
return getBrowser().webNavigation;
|
||||
}
|
||||
|
||||
function CHExecTest()
|
||||
{
|
||||
if (commandHandler != null)
|
||||
{
|
||||
commandHandler.exec("hello", "xxx");
|
||||
}
|
||||
}
|
||||
|
||||
function CHQueryTest()
|
||||
{
|
||||
if (commandHandler != null)
|
||||
{
|
||||
var result = commandHandler.query("hello", "xxx");
|
||||
}
|
||||
}
|
||||
|
||||
function InitContextMenu(xulMenu)
|
||||
{
|
||||
// Back determined by canGoBack broadcaster.
|
||||
InitMenuItemAttrFromNode( "context-back", "disabled", "canGoBack" );
|
||||
|
||||
// Forward determined by canGoForward broadcaster.
|
||||
InitMenuItemAttrFromNode( "context-forward", "disabled", "canGoForward" );
|
||||
}
|
||||
|
||||
function InitMenuItemAttrFromNode( item_id, attr, other_id )
|
||||
{
|
||||
var elem = document.getElementById( other_id );
|
||||
if ( elem && elem.getAttribute( attr ) == "true" ) {
|
||||
SetMenuItemAttr( item_id, attr, "true" );
|
||||
} else {
|
||||
SetMenuItemAttr( item_id, attr, null );
|
||||
}
|
||||
}
|
||||
|
||||
function SetMenuItemAttr( id, attr, val )
|
||||
{
|
||||
var elem = document.getElementById( id );
|
||||
if ( elem ) {
|
||||
if ( val == null ) {
|
||||
// null indicates attr should be removed.
|
||||
elem.removeAttribute( attr );
|
||||
} else {
|
||||
// Set attr=val.
|
||||
elem.setAttribute( attr, val );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function loadURI(uri)
|
||||
{
|
||||
getWebNavigation().loadURI(uri, nsIWebNavigation.LOAD_FLAGS_NONE, null, null, null);
|
||||
}
|
||||
|
||||
function BrowserLoadURL()
|
||||
{
|
||||
dump("browserloadurl: " + gURLBar.value + '\n');
|
||||
try {
|
||||
loadURI(gURLBar.value);
|
||||
}
|
||||
catch(e) {
|
||||
}
|
||||
}
|
||||
|
||||
function BrowserBack()
|
||||
{
|
||||
getWebNavigation().goBack();
|
||||
}
|
||||
|
||||
function BrowserForward()
|
||||
{
|
||||
getWebNavigation().goForward();
|
||||
}
|
||||
|
||||
function BrowserStop()
|
||||
{
|
||||
getWebNavigation().stop(nsIWebNavigation.STOP_ALL);
|
||||
}
|
||||
|
||||
function BrowserReload()
|
||||
{
|
||||
getWebNavigation().reload(nsIWebNavigation.LOAD_FLAGS_NONE);
|
||||
}
|
||||
|
|
@ -1,118 +0,0 @@
|
|||
<?xml version="1.0"?> <!-- -*- Mode: HTML -*- -->
|
||||
|
||||
<!-- ***** BEGIN LICENSE BLOCK *****
|
||||
Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
|
||||
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 limitations under the
|
||||
License.
|
||||
|
||||
The Original Code is Mozilla Communicator client code, released
|
||||
March 31, 1998.
|
||||
|
||||
The Initial Developer of the Original Code is
|
||||
Netscape Communications Corporation.
|
||||
Portions created by the Initial Developer are Copyright (C) 1998-2000
|
||||
the Initial Developer. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
|
||||
Alternatively, the contents of this file may be used under the terms of
|
||||
either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
of those above. If you wish to allow use of your version of this file only
|
||||
under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
use your version of this file under the terms of the MPL, indicate your
|
||||
decision by deleting the provisions above and replace them with the notice
|
||||
and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
the provisions above, a recipient may use your version of this file under
|
||||
the terms of any one of the MPL, the GPL or the LGPL.
|
||||
|
||||
***** END LICENSE BLOCK ***** -->
|
||||
|
||||
<?xml-stylesheet href="chrome://embed/content/embedding.css" type="text/css"?>
|
||||
<?xml-stylesheet href="chrome://navigator/skin/" type="text/css"?>
|
||||
|
||||
|
||||
<!DOCTYPE window [
|
||||
<!ENTITY % brandDTD SYSTEM "chrome://branding/locale/brand.dtd" >
|
||||
%brandDTD;
|
||||
<!ENTITY % embeddingDTD SYSTEM "chrome://embed/locale/embedding.dtd" >
|
||||
%embeddingDTD;
|
||||
]>
|
||||
|
||||
<window id="main-window"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
orient="vertical"
|
||||
title="Embedding"
|
||||
onload="MiniNavStartup()"
|
||||
onunload="MiniNavShutdown()">
|
||||
|
||||
<script type="application/x-javascript" src="chrome://embed/content/mini-nav.js"/>
|
||||
|
||||
<!-- Context menu -->
|
||||
<popupset>
|
||||
<popup id="context" oncreate="InitContextMenu(this)">
|
||||
<menuitem id="context-back" label="&backCmd.label;"
|
||||
accesskey="" oncommand="BrowserBack()"/>
|
||||
<menuitem id="context-forward" label="&forwardCmd.label;"
|
||||
accesskey="" oncommand="BrowserForward()"/>
|
||||
<menuitem id="context-stop" label="&stopCmd.label;"
|
||||
accesskey="" oncommand="BrowserStop()"/>
|
||||
<menuitem id="context-reload" label="&reloadCmd.label;"
|
||||
accesskey="" oncommand="BrowserReload()"/>
|
||||
|
||||
<!-- The following DEBUG MENU ITEMS can be removed -->
|
||||
<menuseparator/>
|
||||
<menu label="Debug">
|
||||
<menupopup>
|
||||
<menuitem id="command-handler" label="CommandHandler::Exec" oncommand="CHExecTest()"/>
|
||||
<menuitem id="command-handler" label="CommandHandler::Query" oncommand="CHQueryTest()"/>
|
||||
</menupopup>
|
||||
</menu>
|
||||
<!-- End DEBUG MENU ITEMS -->
|
||||
|
||||
</popup>
|
||||
</popupset>
|
||||
|
||||
<!-- Embedding apps probably don't need a toolbar, but it's useful
|
||||
for embedding -->
|
||||
<toolbox>
|
||||
<toolbar id="nav-bar">
|
||||
<hbox id="nav-bar-inner" align="center" flex="1" style="min-width: 0px;">
|
||||
<button id="back-button" crop="right" onclick="BrowserBack()" label="&backButton.label;"/>
|
||||
<button id="forward-button" crop="right" onclick="BrowserForward()" label="&forwardButton.label;"/>
|
||||
<button id="reload-button" crop="right" onclick="BrowserReload()" label="&reloadButton.label;"/>
|
||||
<button id="stop-button" crop="right" onclick="BrowserStop()" label="&stopButton.label;"/>
|
||||
<hbox class="box-toolbar-group" flex="1">
|
||||
<hbox align="center" valign="middle" flex="1">
|
||||
<textbox autocomplete="true" timeout="300"
|
||||
searchSessionType="urlbar" id="urlbar"
|
||||
onkeypress="if( event.keyCode == 13 ) { BrowserLoadURL(); }"/>
|
||||
</hbox>
|
||||
</hbox>
|
||||
</hbox>
|
||||
</toolbar>
|
||||
</toolbox>
|
||||
|
||||
<hbox flex="1" >
|
||||
<hbox id="appcontent" flex="100%">
|
||||
<!-- this box is temporary, pending XBLified <browser> -->
|
||||
<hbox id="browser" context="context" flex="1">
|
||||
<!-- type attribute is used by frame construction to locate iframes
|
||||
intended to hold (html) content -->
|
||||
<browser context="context" type="content-primary" id="content"
|
||||
src="about:blank" flex="1"/>
|
||||
</hbox>
|
||||
</hbox>
|
||||
</hbox>
|
||||
|
||||
</window>
|
|
@ -1,63 +0,0 @@
|
|||
<?xml version="1.0"?> <!-- -*- Mode: HTML -*- -->
|
||||
|
||||
<!-- ***** BEGIN LICENSE BLOCK *****
|
||||
Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
|
||||
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 limitations under the
|
||||
License.
|
||||
|
||||
The Original Code is Mozilla Communicator client code, released
|
||||
March 31, 1998.
|
||||
|
||||
The Initial Developer of the Original Code is
|
||||
Netscape Communications Corporation.
|
||||
Portions created by the Initial Developer are Copyright (C) 1998-2000
|
||||
the Initial Developer. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
|
||||
Alternatively, the contents of this file may be used under the terms of
|
||||
either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
of those above. If you wish to allow use of your version of this file only
|
||||
under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
use your version of this file under the terms of the MPL, indicate your
|
||||
decision by deleting the provisions above and replace them with the notice
|
||||
and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
the provisions above, a recipient may use your version of this file under
|
||||
the terms of any one of the MPL, the GPL or the LGPL.
|
||||
|
||||
***** END LICENSE BLOCK ***** -->
|
||||
|
||||
<?xml-stylesheet href="chrome://embed/content/simple-shell.css" type="text/css"?>
|
||||
|
||||
<window id="main-window"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
orient="vertical"
|
||||
title="Embedding">
|
||||
|
||||
<!-- attach the browser key set to the content window -->
|
||||
<keyset/>
|
||||
|
||||
<hbox flex="1" >
|
||||
<hbox id="appcontent" flex="100%">
|
||||
<!-- this box is temporary, pending XBLified <browser> -->
|
||||
<hbox id="browser" context="context" flex="1">
|
||||
<!-- type attribute is used by frame construction to locate iframes
|
||||
intended to hold (html) content -->
|
||||
<browser context="context" type="content-primary" id="content"
|
||||
src="about:blank" flex="1"/>
|
||||
</hbox>
|
||||
</hbox>
|
||||
</hbox>
|
||||
|
||||
</window>
|
|
@ -1,14 +0,0 @@
|
|||
embed-sample.jar:
|
||||
content/embed/contents.rdf (content/contents.rdf)
|
||||
content/embed/mini-nav.js (content/mini-nav.js)
|
||||
content/embed/mini-nav.xul (content/mini-nav.xul)
|
||||
content/embed/simple-shell.xul (content/simple-shell.xul)
|
||||
content/embed/back.gif (skin/back.gif)
|
||||
content/embed/forward.gif (skin/forward.gif)
|
||||
content/embed/reload.gif (skin/reload.gif)
|
||||
content/embed/stop.gif (skin/stop.gif)
|
||||
locale/en-US/embed/embedding.dtd (locale/en-US/embedding.dtd)
|
||||
locale/en-US/embed/contents.rdf (locale/en-US/contents.rdf)
|
||||
content/embed/simple-shell.css (skin/simple-shell.css)
|
||||
content/embed/embedding.css (skin/embedding.css)
|
||||
skin/classic/embed/contents.rdf (skin/contents.rdf)
|
|
@ -1,23 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
<RDF:RDF xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:chrome="http://www.mozilla.org/rdf/chrome#">
|
||||
|
||||
<!-- list all the packages being supplied by this jar -->
|
||||
<RDF:Seq about="urn:mozilla:locale:root">
|
||||
<RDF:li resource="urn:mozilla:locale:en-US"/>
|
||||
</RDF:Seq>
|
||||
|
||||
<!-- locale information -->
|
||||
<RDF:Description about="urn:mozilla:locale:en-US"
|
||||
chrome:displayName="English(US)"
|
||||
chrome:author="mozilla.org"
|
||||
chrome:name="en-US"
|
||||
chrome:previewURL="http://www.mozilla.org/locales/en-US.gif">
|
||||
<chrome:packages>
|
||||
<RDF:Seq about="urn:mozilla:locale:en-US:packages">
|
||||
<RDF:li resource="urn:mozilla:locale:en-US:embed"/>
|
||||
</RDF:Seq>
|
||||
</chrome:packages>
|
||||
</RDF:Description>
|
||||
|
||||
</RDF:RDF>
|
|
@ -1,21 +0,0 @@
|
|||
|
||||
<!-- Toolbar -->
|
||||
|
||||
<!ENTITY backButton.label "Back">
|
||||
<!ENTITY backButton.tooltip "Go back one page">
|
||||
<!ENTITY forwardButton.label "Forward">
|
||||
<!ENTITY forwardButton.tooltip "Go forward one page">
|
||||
<!ENTITY reloadButton.label "Reload">
|
||||
<!ENTITY reloadButton.tooltip "Reload current page">
|
||||
<!ENTITY stopButton.label "Stop">
|
||||
<!ENTITY stopButton.tooltip "Stop loading this page">
|
||||
<!ENTITY searchButton.label "Search">
|
||||
<!ENTITY searchButton.tooltip "Type a word in the field to the left, then click Search">
|
||||
|
||||
|
||||
<!-- Context menu -->
|
||||
|
||||
<!ENTITY backCmd.label "Back">
|
||||
<!ENTITY forwardCmd.label "Forward">
|
||||
<!ENTITY stopCmd.label "Stop">
|
||||
<!ENTITY reloadCmd.label "Reload">
|
|
@ -1,48 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
<RDF:RDF xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:chrome="http://www.mozilla.org/rdf/chrome#">
|
||||
|
||||
<!-- list all the packages being supplied by this jar -->
|
||||
<RDF:Seq about="urn:mozilla:package:root">
|
||||
<RDF:li resource="urn:mozilla:package:embedding"/>
|
||||
</RDF:Seq>
|
||||
<RDF:Seq about="urn:mozilla:locale:root">
|
||||
<RDF:li resource="urn:mozilla:locale:en-US"/>
|
||||
</RDF:Seq>
|
||||
<RDF:Seq about="urn:mozilla:skin:root">
|
||||
<RDF:li resource="urn:mozilla:skin:modern/1.0" />
|
||||
</RDF:Seq>
|
||||
|
||||
<!-- package information -->
|
||||
<RDF:Description about="urn:mozilla:package:embedding"
|
||||
chrome:displayName="Embedding"
|
||||
chrome:author="mozilla.org"
|
||||
chrome:name="embedding">
|
||||
</RDF:Description>
|
||||
|
||||
<!-- locale information -->
|
||||
<RDF:Description about="urn:mozilla:locale:en-US"
|
||||
chrome:displayName="English(US)"
|
||||
chrome:author="mozilla.org"
|
||||
chrome:name="en-US"
|
||||
chrome:previewURL="http://www.mozilla.org/locales/en-US.gif">
|
||||
<chrome:packages>
|
||||
<RDF:Seq about="urn:mozilla:locale:en-US:packages">
|
||||
<RDF:li resource="urn:mozilla:locale:en-US:embedding"/>
|
||||
</RDF:Seq>
|
||||
</chrome:packages>
|
||||
</RDF:Description>
|
||||
|
||||
<!-- skin information -->
|
||||
<RDF:Description about="urn:mozilla:skin:modern/1.0"
|
||||
chrome:displayName="Modern"
|
||||
chrome:author="mozilla.org"
|
||||
chrome:name="modern/1.0">
|
||||
<chrome:packages>
|
||||
<RDF:Seq about="urn:mozilla:skin:modern/1.0:packages">
|
||||
<RDF:li resource="urn:mozilla:skin:modern/1.0:embedding"/>
|
||||
</RDF:Seq>
|
||||
</chrome:packages>
|
||||
</RDF:Description>
|
||||
|
||||
</RDF:RDF>
|
Двоичные данные
embedding/browser/chrome/skin/back.gif
Двоичные данные
embedding/browser/chrome/skin/back.gif
Двоичный файл не отображается.
До Ширина: | Высота: | Размер: 845 B |
|
@ -1,22 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
<RDF:RDF xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:chrome="http://www.mozilla.org/rdf/chrome#">
|
||||
|
||||
<!-- list all the packages being supplied by this jar -->
|
||||
<RDF:Seq about="urn:mozilla:skin:root">
|
||||
<RDF:li resource="urn:mozilla:skin:modern/1.0" />
|
||||
</RDF:Seq>
|
||||
|
||||
<!-- embed skin information: modern/1.0 -->
|
||||
<RDF:Description about="urn:mozilla:skin:modern/1.0"
|
||||
chrome:displayName="Modern"
|
||||
chrome:author="mozilla.org"
|
||||
chrome:name="modern/1.0">
|
||||
<chrome:packages>
|
||||
<RDF:Seq about="urn:mozilla:skin:modern/1.0:packages">
|
||||
<RDF:li resource="urn:mozilla:skin:modern/1.0:embed"/>
|
||||
</RDF:Seq>
|
||||
</chrome:packages>
|
||||
</RDF:Description>
|
||||
|
||||
</RDF:RDF>
|
|
@ -1,67 +0,0 @@
|
|||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* 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 limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is Mozilla JSIRC Library.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* New Dimensions Consulting, Inc.
|
||||
* Portions created by the Initial Developer are Copyright (C) 1999
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Robert Ginda, rginda@ndcico.com, original author
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
/*@import url(chrome://navigator/skin/); */
|
||||
/*@import url(chrome://global/skin/global.css);*/
|
||||
|
||||
window {
|
||||
|
||||
width: 640px;
|
||||
height: 480px;
|
||||
|
||||
}
|
||||
|
||||
#back-button
|
||||
{
|
||||
list-style-image : url("chrome://embed/content/back.gif");
|
||||
}
|
||||
|
||||
#forward-button
|
||||
{
|
||||
list-style-image : url("chrome://embed/content/forward.gif");
|
||||
}
|
||||
|
||||
#stop-button
|
||||
{
|
||||
list-style-image : url("chrome://embed/content/skin/stop.gif");
|
||||
}
|
||||
|
||||
#reload-button
|
||||
{
|
||||
list-style-image : url("chrome://embed/content/skin/reload.gif");
|
||||
}
|
||||
|
Двоичные данные
embedding/browser/chrome/skin/forward.gif
Двоичные данные
embedding/browser/chrome/skin/forward.gif
Двоичный файл не отображается.
До Ширина: | Высота: | Размер: 845 B |
Двоичные данные
embedding/browser/chrome/skin/reload.gif
Двоичные данные
embedding/browser/chrome/skin/reload.gif
Двоичный файл не отображается.
До Ширина: | Высота: | Размер: 844 B |
|
@ -1,46 +0,0 @@
|
|||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* 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 limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is Mozilla JSIRC Library.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* New Dimensions Consulting, Inc.
|
||||
* Portions created by the Initial Developer are Copyright (C) 1999
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Robert Ginda, rginda@ndcico.com, original author
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
@import url(chrome://communicator/skin/);
|
||||
|
||||
window {
|
||||
|
||||
width: 640px;
|
||||
height: 480px;
|
||||
|
||||
}
|
||||
|
Двоичные данные
embedding/browser/chrome/skin/stop.gif
Двоичные данные
embedding/browser/chrome/skin/stop.gif
Двоичный файл не отображается.
До Ширина: | Высота: | Размер: 843 B |
|
@ -1,80 +0,0 @@
|
|||
#
|
||||
# ***** BEGIN LICENSE BLOCK *****
|
||||
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
#
|
||||
# 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 limitations under the
|
||||
# License.
|
||||
#
|
||||
# The Original Code is the Mozilla browser.
|
||||
#
|
||||
# The Initial Developer of the Original Code is
|
||||
# Christopher Blizzard.
|
||||
# Portions created by the Initial Developer are Copyright (C) 2001
|
||||
# the Initial Developer. All Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
#
|
||||
# Alternatively, the contents of this file may be used under the terms of
|
||||
# either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
# in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
# of those above. If you wish to allow use of your version of this file only
|
||||
# under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
# use your version of this file under the terms of the MPL, indicate your
|
||||
# decision by deleting the provisions above and replace them with the notice
|
||||
# and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
# the provisions above, a recipient may use your version of this file under
|
||||
# the terms of any one of the MPL, the GPL or the LGPL.
|
||||
#
|
||||
# ***** END LICENSE BLOCK *****
|
||||
|
||||
DEPTH = ../..
|
||||
topsrcdir = @top_srcdir@
|
||||
srcdir = @srcdir@
|
||||
VPATH = @srcdir@
|
||||
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
|
||||
MODULE = embed_lite
|
||||
LIBRARY_NAME = embed_lite
|
||||
IS_COMPONENT = 1
|
||||
MOZILLA_INTERNAL_API = 1
|
||||
|
||||
PACKAGE_FILE = embedlite.pkg
|
||||
|
||||
REQUIRES = xpcom \
|
||||
string \
|
||||
content \
|
||||
necko \
|
||||
pref \
|
||||
docshell \
|
||||
$(NULL)
|
||||
|
||||
CPPSRCS = \
|
||||
nsEmbedGlobalHistory.cpp \
|
||||
nsEmbedLiteModule.cpp \
|
||||
$(NULL)
|
||||
|
||||
# nsEmbedChromeRegistry.cpp \
|
||||
|
||||
# bring in the chrome protocol handler
|
||||
# LOBJS = $(topsrcdir)/rdf/chrome/src/nsChromeProtocolHandler.$(OBJ_SUFFIX)
|
||||
|
||||
|
||||
LOCAL_INCLUDES = -I$(topsrcdir)/rdf/chrome/src
|
||||
|
||||
EXTRA_DSO_LDOPTS = \
|
||||
$(MOZ_COMPONENT_LIBS) \
|
||||
$(NULL)
|
||||
|
||||
NO_DIST_INSTALL = 1
|
||||
NO_INSTALL = 1
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
|
@ -1,6 +0,0 @@
|
|||
[winembed]
|
||||
#if SHARED_LIBRARY
|
||||
embedding/lite/@SHARED_LIBRARY@ dist/bin/components/@SHARED_LIBRARY@
|
||||
#else
|
||||
!staticcomp @LIBRARY@ @MODULE_NAME@
|
||||
#endif
|
|
@ -1,357 +0,0 @@
|
|||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* 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 limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is mozilla.org code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corporation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2001
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#include "nsEmbedChromeRegistry.h"
|
||||
#include "nsString.h"
|
||||
#include "nsReadableUtils.h"
|
||||
#include "plstr.h"
|
||||
|
||||
#include "nsIDirectoryService.h"
|
||||
#include "nsAppDirectoryServiceDefs.h"
|
||||
#include "nsIProperties.h"
|
||||
#include "nsILocalFile.h"
|
||||
#include "nsIURI.h"
|
||||
|
||||
#define CHROME_TYPE_CONTENT 0
|
||||
#define CHROME_TYPE_LOCALE 1
|
||||
#define CHROME_TYPE_SKIN 2
|
||||
|
||||
const char kChromePrefix[] = "chrome://";
|
||||
|
||||
static nsresult
|
||||
SplitURL(nsIURI *aChromeURI, nsCString& aPackage, nsCString& aProvider, nsCString& aFile,
|
||||
PRBool *aModified = nsnull)
|
||||
{
|
||||
// Splits a "chrome:" URL into its package, provider, and file parts.
|
||||
// Here are the current portions of a
|
||||
// chrome: url that make up the chrome-
|
||||
//
|
||||
// chrome://global/skin/foo?bar
|
||||
// \------/ \----/\---/ \-----/
|
||||
// | | | |
|
||||
// | | | `-- RemainingPortion
|
||||
// | | |
|
||||
// | | `-- Provider
|
||||
// | |
|
||||
// | `-- Package
|
||||
// |
|
||||
// `-- Always "chrome://"
|
||||
//
|
||||
//
|
||||
|
||||
nsresult rv;
|
||||
|
||||
nsCAutoString str;
|
||||
rv = aChromeURI->GetSpec(str);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
// We only want to deal with "chrome:" URLs here. We could return
|
||||
// an error code if the URL isn't properly prefixed here...
|
||||
if (PL_strncmp(str.get(), kChromePrefix, sizeof(kChromePrefix) - 1) != 0)
|
||||
return NS_ERROR_INVALID_ARG;
|
||||
|
||||
// Cull out the "package" string; e.g., "navigator"
|
||||
aPackage = str.get() + sizeof(kChromePrefix) - 1;
|
||||
|
||||
PRInt32 idx;
|
||||
idx = aPackage.FindChar('/');
|
||||
if (idx < 0)
|
||||
return NS_OK;
|
||||
|
||||
// Cull out the "provider" string; e.g., "content"
|
||||
aPackage.Right(aProvider, aPackage.Length() - (idx + 1));
|
||||
aPackage.Truncate(idx);
|
||||
|
||||
idx = aProvider.FindChar('/');
|
||||
if (idx < 0) {
|
||||
// Force the provider to end with a '/'
|
||||
idx = aProvider.Length();
|
||||
aProvider.Append('/');
|
||||
}
|
||||
|
||||
// Cull out the "file"; e.g., "navigator.xul"
|
||||
aProvider.Right(aFile, aProvider.Length() - (idx + 1));
|
||||
aProvider.Truncate(idx);
|
||||
|
||||
PRBool nofile = aFile.IsEmpty();
|
||||
if (nofile) {
|
||||
// If there is no file, then construct the default file
|
||||
aFile = aPackage;
|
||||
|
||||
if (aProvider.Equals("content")) {
|
||||
aFile += ".xul";
|
||||
}
|
||||
else if (aProvider.Equals("skin")) {
|
||||
aFile += ".css";
|
||||
}
|
||||
else if (aProvider.Equals("locale")) {
|
||||
aFile += ".dtd";
|
||||
}
|
||||
else {
|
||||
NS_ERROR("unknown provider");
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
} else {
|
||||
// Protect against URIs containing .. that reach up out of the
|
||||
// chrome directory to grant chrome privileges to non-chrome files.
|
||||
int depth = 0;
|
||||
PRBool sawSlash = PR_TRUE; // .. at the beginning is suspect as well as /..
|
||||
for (const char* p=aFile.get(); *p; p++) {
|
||||
if (sawSlash) {
|
||||
if (p[0] == '.' && p[1] == '.'){
|
||||
depth--; // we have /.., decrement depth.
|
||||
} else {
|
||||
static const char escape[] = "%2E%2E";
|
||||
if (PL_strncasecmp(p, escape, sizeof(escape)-1) == 0)
|
||||
depth--; // we have the HTML-escaped form of /.., decrement depth.
|
||||
}
|
||||
} else if (p[0] != '/') {
|
||||
depth++; // we have /x for some x that is not /
|
||||
}
|
||||
sawSlash = (p[0] == '/');
|
||||
|
||||
if (depth < 0) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (aModified)
|
||||
*aModified = nofile;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMPL_ISUPPORTS1(nsEmbedChromeRegistry, nsIChromeRegistry)
|
||||
|
||||
nsEmbedChromeRegistry::nsEmbedChromeRegistry()
|
||||
{
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsEmbedChromeRegistry::Init()
|
||||
{
|
||||
NS_ASSERTION(0, "Creating embedding chrome registry\n");
|
||||
nsresult rv;
|
||||
|
||||
rv = NS_NewISupportsArray(getter_AddRefs(mEmptyArray));
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
rv = ReadChromeRegistry();
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsEmbedChromeRegistry::ReadChromeRegistry()
|
||||
{
|
||||
nsresult rv;
|
||||
nsCOMPtr<nsIProperties> directoryService =
|
||||
do_GetService(NS_DIRECTORY_SERVICE_CONTRACTID, &rv);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
nsCOMPtr<nsILocalFile> listFile;
|
||||
rv = directoryService->Get(NS_APP_CHROME_DIR, NS_GET_IID(nsILocalFile),
|
||||
getter_AddRefs(listFile));
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
rv = listFile->AppendRelativeNativePath(NS_LITERAL_CSTRING("installed-chrome.txt"));
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
PRFileDesc *file;
|
||||
rv = listFile->OpenNSPRFileDesc(PR_RDONLY, 0, &file);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
PRFileInfo finfo;
|
||||
|
||||
if (PR_GetOpenFileInfo(file, &finfo) == PR_SUCCESS) {
|
||||
char *dataBuffer = new char[finfo.size+1];
|
||||
if (dataBuffer) {
|
||||
PRInt32 bufferSize = PR_Read(file, dataBuffer, finfo.size);
|
||||
if (bufferSize > 0) {
|
||||
dataBuffer[bufferSize] = '\r';
|
||||
rv = ProcessNewChromeBuffer(dataBuffer, bufferSize);
|
||||
}
|
||||
delete [] dataBuffer;
|
||||
}
|
||||
}
|
||||
PR_Close(file);
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsEmbedChromeRegistry::ProcessNewChromeBuffer(char* aBuffer, PRInt32 aLength)
|
||||
{
|
||||
while (aLength > 0) {
|
||||
PRInt32 processedBytes = ProcessChromeLine(aBuffer, aLength);
|
||||
aBuffer += processedBytes;
|
||||
aLength -= processedBytes;
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
#define MAX_TOKENS 5
|
||||
struct chromeToken {
|
||||
const char *tokenStart;
|
||||
const char *tokenEnd;
|
||||
};
|
||||
|
||||
PRInt32
|
||||
nsEmbedChromeRegistry::ProcessChromeLine(const char* aBuffer, PRInt32 aLength)
|
||||
{
|
||||
PRInt32 bytesProcessed = 0;
|
||||
chromeToken tokens[MAX_TOKENS];
|
||||
PRInt32 tokenCount = 0;
|
||||
PRBool expectingToken = PR_TRUE;
|
||||
|
||||
while (bytesProcessed <= aLength &&
|
||||
*aBuffer != '\n' && *aBuffer != '\r' &&
|
||||
tokenCount < MAX_TOKENS) {
|
||||
|
||||
if (*aBuffer == ',') {
|
||||
tokenCount++;
|
||||
expectingToken = PR_TRUE;
|
||||
}
|
||||
else if (expectingToken)
|
||||
tokens[tokenCount].tokenStart = aBuffer;
|
||||
else
|
||||
tokens[tokenCount].tokenEnd = aBuffer;
|
||||
|
||||
|
||||
aBuffer++;
|
||||
bytesProcessed++;
|
||||
}
|
||||
NS_ASSERTION(tokenCount == 4, "Unexpected tokens in line");
|
||||
|
||||
nsDependentCSubstring
|
||||
chromeType(tokens[0].tokenStart, tokens[0].tokenEnd);
|
||||
nsDependentCSubstring
|
||||
chromeProfile(tokens[1].tokenStart, tokens[1].tokenEnd);
|
||||
nsDependentCSubstring
|
||||
chromeLocType(tokens[2].tokenStart, tokens[2].tokenEnd);
|
||||
nsDependentCSubstring
|
||||
chromeLocation(tokens[3].tokenStart, tokens[3].tokenEnd);
|
||||
|
||||
RegisterChrome(chromeType, chromeProfile, chromeLocType, chromeLocation);
|
||||
return bytesProcessed;
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsEmbedChromeRegistry::RegisterChrome(const nsACString& aChromeType,
|
||||
const nsACString& aChromeProfile,
|
||||
const nsACString& aChromeLocType,
|
||||
const nsACString& aChromeLocation)
|
||||
{
|
||||
PRInt32 chromeType;
|
||||
if (aChromeType.EqualsLiteral("skin"))
|
||||
chromeType = CHROME_TYPE_SKIN;
|
||||
else if (aChromeType.EqualsLiteral("locale"))
|
||||
chromeType = CHROME_TYPE_LOCALE;
|
||||
else
|
||||
chromeType = CHROME_TYPE_CONTENT;
|
||||
|
||||
PRBool chromeIsProfile =
|
||||
aChromeProfile.EqualsLiteral("profile");
|
||||
|
||||
PRBool chromeIsURL =
|
||||
aChromeProfile.EqualsLiteral("url");
|
||||
|
||||
return RegisterChrome(chromeType, chromeIsProfile, chromeIsURL,
|
||||
aChromeLocation);
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsEmbedChromeRegistry::RegisterChrome(PRInt32 aChromeType, // CHROME_TYPE_CONTENT, etc
|
||||
PRBool aChromeIsProfile, // per-profile?
|
||||
PRBool aChromeIsURL, // is it a url? (else path)
|
||||
const nsACString& aChromeLocation)
|
||||
{
|
||||
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsEmbedChromeRegistry::CheckForNewChrome()
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsEmbedChromeRegistry::Canonify(nsIURI* aChromeURI)
|
||||
{
|
||||
#if 1
|
||||
// Canonicalize 'chrome:' URLs. We'll take any 'chrome:' URL
|
||||
// without a filename, and change it to a URL -with- a filename;
|
||||
// e.g., "chrome://navigator/content" to
|
||||
// "chrome://navigator/content/navigator.xul".
|
||||
if (! aChromeURI)
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
|
||||
PRBool modified = PR_TRUE; // default is we do canonification
|
||||
nsCAutoString package, provider, file;
|
||||
nsresult rv;
|
||||
rv = SplitURL(aChromeURI, package, provider, file, &modified);
|
||||
if (NS_FAILED(rv))
|
||||
return rv;
|
||||
|
||||
if (!modified)
|
||||
return NS_OK;
|
||||
|
||||
nsCAutoString canonical( kChromePrefix );
|
||||
canonical += package;
|
||||
canonical += "/";
|
||||
canonical += provider;
|
||||
canonical += "/";
|
||||
canonical += file;
|
||||
|
||||
return aChromeURI->SetSpec(canonical);
|
||||
#else
|
||||
return NS_OK;
|
||||
#endif
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsEmbedChromeRegistry::ConvertChromeURL(nsIURI* aChromeURL, nsACString& aResult)
|
||||
{
|
||||
nsresult rv;
|
||||
|
||||
rv = aChromeURL->GetSpec(aResult);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
return NS_OK;
|
||||
}
|
|
@ -1,74 +0,0 @@
|
|||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* 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 limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is mozilla.org code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corporation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2001
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#include "nsIChromeRegistry.h"
|
||||
#include "nsSupportsArray.h"
|
||||
|
||||
// {0C3434A5-D52E-4bb7-BEBE-F572D8EDBE2B}
|
||||
#define NS_EMBEDCHROMEREGISTRY_CID \
|
||||
{ 0xc3434a5, 0xd52e, 0x4bb7, \
|
||||
{ 0xbe, 0xbe, 0xf5, 0x72, 0xd8, 0xed, 0xbe, 0x2b } }
|
||||
|
||||
|
||||
class nsEmbedChromeRegistry : public nsIChromeRegistry
|
||||
{
|
||||
public:
|
||||
nsEmbedChromeRegistry();
|
||||
virtual ~nsEmbedChromeRegistry() {}
|
||||
nsresult Init();
|
||||
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
NS_DECL_NSICHROMEREGISTRY
|
||||
|
||||
nsresult ReadChromeRegistry();
|
||||
nsresult ProcessNewChromeBuffer(char* aBuffer, PRInt32 aLength);
|
||||
PRInt32 ProcessChromeLine(const char* aBuffer, PRInt32 aLength);
|
||||
nsresult RegisterChrome(const nsACString& aChromeType,
|
||||
const nsACString& aChromeProfile,
|
||||
const nsACString& aChromeLocType,
|
||||
const nsACString& aChromeLocation);
|
||||
nsresult RegisterChrome(PRInt32 aChromeType, // CHROME_TYPE_CONTENT, etc
|
||||
PRBool aChromeIsProfile, // per-profile?
|
||||
PRBool aChromeIsURL, // is it a url? (else path)
|
||||
const nsACString& aChromeLocation);
|
||||
|
||||
|
||||
|
||||
private:
|
||||
nsCOMPtr<nsISupportsArray> mEmptyArray;
|
||||
};
|
|
@ -1,550 +0,0 @@
|
|||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* 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 limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is mozilla.org code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corporation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 1998
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Conrad Carlen <ccarlen@netscape.com>
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#include "nsEmbedGlobalHistory.h"
|
||||
#include "nsIObserver.h"
|
||||
#include "nsIObserverService.h"
|
||||
#include "nsWeakReference.h"
|
||||
#include "nsAppDirectoryServiceDefs.h"
|
||||
#include "nsHashtable.h"
|
||||
#include "nsInt64.h"
|
||||
#include "prtypes.h"
|
||||
#include "nsFixedSizeAllocator.h"
|
||||
#include "nsVoidArray.h"
|
||||
#include "nsIPrefService.h"
|
||||
|
||||
// Constants
|
||||
static const PRInt32 kNewEntriesBetweenFlush = 10;
|
||||
|
||||
static const PRUint32 kDefaultExpirationIntervalDays = 7;
|
||||
|
||||
static const PRInt64 kMSecsPerDay = LL_INIT(0, 60 * 60 * 24 * 1000);
|
||||
static const PRInt64 kOneThousand = LL_INIT(0, 1000);
|
||||
|
||||
#define PREF_BROWSER_HISTORY_EXPIRE_DAYS "browser.history_expire_days"
|
||||
|
||||
// Static Routine Prototypes
|
||||
static nsresult readEntry(FILE *inStream, nsCString& url, HistoryEntry **entry);
|
||||
static nsresult writeEntry(FILE *outStm, nsCStringKey *url, HistoryEntry *entry);
|
||||
|
||||
static PRIntn PR_CALLBACK enumWriteEntry(nsHashKey *aKey, void *aData, void* closure);
|
||||
static PRIntn PR_CALLBACK enumWriteEntryIfUnwritten(nsHashKey *aKey, void *aData, void* closure);
|
||||
static PRIntn PR_CALLBACK enumDeleteEntry(nsHashKey *aKey, void *aData, void* closure);
|
||||
|
||||
//*****************************************************************************
|
||||
// HistoryEntry
|
||||
//*****************************************************************************
|
||||
|
||||
class HistoryEntry {
|
||||
public:
|
||||
HistoryEntry() :
|
||||
mWritten(PR_FALSE) {}
|
||||
|
||||
|
||||
void OnVisited()
|
||||
{
|
||||
mLastVisitTime = PR_Now();
|
||||
LL_DIV(mLastVisitTime, mLastVisitTime, kOneThousand);
|
||||
}
|
||||
|
||||
PRInt64 GetLastVisitTime()
|
||||
{ return mLastVisitTime; }
|
||||
void SetLastVisitTime(const PRInt64& aTime)
|
||||
{ mLastVisitTime = aTime; }
|
||||
|
||||
PRBool GetIsWritten()
|
||||
{ return mWritten; }
|
||||
void SetIsWritten(PRBool written = PR_TRUE)
|
||||
{ mWritten = PR_TRUE; }
|
||||
|
||||
// Memory management stuff
|
||||
static void* operator new(size_t size) CPP_THROW_NEW;
|
||||
static void operator delete(void *p, size_t size);
|
||||
|
||||
// Must be called when done with all HistoryEntry objects
|
||||
static void ReleasePool();
|
||||
|
||||
private:
|
||||
PRInt64 mLastVisitTime; // Millisecs
|
||||
PRPackedBool mWritten; // TRUE if ever persisted
|
||||
|
||||
static nsresult InitPool();
|
||||
static nsFixedSizeAllocator *sPool;
|
||||
};
|
||||
|
||||
nsFixedSizeAllocator *HistoryEntry::sPool;
|
||||
|
||||
//*****************************************************************************
|
||||
|
||||
void* HistoryEntry::operator new(size_t size) CPP_THROW_NEW
|
||||
{
|
||||
if (size != sizeof(HistoryEntry))
|
||||
return ::operator new(size);
|
||||
if (!sPool && NS_FAILED(InitPool()))
|
||||
return nsnull;
|
||||
|
||||
return sPool->Alloc(size);
|
||||
}
|
||||
|
||||
void HistoryEntry::operator delete(void *p, size_t size)
|
||||
{
|
||||
if (!p)
|
||||
return;
|
||||
if (size != sizeof(HistoryEntry))
|
||||
::operator delete(p);
|
||||
if (!sPool) {
|
||||
NS_ERROR("HistoryEntry outlived its memory pool");
|
||||
return;
|
||||
}
|
||||
sPool->Free(p, size);
|
||||
}
|
||||
|
||||
nsresult HistoryEntry::InitPool()
|
||||
{
|
||||
if (!sPool) {
|
||||
sPool = new nsFixedSizeAllocator;
|
||||
if (!sPool)
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
|
||||
static const size_t kBucketSizes[] =
|
||||
{ sizeof(HistoryEntry) };
|
||||
static const PRInt32 kInitialPoolSize =
|
||||
NS_SIZE_IN_HEAP(sizeof(HistoryEntry)) * 256;
|
||||
|
||||
nsresult rv = sPool->Init("EmbedLite HistoryEntry Pool", kBucketSizes, 1, kInitialPoolSize);
|
||||
if (NS_FAILED(rv))
|
||||
return rv;
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
void HistoryEntry::ReleasePool()
|
||||
{
|
||||
delete sPool;
|
||||
sPool = nsnull;
|
||||
}
|
||||
|
||||
//*****************************************************************************
|
||||
// nsEmbedGlobalHistory - Creation/Destruction
|
||||
//*****************************************************************************
|
||||
|
||||
NS_IMPL_ISUPPORTS3(nsEmbedGlobalHistory, nsIGlobalHistory, nsIObserver, nsISupportsWeakReference)
|
||||
|
||||
nsEmbedGlobalHistory::nsEmbedGlobalHistory() :
|
||||
mDataIsLoaded(PR_FALSE), mEntriesAddedSinceFlush(0),
|
||||
mURLTable(nsnull)
|
||||
{
|
||||
LL_I2L(mExpirationInterval, kDefaultExpirationIntervalDays);
|
||||
LL_MUL(mExpirationInterval, mExpirationInterval, kMSecsPerDay);
|
||||
}
|
||||
|
||||
nsEmbedGlobalHistory::~nsEmbedGlobalHistory()
|
||||
{
|
||||
FlushData();
|
||||
delete mURLTable;
|
||||
HistoryEntry::ReleasePool();
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsEmbedGlobalHistory::Init()
|
||||
{
|
||||
mURLTable = new nsHashtable;
|
||||
NS_ENSURE_TRUE(mURLTable, NS_ERROR_OUT_OF_MEMORY);
|
||||
|
||||
// Get Pref and convert to millisecs
|
||||
nsCOMPtr<nsIPrefBranch> prefs(do_GetService("@mozilla.org/preferences-service;1"));
|
||||
if (prefs) {
|
||||
PRInt32 expireDays;
|
||||
prefs->GetIntPref(PREF_BROWSER_HISTORY_EXPIRE_DAYS, &expireDays);
|
||||
LL_I2L(mExpirationInterval, expireDays);
|
||||
LL_MUL(mExpirationInterval, mExpirationInterval, kMSecsPerDay);
|
||||
}
|
||||
|
||||
// register to observe profile changes
|
||||
nsCOMPtr<nsIObserverService> observerService =
|
||||
do_GetService("@mozilla.org/observer-service;1");
|
||||
NS_ASSERTION(observerService, "failed to get observer service");
|
||||
if (observerService)
|
||||
observerService->AddObserver(this, "profile-before-change", PR_TRUE);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
//*****************************************************************************
|
||||
// nsEmbedGlobalHistory::nsIGlobalHistory
|
||||
//*****************************************************************************
|
||||
|
||||
NS_IMETHODIMP nsEmbedGlobalHistory::AddPage(const char *aURL)
|
||||
{
|
||||
NS_ENSURE_ARG(aURL);
|
||||
|
||||
nsresult rv = LoadData();
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
nsCStringKey asKey(aURL);
|
||||
HistoryEntry *entry = static_cast<HistoryEntry *>(mURLTable->Get(&asKey));
|
||||
if (!entry) {
|
||||
|
||||
if (++mEntriesAddedSinceFlush >= kNewEntriesBetweenFlush)
|
||||
FlushData(kFlushModeAppend);
|
||||
|
||||
HistoryEntry *newEntry = new HistoryEntry;
|
||||
if (!newEntry)
|
||||
return NS_ERROR_FAILURE;
|
||||
(void)mURLTable->Put(&asKey, newEntry);
|
||||
entry = newEntry;
|
||||
}
|
||||
entry->OnVisited();
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsEmbedGlobalHistory::IsVisited(const char *aURL, PRBool *_retval)
|
||||
{
|
||||
NS_ENSURE_ARG(aURL);
|
||||
NS_ENSURE_ARG_POINTER(_retval);
|
||||
|
||||
nsresult rv = LoadData();
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
nsCStringKey asKey(aURL);
|
||||
|
||||
*_retval = (mURLTable->Exists(&asKey));
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
//*****************************************************************************
|
||||
// nsEmbedGlobalHistory::nsIObserver
|
||||
//*****************************************************************************
|
||||
|
||||
NS_IMETHODIMP nsEmbedGlobalHistory::Observe(nsISupports *aSubject, const char *aTopic, const PRUnichar *aData)
|
||||
{
|
||||
nsresult rv = NS_OK;
|
||||
|
||||
if (strcmp(aTopic, "profile-before-change") == 0) {
|
||||
(void)FlushData();
|
||||
(void)ResetData();
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
|
||||
//*****************************************************************************
|
||||
// nsEmbedGlobalHistory
|
||||
//*****************************************************************************
|
||||
|
||||
nsresult nsEmbedGlobalHistory::LoadData()
|
||||
{
|
||||
if (!mDataIsLoaded) {
|
||||
|
||||
nsresult rv;
|
||||
PRBool exists;
|
||||
|
||||
mDataIsLoaded = PR_TRUE;
|
||||
|
||||
rv = GetHistoryFile();
|
||||
if (NS_FAILED(rv))
|
||||
return rv;
|
||||
rv = mHistoryFile->Exists(&exists);
|
||||
if (NS_FAILED(rv))
|
||||
return rv;
|
||||
if (!exists)
|
||||
return NS_OK;
|
||||
|
||||
FILE *stdFile;
|
||||
rv = mHistoryFile->OpenANSIFileDesc("r", &stdFile);
|
||||
if (NS_FAILED(rv))
|
||||
return rv;
|
||||
|
||||
nsCAutoString outString;
|
||||
HistoryEntry *newEntry;
|
||||
while (NS_SUCCEEDED(readEntry(stdFile, outString, &newEntry))) {
|
||||
if (EntryHasExpired(newEntry)) {
|
||||
delete newEntry;
|
||||
}
|
||||
else {
|
||||
nsCStringKey asKey(outString);
|
||||
mURLTable->Put(&asKey, newEntry);
|
||||
}
|
||||
}
|
||||
|
||||
fclose(stdFile);
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsresult nsEmbedGlobalHistory::FlushData(PRIntn mode)
|
||||
{
|
||||
if (mHistoryFile) {
|
||||
|
||||
const char* openMode = (mode == kFlushModeAppend ? "a" : "w");
|
||||
FILE *stdFile;
|
||||
nsresult rv = mHistoryFile->OpenANSIFileDesc(openMode, &stdFile);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
// Before flushing either way, remove dead entries
|
||||
mURLTable->Enumerate(enumRemoveEntryIfExpired, this);
|
||||
|
||||
if (mode == kFlushModeAppend)
|
||||
mURLTable->Enumerate(enumWriteEntryIfUnwritten, stdFile);
|
||||
else
|
||||
mURLTable->Enumerate(enumWriteEntry, stdFile);
|
||||
|
||||
mEntriesAddedSinceFlush = 0;
|
||||
fclose(stdFile);
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsresult nsEmbedGlobalHistory::ResetData()
|
||||
{
|
||||
mURLTable->Reset(enumDeleteEntry);
|
||||
mHistoryFile = 0;
|
||||
mDataIsLoaded = PR_FALSE;
|
||||
mEntriesAddedSinceFlush = 0;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsresult nsEmbedGlobalHistory::GetHistoryFile()
|
||||
{
|
||||
nsresult rv;
|
||||
|
||||
// Get the history file in our profile dir.
|
||||
// Notice we are not just getting NS_APP_HISTORY_50_FILE
|
||||
// because it is used by the "real" global history component.
|
||||
|
||||
nsCOMPtr<nsIFile> aFile;
|
||||
rv = NS_GetSpecialDirectory(NS_APP_USER_PROFILE_50_DIR, getter_AddRefs(aFile));
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
rv = aFile->Append(NS_LITERAL_STRING("history.txt"));
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
mHistoryFile = do_QueryInterface(aFile);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
PRBool nsEmbedGlobalHistory::EntryHasExpired(HistoryEntry *entry)
|
||||
{
|
||||
// convert "now" from microsecs to millisecs
|
||||
PRInt64 nowInMilliSecs = PR_Now();
|
||||
LL_DIV(nowInMilliSecs, nowInMilliSecs, kOneThousand);
|
||||
|
||||
// determine when the entry would have expired
|
||||
PRInt64 expirationIntervalAgo;
|
||||
LL_SUB(expirationIntervalAgo, nowInMilliSecs, mExpirationInterval);
|
||||
|
||||
PRInt64 lastVisitTime = entry->GetLastVisitTime();
|
||||
return (LL_CMP(lastVisitTime, <, expirationIntervalAgo));
|
||||
}
|
||||
|
||||
PRIntn PR_CALLBACK nsEmbedGlobalHistory::enumRemoveEntryIfExpired(nsHashKey *aKey, void *aData, void* closure)
|
||||
{
|
||||
HistoryEntry *entry = static_cast<HistoryEntry*>(aData);
|
||||
if (!entry)
|
||||
return PR_FALSE;
|
||||
nsEmbedGlobalHistory *history = static_cast<nsEmbedGlobalHistory*>(closure);
|
||||
if (!history)
|
||||
return kHashEnumerateStop;
|
||||
|
||||
if (history->EntryHasExpired(entry)) {
|
||||
delete entry;
|
||||
return kHashEnumerateRemove;
|
||||
}
|
||||
return kHashEnumerateNext;
|
||||
}
|
||||
|
||||
|
||||
//*****************************************************************************
|
||||
// Static Functions
|
||||
//*****************************************************************************
|
||||
|
||||
static nsresult parsePRInt64(FILE *inStm, PRInt64& outValue)
|
||||
{
|
||||
int c, charsRead = 0;
|
||||
nsInt64 value = 0;
|
||||
|
||||
while (PR_TRUE) {
|
||||
c = fgetc(inStm);
|
||||
if (c == EOF || !isdigit(c))
|
||||
break;
|
||||
|
||||
++charsRead;
|
||||
PRInt32 digit = c - '0';
|
||||
value *= nsInt64(10);
|
||||
value += nsInt64(digit);
|
||||
}
|
||||
if (!charsRead)
|
||||
return NS_ERROR_FAILURE;
|
||||
outValue = value;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsresult readEntry(FILE *inStream, nsCString& outURL, HistoryEntry **outEntry)
|
||||
{
|
||||
nsresult rv;
|
||||
|
||||
// Get the last visted date
|
||||
PRInt64 value;
|
||||
rv = parsePRInt64(inStream, value);
|
||||
if (NS_FAILED(rv))
|
||||
return rv;
|
||||
|
||||
// Get the URL
|
||||
int c;
|
||||
char buf[1024];
|
||||
char *next, *end = buf + sizeof(buf);
|
||||
|
||||
outURL.Truncate(0);
|
||||
next = buf;
|
||||
|
||||
while (PR_TRUE) {
|
||||
c = fgetc(inStream);
|
||||
|
||||
if (c == EOF)
|
||||
break;
|
||||
else if (c == '\n')
|
||||
break;
|
||||
else if (c == '\r') {
|
||||
c = fgetc(inStream);
|
||||
if (c != '\n')
|
||||
ungetc(c, inStream);
|
||||
break;
|
||||
}
|
||||
else {
|
||||
*next++ = c;
|
||||
if (next >= end) {
|
||||
outURL.Append(buf, next - buf);
|
||||
next = buf;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (next > buf)
|
||||
outURL.Append(buf, next - buf);
|
||||
|
||||
if (!outURL.Length() && c == EOF)
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
*outEntry = new HistoryEntry;
|
||||
if (!*outEntry)
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
(*outEntry)->SetLastVisitTime(value);
|
||||
(*outEntry)->SetIsWritten();
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
static nsresult writePRInt64(FILE *outStm, const PRInt64& inValue)
|
||||
{
|
||||
nsInt64 value(inValue);
|
||||
|
||||
if (value == nsInt64(0)) {
|
||||
fputc('0', outStm);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsCAutoString tempString;
|
||||
|
||||
while (value != nsInt64(0)) {
|
||||
PRInt32 ones = PRInt32(value % nsInt64(10));
|
||||
value /= nsInt64(10);
|
||||
tempString.Insert(char('0' + ones), 0);
|
||||
}
|
||||
int result = fputs(tempString.get(), outStm);
|
||||
return (result == EOF) ? NS_ERROR_FAILURE : NS_OK;
|
||||
}
|
||||
|
||||
nsresult writeEntry(FILE *outStm, nsCStringKey *url, HistoryEntry *entry)
|
||||
{
|
||||
writePRInt64(outStm, entry->GetLastVisitTime());
|
||||
fputc(':', outStm);
|
||||
|
||||
fputs(url->GetString(), outStm);
|
||||
entry->SetIsWritten();
|
||||
|
||||
#if defined (XP_WIN) || defined(XP_OS2)
|
||||
fputc('\r', outStm);
|
||||
fputc('\n', outStm);
|
||||
#elif defined(XP_UNIX)
|
||||
fputc('\n', outStm);
|
||||
#else
|
||||
fputc('\r', outStm);
|
||||
#endif
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
PRIntn PR_CALLBACK enumWriteEntry(nsHashKey *aKey, void *aData, void* closure)
|
||||
{
|
||||
FILE *outStm = static_cast<FILE*>(closure);
|
||||
if (!outStm)
|
||||
return kHashEnumerateStop;
|
||||
nsCStringKey *stringKey = static_cast<nsCStringKey*>(aKey);
|
||||
if (!stringKey)
|
||||
return kHashEnumerateStop;
|
||||
HistoryEntry *entry = static_cast<HistoryEntry*>(aData);
|
||||
if (!entry)
|
||||
return kHashEnumerateStop;
|
||||
|
||||
nsresult rv = writeEntry(outStm, stringKey, entry);
|
||||
|
||||
return NS_SUCCEEDED(rv) ? kHashEnumerateNext : kHashEnumerateStop;
|
||||
}
|
||||
|
||||
PRIntn PR_CALLBACK enumWriteEntryIfUnwritten(nsHashKey *aKey, void *aData, void* closure)
|
||||
{
|
||||
FILE *outStm = static_cast<FILE*>(closure);
|
||||
if (!outStm)
|
||||
return kHashEnumerateStop;
|
||||
nsCStringKey *stringKey = static_cast<nsCStringKey*>(aKey);
|
||||
if (!stringKey)
|
||||
return kHashEnumerateStop;
|
||||
HistoryEntry *entry = static_cast<HistoryEntry*>(aData);
|
||||
if (!entry)
|
||||
return kHashEnumerateStop;
|
||||
|
||||
nsresult rv = NS_OK;
|
||||
if (!entry->GetIsWritten())
|
||||
rv = writeEntry(outStm, stringKey, entry);
|
||||
|
||||
return NS_SUCCEEDED(rv) ? kHashEnumerateNext : kHashEnumerateStop;
|
||||
}
|
||||
|
||||
PRIntn PR_CALLBACK enumDeleteEntry(nsHashKey *aKey, void *aData, void* closure)
|
||||
{
|
||||
HistoryEntry *entry = static_cast<HistoryEntry*>(aData);
|
||||
delete entry;
|
||||
|
||||
return kHashEnumerateNext;
|
||||
}
|
|
@ -1,96 +0,0 @@
|
|||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* 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 limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is mozilla.org code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corporation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 1998
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Conrad Carlen <ccarlen@netscape.com>
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#ifndef __nsEmbedGlobalHistory_h__
|
||||
#define __nsEmbedGlobalHistory_h__
|
||||
|
||||
#include "nsIGlobalHistory.h"
|
||||
#include "nsIObserver.h"
|
||||
#include "nsWeakReference.h"
|
||||
#include "nsILocalFile.h"
|
||||
#include "nsString.h"
|
||||
|
||||
class nsHashtable;
|
||||
class nsHashKey;
|
||||
class nsCStringKey;
|
||||
class HistoryEntry;
|
||||
|
||||
//*****************************************************************************
|
||||
// nsEmbedGlobalHistory
|
||||
//*****************************************************************************
|
||||
|
||||
// {2f977d51-5485-11d4-87e2-0010a4e75ef2}
|
||||
#define NS_EMBEDGLOBALHISTORY_CID \
|
||||
{ 0x2f977d51, 0x5485, 0x11d4, \
|
||||
{ 0x87, 0xe2, 0x00, 0x10, 0xa4, 0xe7, 0x5e, 0xf2 } }
|
||||
|
||||
class nsEmbedGlobalHistory: public nsIGlobalHistory,
|
||||
public nsIObserver,
|
||||
public nsSupportsWeakReference
|
||||
{
|
||||
public:
|
||||
nsEmbedGlobalHistory();
|
||||
virtual ~nsEmbedGlobalHistory();
|
||||
|
||||
NS_IMETHOD Init();
|
||||
|
||||
NS_DECL_ISUPPORTS
|
||||
NS_DECL_NSIGLOBALHISTORY
|
||||
NS_DECL_NSIOBSERVER
|
||||
|
||||
protected:
|
||||
enum { kFlushModeAppend, kFlushModeFullWrite };
|
||||
|
||||
nsresult LoadData();
|
||||
nsresult FlushData(PRIntn mode = kFlushModeFullWrite);
|
||||
nsresult ResetData();
|
||||
|
||||
nsresult GetHistoryFile();
|
||||
|
||||
PRBool EntryHasExpired(HistoryEntry *entry);
|
||||
static PRIntn PR_CALLBACK enumRemoveEntryIfExpired(nsHashKey *aKey, void *aData, void* closure);
|
||||
|
||||
protected:
|
||||
PRBool mDataIsLoaded;
|
||||
PRInt32 mEntriesAddedSinceFlush;
|
||||
nsCOMPtr<nsILocalFile> mHistoryFile;
|
||||
nsHashtable *mURLTable;
|
||||
PRInt64 mExpirationInterval;
|
||||
};
|
||||
|
||||
#endif
|
|
@ -1,68 +0,0 @@
|
|||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* 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 limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is mozilla.org code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corporation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2001
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#include "nsIGenericFactory.h"
|
||||
|
||||
#include "nsEmbedChromeRegistry.h"
|
||||
#include "nsEmbedGlobalHistory.h"
|
||||
#include "nsChromeProtocolHandler.h"
|
||||
|
||||
//NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsEmbedChromeRegistry, Init)
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsEmbedGlobalHistory, Init)
|
||||
|
||||
static const nsModuleComponentInfo components[] =
|
||||
{
|
||||
#if 0 // Don't hook up until implementation is finished
|
||||
{ "Chrome Registry",
|
||||
NS_EMBEDCHROMEREGISTRY_CID,
|
||||
"@mozilla.org/chrome/chrome-registry;1",
|
||||
nsEmbedChromeRegistryConstructor,
|
||||
},
|
||||
{ "Chrome Protocol Handler",
|
||||
NS_CHROMEPROTOCOLHANDLER_CID,
|
||||
NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX "chrome",
|
||||
nsChromeProtocolHandler::Create
|
||||
},
|
||||
#endif
|
||||
{ "Global History",
|
||||
NS_EMBEDGLOBALHISTORY_CID,
|
||||
"@mozilla.org/browser/global-history;1",
|
||||
nsEmbedGlobalHistoryConstructor,
|
||||
}
|
||||
};
|
||||
|
||||
NS_IMPL_NSGETMODULE(EmbedLiteComponents, components)
|
|
@ -1,45 +0,0 @@
|
|||
#
|
||||
# ***** BEGIN LICENSE BLOCK *****
|
||||
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
#
|
||||
# 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 limitations under the
|
||||
# License.
|
||||
#
|
||||
# The Original Code is mozilla.org code.
|
||||
#
|
||||
# The Initial Developer of the Original Code is
|
||||
# Netscape Communications Corporation.
|
||||
# Portions created by the Initial Developer are Copyright (C) 1998
|
||||
# the Initial Developer. All Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
#
|
||||
# Alternatively, the contents of this file may be used under the terms of
|
||||
# either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
# in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
# of those above. If you wish to allow use of your version of this file only
|
||||
# under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
# use your version of this file under the terms of the MPL, indicate your
|
||||
# decision by deleting the provisions above and replace them with the notice
|
||||
# and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
# the provisions above, a recipient may use your version of this file under
|
||||
# the terms of any one of the MPL, the GPL or the LGPL.
|
||||
#
|
||||
# ***** END LICENSE BLOCK *****
|
||||
|
||||
DEPTH = ../../../..
|
||||
topsrcdir = @top_srcdir@
|
||||
srcdir = @srcdir@
|
||||
VPATH = @srcdir@
|
||||
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
|
@ -1,18 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
<RDF:RDF xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:chrome="http://www.mozilla.org/rdf/chrome#">
|
||||
|
||||
<!-- list all the packages being supplied -->
|
||||
<RDF:Seq about="urn:mozilla:package:root">
|
||||
<RDF:li resource="urn:mozilla:package:autoconfig"/>
|
||||
</RDF:Seq>
|
||||
|
||||
<!-- package information -->
|
||||
<RDF:Description about="urn:mozilla:package:autoconfig"
|
||||
chrome:displayName="AutoConfig"
|
||||
chrome:author="mozilla.org"
|
||||
chrome:name="autoconfig"
|
||||
#expand chrome:localeVersion="__MOZILLA_LOCALE_VERSION__">
|
||||
</RDF:Description>
|
||||
|
||||
</RDF:RDF>
|
|
@ -1,8 +0,0 @@
|
|||
#ifndef MOZ_XUL_APP
|
||||
comm.jar:
|
||||
* content/autoconfig/contents.rdf (content/contents.rdf)
|
||||
|
||||
en-US.jar:
|
||||
* locale/en-US/autoconfig/contents.rdf (locale/en-US/contents.rdf)
|
||||
locale/en-US/autoconfig/autoconfig.properties (/toolkit/locales/en-US/chrome/autoconfig/autoconfig.properties)
|
||||
#endif
|
|
@ -1,23 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
<RDF:RDF xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:chrome="http://www.mozilla.org/rdf/chrome#">
|
||||
|
||||
<!-- list all the locales being supplied -->
|
||||
<RDF:Seq about="urn:mozilla:locale:root">
|
||||
<RDF:li resource="urn:mozilla:locale:en-US"/>
|
||||
</RDF:Seq>
|
||||
|
||||
<!-- locale information -->
|
||||
<RDF:Description about="urn:mozilla:locale:en-US">
|
||||
<chrome:packages>
|
||||
<RDF:Seq about="urn:mozilla:locale:en-US:packages">
|
||||
<RDF:li resource="urn:mozilla:locale:en-US:autoconfig"/>
|
||||
</RDF:Seq>
|
||||
</chrome:packages>
|
||||
</RDF:Description>
|
||||
|
||||
<!-- Version Information. State that we work only with major version of this
|
||||
package. -->
|
||||
<RDF:Description about="urn:mozilla:locale:en-US:autoconfig"
|
||||
#expand chrome:localeVersion="__MOZILLA_LOCALE_VERSION__"/>
|
||||
</RDF:RDF>
|
|
@ -1,24 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
<!-- This file remains only for the "suite" (seamonkey). According to
|
||||
http://developer.mozilla.org/en/docs/Chrome_Registration, as at Moz 1.8,
|
||||
this file is *not* necessary for Firefox or xulrunner.
|
||||
|
||||
todo: Remove this file as soon as seamonkey gets up to speed -
|
||||
this sample is *not* about backwards compat etc - it should remain
|
||||
as small as possible, focusing on only Python specific details
|
||||
-->
|
||||
|
||||
<RDF:RDF xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:chrome="http://www.mozilla.org/rdf/chrome#">
|
||||
|
||||
<RDF:Seq about="urn:mozilla:package:root">
|
||||
<RDF:li resource="urn:mozilla:package:pyxultest"/>
|
||||
</RDF:Seq>
|
||||
|
||||
<RDF:Description about="urn:mozilla:package:pyxultest"
|
||||
chrome:displayName="Python in XUL test"
|
||||
chrome:author="Mark Hammond"
|
||||
chrome:name="pyxultest">
|
||||
</RDF:Description>
|
||||
|
||||
</RDF:RDF>
|
|
@ -1,27 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
|
||||
#filter substitution
|
||||
|
||||
<RDF:RDF xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:chrome="http://www.mozilla.org/rdf/chrome#">
|
||||
|
||||
<!-- list all the locales being supplied by this package -->
|
||||
<RDF:Seq about="urn:mozilla:locale:root">
|
||||
<RDF:li resource="urn:mozilla:locale:@AB_CD@"/>
|
||||
</RDF:Seq>
|
||||
|
||||
<!-- locale information -->
|
||||
<RDF:Description about="urn:mozilla:locale:@AB_CD@">
|
||||
<chrome:packages>
|
||||
<RDF:Seq about="urn:mozilla:locale:@AB_CD@:packages">
|
||||
<RDF:li resource="urn:mozilla:locale:@AB_CD@:reporter"/>
|
||||
</RDF:Seq>
|
||||
</chrome:packages>
|
||||
</RDF:Description>
|
||||
|
||||
<!-- Version Information. State that we work only with major version of this
|
||||
package. -->
|
||||
<RDF:Description about="urn:mozilla:locale:@AB_CD@:reporter"
|
||||
chrome:localeVersion="@MOZILLA_LOCALE_VERSION@" />
|
||||
|
||||
</RDF:RDF>
|
|
@ -1,34 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
<RDF:RDF xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:chrome="http://www.mozilla.org/rdf/chrome#">
|
||||
<RDF:Seq about="urn:mozilla:package:root">
|
||||
<RDF:li resource="urn:mozilla:package:reporter"/>
|
||||
</RDF:Seq>
|
||||
<!-- package information -->
|
||||
<RDF:Description about="urn:mozilla:package:reporter"
|
||||
chrome:displayName="reporter.mozilla.org"
|
||||
chrome:author="Robert Accettura"
|
||||
chrome:authorURL="http://reporter.mozilla.org/"
|
||||
chrome:extension="true"
|
||||
chrome:description="Broken Web Site Reporting Tool"
|
||||
#expand chrome:localeVersion="__MOZILLA_LOCALE_VERSION__"
|
||||
chrome:name="reporter"
|
||||
chrome:xpcNativeWrappers="true">
|
||||
</RDF:Description>
|
||||
<!-- overlay information -->
|
||||
<!-- some of this is ffx 1.0 only -->
|
||||
<RDF:Seq about="urn:mozilla:overlays">
|
||||
<RDF:li resource="chrome://browser/content/browser.xul"/>
|
||||
<RDF:li resource="chrome://navigator/content/navigator.xul"/>
|
||||
<RDF:li resource="chrome://global/content/customizeToolbar.xul"/>
|
||||
</RDF:Seq>
|
||||
<RDF:Seq about="chrome://browser/content/browser.xul">
|
||||
<RDF:li>chrome://reporter/content/reporterOverlay.xul</RDF:li>
|
||||
</RDF:Seq>
|
||||
<RDF:Seq about="chrome://navigator/content/navigator.xul">
|
||||
<RDF:li>chrome://reporter/content/reporterOverlay.xul</RDF:li>
|
||||
</RDF:Seq>
|
||||
<RDF:Seq about="chrome://global/content/customizeToolbar.xul">
|
||||
<RDF:li>chrome://reporter/content/reporterOverlay.xul</RDF:li>
|
||||
</RDF:Seq>
|
||||
</RDF:RDF>
|
|
@ -1,14 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
<RDF:RDF xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:chrome="http://www.mozilla.org/rdf/chrome#">
|
||||
<RDF:Seq about="urn:mozilla:skin:root">
|
||||
<RDF:li resource="urn:mozilla:skin:classic/1.0"/>
|
||||
</RDF:Seq>
|
||||
<RDF:Description about="urn:mozilla:skin:classic/1.0">
|
||||
<chrome:packages>
|
||||
<RDF:Seq about="urn:mozilla:skin:classic/1.0:packages">
|
||||
<RDF:li resource="urn:mozilla:skin:classic/1.0:reporter"/>
|
||||
</RDF:Seq>
|
||||
</chrome:packages>
|
||||
</RDF:Description>
|
||||
</RDF:RDF>
|
|
@ -1,15 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
<RDF:RDF xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:chrome="http://www.mozilla.org/rdf/chrome#">
|
||||
|
||||
<RDF:Seq about="urn:mozilla:package:root">
|
||||
<RDF:li resource="urn:mozilla:package:xbl-marquee"/>
|
||||
</RDF:Seq>
|
||||
|
||||
<RDF:Description about="urn:mozilla:package:xbl-marquee"
|
||||
chrome:displayName="XBL Marquee Emulation"
|
||||
chrome:author="Netscape Communications Corporation"
|
||||
chrome:name="xbl-marquee">
|
||||
</RDF:Description>
|
||||
|
||||
</RDF:RDF>
|
|
@ -1,26 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
|
||||
#filter substitution
|
||||
|
||||
<RDF:RDF xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:chrome="http://www.mozilla.org/rdf/chrome#">
|
||||
|
||||
<!-- list all the locales being supplied -->
|
||||
<RDF:Seq about="urn:mozilla:locale:root">
|
||||
<RDF:li resource="urn:mozilla:locale:@AB_CD@"/>
|
||||
</RDF:Seq>
|
||||
|
||||
<!-- locale information -->
|
||||
<RDF:Description about="urn:mozilla:locale:@AB_CD@">
|
||||
<chrome:packages>
|
||||
<RDF:Seq about="urn:mozilla:locale:@AB_CD@:packages">
|
||||
<RDF:li resource="urn:mozilla:locale:@AB_CD@:necko"/>
|
||||
</RDF:Seq>
|
||||
</chrome:packages>
|
||||
</RDF:Description>
|
||||
|
||||
<!-- Version Information. State that we work only with major version of this
|
||||
package. -->
|
||||
<RDF:Description about="urn:mozilla:locale:@AB_CD@:necko"
|
||||
#expand chrome:localeVersion="__MOZILLA_LOCALE_VERSION__"/>
|
||||
</RDF:RDF>
|
|
@ -1,47 +0,0 @@
|
|||
#
|
||||
# ***** BEGIN LICENSE BLOCK *****
|
||||
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
#
|
||||
# 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 limitations under the
|
||||
# License.
|
||||
#
|
||||
# The Original Code is mozilla.org code.
|
||||
#
|
||||
# The Initial Developer of the Original Code is
|
||||
# Netscape Communications Corporation.
|
||||
# Portions created by the Initial Developer are Copyright (C) 1998
|
||||
# the Initial Developer. All Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
#
|
||||
# Alternatively, the contents of this file may be used under the terms of
|
||||
# either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
# in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
# of those above. If you wish to allow use of your version of this file only
|
||||
# under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
# use your version of this file under the terms of the MPL, indicate your
|
||||
# decision by deleting the provisions above and replace them with the notice
|
||||
# and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
# the provisions above, a recipient may use your version of this file under
|
||||
# the terms of any one of the MPL, the GPL or the LGPL.
|
||||
#
|
||||
# ***** END LICENSE BLOCK *****
|
||||
|
||||
DEPTH = ../..
|
||||
topsrcdir = @top_srcdir@
|
||||
srcdir = @srcdir@
|
||||
VPATH = @srcdir@
|
||||
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
||||
DEFINES += -DIMPL_NS_NET
|
|
@ -1,18 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
<RDF:RDF xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:chrome="http://www.mozilla.org/rdf/chrome#">
|
||||
|
||||
<!-- list all the packages being supplied -->
|
||||
<RDF:Seq about="urn:mozilla:package:root">
|
||||
<RDF:li resource="urn:mozilla:package:necko"/>
|
||||
</RDF:Seq>
|
||||
|
||||
<!-- package information -->
|
||||
<RDF:Description about="urn:mozilla:package:necko"
|
||||
chrome:displayName="Necko"
|
||||
chrome:author="mozilla.org"
|
||||
chrome:name="necko"
|
||||
#expand chrome:localeVersion="__MOZILLA_LOCALE_VERSION__">
|
||||
</RDF:Description>
|
||||
|
||||
</RDF:RDF>
|
|
@ -1,4 +0,0 @@
|
|||
#ifndef MOZ_XUL_APP
|
||||
comm.jar:
|
||||
* content/necko/contents.rdf (content/contents.rdf)
|
||||
#endif
|
|
@ -1,27 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
|
||||
#filter substitution
|
||||
|
||||
<RDF:RDF xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:chrome="http://www.mozilla.org/rdf/chrome#">
|
||||
|
||||
<!-- list all the locales being supplied by this jar -->
|
||||
<RDF:Seq about="urn:mozilla:locale:root">
|
||||
<RDF:li resource="urn:mozilla:locale:@AB_CD@"/>
|
||||
</RDF:Seq>
|
||||
|
||||
<!-- locale information -->
|
||||
<RDF:Description about="urn:mozilla:locale:@AB_CD@"
|
||||
chrome:name="@AB_CD@">
|
||||
<chrome:packages>
|
||||
<RDF:Seq about="urn:mozilla:locale:@AB_CD@:packages">
|
||||
<RDF:li resource="urn:mozilla:locale:@AB_CD@:pipnss"/>
|
||||
</RDF:Seq>
|
||||
</chrome:packages>
|
||||
</RDF:Description>
|
||||
|
||||
<!-- Version Information. State that we work only with major version of this
|
||||
package. -->
|
||||
<RDF:Description about="urn:mozilla:locale:@AB_CD@:pipnss"
|
||||
chrome:localeVersion="@MOZILLA_LOCALE_VERSION@"/>
|
||||
</RDF:RDF>
|
|
@ -1,64 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
|
||||
#filter substitution
|
||||
|
||||
<!-- ***** BEGIN LICENSE BLOCK *****
|
||||
- Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
-
|
||||
- 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 limitations under the
|
||||
- License.
|
||||
-
|
||||
- The Original Code is mozilla.org code.
|
||||
-
|
||||
- The Initial Developer of the Original Code is
|
||||
- Netscape Communications Corp.
|
||||
- Portions created by the Initial Developer are Copyright (C) 2001
|
||||
- the Initial Developer. All Rights Reserved.
|
||||
-
|
||||
- Contributor(s):
|
||||
- Terry Hayes <thayes@netscape.com>
|
||||
-
|
||||
- Alternatively, the contents of this file may be used under the terms of
|
||||
- either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
- the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
- in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
- of those above. If you wish to allow use of your version of this file only
|
||||
- under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
- use your version of this file under the terms of the MPL, indicate your
|
||||
- decision by deleting the provisions above and replace them with the notice
|
||||
- and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
- the provisions above, a recipient may use your version of this file under
|
||||
- the terms of any one of the MPL, the GPL or the LGPL.
|
||||
-
|
||||
- ***** END LICENSE BLOCK ***** -->
|
||||
|
||||
<RDF:RDF xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:chrome="http://www.mozilla.org/rdf/chrome#">
|
||||
|
||||
<!-- list all the locales being supplied by this jar -->
|
||||
<RDF:Seq about="urn:mozilla:locale:root">
|
||||
<RDF:li resource="urn:mozilla:locale:@AB_CD@"/>
|
||||
</RDF:Seq>
|
||||
|
||||
<!-- locale information -->
|
||||
<RDF:Description about="urn:mozilla:locale:@AB_CD@"
|
||||
chrome:name="@AB_CD@">
|
||||
<chrome:packages>
|
||||
<RDF:Seq about="urn:mozilla:locale:@AB_CD@:packages">
|
||||
<RDF:li resource="urn:mozilla:locale:@AB_CD@:pippki"/>
|
||||
</RDF:Seq>
|
||||
</chrome:packages>
|
||||
</RDF:Description>
|
||||
|
||||
<!-- Version Information. State that we work only with major version of this
|
||||
package. -->
|
||||
<RDF:Description about="urn:mozilla:locale:@AB_CD@:pippki"
|
||||
chrome:localeVersion="@MOZILLA_LOCALE_VERSION@"/>
|
||||
</RDF:RDF>
|
|
@ -1,72 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
<!-- ***** BEGIN LICENSE BLOCK *****
|
||||
- Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
-
|
||||
- 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 limitations under the
|
||||
- License.
|
||||
-
|
||||
- The Original Code is mozilla.org code.
|
||||
-
|
||||
- The Initial Developer of the Original Code is
|
||||
- Netscape Communications Corp.
|
||||
- Portions created by the Initial Developer are Copyright (C) 2001
|
||||
- the Initial Developer. All Rights Reserved.
|
||||
-
|
||||
- Contributor(s):
|
||||
- Terry Hayes <thayes@netscape.com>
|
||||
-
|
||||
- Alternatively, the contents of this file may be used under the terms of
|
||||
- either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
- the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
- in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
- of those above. If you wish to allow use of your version of this file only
|
||||
- under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
- use your version of this file under the terms of the MPL, indicate your
|
||||
- decision by deleting the provisions above and replace them with the notice
|
||||
- and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
- the provisions above, a recipient may use your version of this file under
|
||||
- the terms of any one of the MPL, the GPL or the LGPL.
|
||||
-
|
||||
- ***** END LICENSE BLOCK ***** -->
|
||||
|
||||
<RDF:RDF xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:chrome="http://www.mozilla.org/rdf/chrome#">
|
||||
|
||||
<!-- list all the packages being supplied by this jar -->
|
||||
<RDF:Seq about="urn:mozilla:package:root">
|
||||
<RDF:li resource="urn:mozilla:package:pippki"/>
|
||||
</RDF:Seq>
|
||||
|
||||
<!-- package information -->
|
||||
<RDF:Description about="urn:mozilla:package:pippki"
|
||||
chrome:displayName="pippki"
|
||||
chrome:author="PSM Team"
|
||||
chrome:name="pippki"
|
||||
chrome:xpcNativeWrappers="true"
|
||||
#expand chrome:localeVersion="__MOZILLA_LOCALE_VERSION__">
|
||||
</RDF:Description>
|
||||
|
||||
<!-- Declare overlay points used in this package -->
|
||||
<RDF:Seq about="urn:mozilla:overlays">
|
||||
<!-- Mozilla -->
|
||||
<RDF:li resource="chrome://communicator/content/pref/preftree.xul"/>
|
||||
<RDF:li resource="chrome://navigator/content/pageInfo.xul"/>
|
||||
</RDF:Seq>
|
||||
|
||||
<!-- Define the local overlay file(s) for each overlay point -->
|
||||
<!-- Mozilla -->
|
||||
<RDF:Seq about="chrome://communicator/content/pref/preftree.xul">
|
||||
<RDF:li>chrome://pippki/content/PrefOverlay.xul</RDF:li>
|
||||
</RDF:Seq>
|
||||
<RDF:Seq about="chrome://navigator/content/pageInfo.xul">
|
||||
<RDF:li>chrome://pippki/content/PageInfoOverlay.xul</RDF:li>
|
||||
</RDF:Seq>
|
||||
|
||||
</RDF:RDF>
|
|
@ -1,46 +0,0 @@
|
|||
#
|
||||
# ***** BEGIN LICENSE BLOCK *****
|
||||
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
#
|
||||
# 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 limitations under the
|
||||
# License.
|
||||
#
|
||||
# The Original Code is mozilla.org code.
|
||||
#
|
||||
# The Initial Developer of the Original Code is
|
||||
# Netscape Communications Corporation.
|
||||
# Portions created by the Initial Developer are Copyright (C) 1998
|
||||
# the Initial Developer. All Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
# Brian Ryner <bryner@brianryner.com>
|
||||
#
|
||||
# Alternatively, the contents of this file may be used under the terms of
|
||||
# either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
# in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
# of those above. If you wish to allow use of your version of this file only
|
||||
# under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
# use your version of this file under the terms of the MPL, indicate your
|
||||
# decision by deleting the provisions above and replace them with the notice
|
||||
# and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
# the provisions above, a recipient may use your version of this file under
|
||||
# the terms of any one of the MPL, the GPL or the LGPL.
|
||||
#
|
||||
# ***** END LICENSE BLOCK *****
|
||||
|
||||
DEPTH = ../../../..
|
||||
topsrcdir = @top_srcdir@
|
||||
srcdir = @srcdir@
|
||||
VPATH = @srcdir@
|
||||
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
<RDF:RDF xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:chrome="http://www.mozilla.org/rdf/chrome#">
|
||||
|
||||
<!-- list all the packages being supplied by this jar -->
|
||||
<RDF:Seq about="urn:mozilla:package:root">
|
||||
<RDF:li resource="urn:mozilla:package:pipnss"/>
|
||||
</RDF:Seq>
|
||||
|
||||
<!-- package information -->
|
||||
<RDF:Description about="urn:mozilla:package:pipnss"
|
||||
chrome:displayName="pipnss"
|
||||
chrome:author="PSM Team"
|
||||
chrome:name="pipnss"
|
||||
#expand chrome:localeVersion="__MOZILLA_LOCALE_VERSION__">
|
||||
</RDF:Description>
|
||||
</RDF:RDF>
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
#ifndef MOZ_XUL_APP
|
||||
pipnss.jar:
|
||||
* content/pipnss/contents.rdf (content/contents.rdf)
|
||||
#endif
|
Загрузка…
Ссылка в новой задаче