18022, bookmark doc charset caching

r=rjc, ftang, a=ftang
This commit is contained in:
jbetak%netscape.com 2006-09-14 05:50:26 +00:00
Родитель 9a311c367d
Коммит 747c513ea5
1 изменённых файлов: 12 добавлений и 2 удалений

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

@ -139,10 +139,15 @@ function UpdateBookmarksLastVisitedDate(event)
{
try
{
var wnd = document.commandDispatcher.focusedWindow;
if (window == wnd) wnd = window.content;
var docCharset = wnd.document.characterSet;
// if the URL is bookmarked, update its "Last Visited" date
var bmks = Components.classes["component://netscape/browser/bookmarks-service"].getService();
if (bmks) bmks = bmks.QueryInterface(Components.interfaces.nsIBookmarksService);
if (bmks) bmks.UpdateBookmarkLastVisitedDate(window.content.location.href);
if (bmks) bmks.UpdateBookmarkLastVisitedDate(window.content.location.href, docCharset);
}
catch(ex)
{
@ -879,12 +884,17 @@ function RevealSearchPanel()
function BrowserAddBookmark(url,title)
{
var bmks = Components.classes["component://netscape/browser/bookmarks-service"].getService();
var wnd = document.commandDispatcher.focusedWindow;
if (window == wnd) wnd = window.content;
var docCharset = wnd.document.characterSet;
bmks = bmks.QueryInterface(Components.interfaces.nsIBookmarksService);
if ((title == null) || (title == ""))
{
title = url;
}
bmks.AddBookmark(url, title, bmks.BOOKMARK_DEFAULT_TYPE);
bmks.AddBookmark(url, title, bmks.BOOKMARK_DEFAULT_TYPE, docCharset);
dump("BrowserAddBookmark: " + docCharset + "\n");
}
// Set up a lame hack to avoid opening two bookmarks.