Index: mozilla/modules/libpref/src/init/all.js
===================================================================
RCS file: /cvsroot/mozilla/modules/libpref/src/init/all.js,v
retrieving revision 3.532
diff -u -8 -p -r3.532 all.js
--- mozilla/modules/libpref/src/init/all.js 9 Jul 2004 22:02:10 -0000 3.532
+++ mozilla/modules/libpref/src/init/all.js 30 Jul 2004 20:11:52 -0000
@@ -824,16 +824,28 @@ pref("config.use_system_prefs.accessibil
*/
//pref("editor.encode_entity", "html");
pref("editor.resizing.preserve_ratio", true);
pref("editor.positioning.offset", 0);
pref("dom.max_script_run_time", 5);
+// enables clear cache at shutdown
+
+pref("browser.shutdown.clear_cache", true);
+
+// enables clear history at shutdown
+
+pref("browser.shutdown.clear_history", false);
+
+// enables clear location bar history at shutdown
+
+pref("browser.shutdown.clear_location_bar", false);
+
#ifdef XP_WIN
pref("font.name.serif.ar", "Times New Roman");
pref("font.name.sans-serif.ar", "Arial");
pref("font.name.monospace.ar", "Courier New");
pref("font.name.cursive.ar", "Comic Sans MS");
pref("font.name.serif.el", "Times New Roman");
pref("font.name.sans-serif.el", "Arial");
@@ -848,17 +860,17 @@ pref("font.name-list.serif.he", "Narkisi
pref("font.name-list.monospace.he", "Fixed Miriam Transparent, Miriam Fixed, Rod, Courier New");
pref("font.name-list.cursive.he", "Gutmann Yad, Ktav, Arial");
// For CJK fonts, we list a font twice in name-list, once in the native script and once in English
// because the name of a CJK font returned by Win32 API is beyond our control and depends on
// whether or not Mozilla is run on CJK Win 9x/ME or Win 2k/XP with a CJK locale.
// (see bug 227815)
-pref("font.name.serif.ja", "MS P明朝"); // "MS PMincho"
+pref("font.name.serif.ja", "MS P朝"); // "MS PMincho"
pref("font.name.sans-serif.ja", "MS Pゴシック"); // "MS PGothic"
pref("font.name.monospace.ja", "MS ゴシック"); // "MS Gothic"
pref("font.name-list.serif.ja", "MS PMincho, MS P明朝, MS Mincho, MS PGothic, MS Gothic");
pref("font.name-list.sans-serif.ja", "MS PGothic, MS Pゴシック, MS Gothic, MS PMincho, MS Mincho");
pref("font.name-list.monospace.ja", "MS Gothic, MS ゴシック, MS Mincho, MS 明朝, MS PGothic, MS PMincho");
pref("font.name.serif.ko", "바탕"); // "Batang"
pref("font.name.sans-serif.ko", "굴림"); // "Gulim"
Index: mozilla/xpfe/browser/resources/content/navigator.js
===================================================================
RCS file: /cvsroot/mozilla/xpfe/browser/resources/content/navigator.js,v
retrieving revision 1.543
diff -u -8 -p -r1.543 navigator.js
--- mozilla/xpfe/browser/resources/content/navigator.js 24 Jun 2004 23:44:03 -0000 1.543
+++ mozilla/xpfe/browser/resources/content/navigator.js 30 Jul 2004 20:15:48 -0000
@@ -198,16 +198,24 @@ const gPopupPrefListener =
if (browsers[i].popupDomain in hosts) {
browsers[i].popupDomain = null;
popupIcon.hidden = true;
}
}
}
}
};
+// Variable used for to Cache at Shutdown
+const kClearCache = "browser.shutdown.clear_cache";
+
+// Variable used for Clear History at Shutdown
+const kClearHistory = "browser.shutdown.clear_history";
+
+// Variable used for Clear Location Bar History at Shutdown
+const kClearLocationBar = "browser.shutdown.clear_location_bar";
/**
* Pref listener handler functions.
* Both functions assume that observer.domain is set to
* the pref domain we want to start/stop listening to.
*/
function addPrefListener(observer)
{
@@ -735,16 +743,40 @@ function Shutdown()
}
controllers.removeController(BookmarksMenuController);
window.XULBrowserWindow.destroy();
window.XULBrowserWindow = null;
BrowserFlushBookmarksAndHistory();
+ // Clear Cache at Shutdown
+ var gClearCache = pref.getBoolPref(kClearCache);
+
+ if (gClearCache)
+ {
+ prefClearDiskAndMemCache();
+ }
+
+ // Clear History at Shutdown
+ var gClearHistory = pref.getBoolPref(kClearHistory);
+
+ if (gClearHistory)
+ {
+ prefClearGlobalHistory();
+ }
+
+ // Clear Location Bar History at Shutdown
+ var gClearLocationBar = pref.getBoolPref(kClearLocationBar);
+
+ if (gClearLocationBar)
+ {
+ prefClearUrlbarHistory();
+ }
+
// unregister us as a pref listener
removePrefListener(gButtonPrefListener);
removePrefListener(gTabStripPrefListener);
removePrefListener(gHomepagePrefListener);
removePopupPermListener(gPopupPermListener);
removePrefListener(gPopupPrefListener);
window.browserContentListener.close();
@@ -2501,8 +2533,54 @@ function updateFileUploadItem()
} catch (e) {}
var item = document.getElementById('Browser:UploadFile');
if (canUpload)
item.removeAttribute('disabled');
else
item.setAttribute('disabled', 'true');
}
+
+// Needed to clear Disk and Memory Cache - Taken from pref-cache.js
+function prefClearCache(aType)
+{
+ var classID = Components.classes["@mozilla.org/network/cache-service;1"];
+ var cacheService = classID.getService(Components.interfaces.nsICacheService);
+ cacheService.evictEntries(aType);
+}
+
+// Needed to clear Disk and Memory Cache - Taken from pref-cache.js
+function prefClearDiskAndMemCache()
+{
+ prefClearCache(Components.interfaces.nsICache.STORE_ON_DISK);
+ prefClearCache(Components.interfaces.nsICache.STORE_IN_MEMORY);
+}
+
+// Needed to clear History - Taken from pref-history.xul
+function prefClearGlobalHistory()
+{
+ var globalHistory = Components.classes["@mozilla.org/browser/global-history;2"]
+ .getService(Components.interfaces.nsIBrowserHistory);
+ globalHistory.removeAllPages();
+}
+
+// Needed to clear all Location Bar History - Taken from pref-history.xul
+function prefClearUrlbarHistory()
+{
+ var pref = Components.classes["@mozilla.org/preferences-service;1"]
+ .getService(Components.interfaces.nsIPrefBranch);
+ pref.setCharPref("general.open_location.last_url", "");
+ var RDF = Components.classes["@mozilla.org/rdf/rdf-service;1"]
+ .getService(Components.interfaces.nsIRDFService);
+ var localStore = RDF.GetDataSource("rdf:local-store");
+ var RDFC = Components.classes["@mozilla.org/rdf/container-utils;1"]
+ .getService(Components.interfaces.nsIRDFContainerUtils);
+ var urlBarHist = RDFC.MakeSeq(localStore, RDF.GetResource("nc:urlbar-history"));
+ for (var i = urlBarHist.GetCount(); i > 0; --i)
+ urlBarHist.RemoveElementAt(i, true);
+}
+
+// Needed to clear all History at once
+function prefClearAllHistory()
+{
+ prefClearGlobalHistory();
+ prefClearUrlbarHistory();
+}
Index: mozilla/xpfe/browser/resources/content/navigator.xul
===================================================================
RCS file: /cvsroot/mozilla/xpfe/browser/resources/content/navigator.xul,v
retrieving revision 1.420
diff -u -8 -p -r1.420 navigator.xul
--- mozilla/xpfe/browser/resources/content/navigator.xul 20 Jul 2004 10:27:24 -0000 1.420
+++ mozilla/xpfe/browser/resources/content/navigator.xul 30 Jul 2004 20:15:49 -0000
@@ -89,16 +89,22 @@
+
+
+
+
+
@@ -159,19 +165,23 @@
+
Index: mozilla/xpfe/components/prefwindow/resources/content/pref-cache.xul
===================================================================
RCS file: /cvsroot/mozilla/xpfe/components/prefwindow/resources/content/pref-cache.xul,v
retrieving revision 1.58
diff -u -8 -p -r1.58 pref-cache.xul
--- mozilla/xpfe/components/prefwindow/resources/content/pref-cache.xul 17 Apr 2004 16:51:27 -0000 1.58
+++ mozilla/xpfe/components/prefwindow/resources/content/pref-cache.xul 30 Jul 2004 20:15:52 -0000
@@ -47,17 +47,18 @@
]>
&historyPages.label;
@@ -125,10 +134,21 @@
&clearLocationBar.label;
-
+
+
+
+
+ &enableClear.label;
+
+
+
+
+
Index: mozilla/xpfe/components/prefwindow/resources/locale/en-US/pref-cache.dtd
===================================================================
RCS file: /cvsroot/mozilla/xpfe/components/prefwindow/resources/locale/en-US/pref-cache.dtd,v
retrieving revision 1.22
diff -u -8 -p -r1.22 pref-cache.dtd
--- mozilla/xpfe/components/prefwindow/resources/locale/en-US/pref-cache.dtd 18 Apr 2003 02:15:44 -0000 1.22
+++ mozilla/xpfe/components/prefwindow/resources/locale/en-US/pref-cache.dtd 30 Jul 2004 20:15:53 -0000
@@ -25,8 +25,12 @@
+
+
+
+
Index: mozilla/xpfe/components/prefwindow/resources/locale/en-US/pref-history.dtd
===================================================================
RCS file: /cvsroot/mozilla/xpfe/components/prefwindow/resources/locale/en-US/pref-history.dtd,v
retrieving revision 1.10
diff -u -8 -p -r1.10 pref-history.dtd
--- mozilla/xpfe/components/prefwindow/resources/locale/en-US/pref-history.dtd 24 Feb 2003 07:58:50 -0000 1.10
+++ mozilla/xpfe/components/prefwindow/resources/locale/en-US/pref-history.dtd 30 Jul 2004 20:15:53 -0000
@@ -7,9 +7,16 @@
-
\ No newline at end of file
+
+
+
+
+
+
+
+