зеркало из https://github.com/mozilla/pjs.git
Get rid of appCore from sessionHistoryUI.js again, hyatt's recent changes of saving the sessionHistory object on skin switching makes this possible.
bug=46200, r=alecf, a=ben
This commit is contained in:
Родитель
7268c564ff
Коммит
0a116c7a46
|
@ -23,7 +23,7 @@
|
|||
* Peter Annema <disttsc@bart.nl>
|
||||
*
|
||||
*/
|
||||
const MAX_HISTORY_MENU_ITEMS = 15
|
||||
const MAX_HISTORY_MENU_ITEMS = 15;
|
||||
const MAX_HISTORY_ITEMS = 100;
|
||||
var rdf = Components.classes["@mozilla.org/rdf/rdf-service;1"]
|
||||
.getService(Components.interfaces.nsIRDFService);
|
||||
|
@ -37,24 +37,7 @@ function FillHistoryMenu( aParent, aMenu )
|
|||
var browserElement = document.getElementById("content");
|
||||
if (browserElement)
|
||||
{
|
||||
var foopy = { };
|
||||
var ds;
|
||||
var docShell;
|
||||
// Try to get docshell from appCore so that go/forward/back
|
||||
// menus work right after a theme switch. If fetching from
|
||||
// appCore fails use, the original method,
|
||||
if (appCore) {
|
||||
appCore.getContentDocShell(foopy);
|
||||
ds = foopy.value;
|
||||
}
|
||||
if (ds) {
|
||||
dump("Got docshell from appCOre\n");
|
||||
docShell = ds;
|
||||
}
|
||||
else
|
||||
docShell = browserElement.boxObject.QueryInterface(Components.interfaces.nsIBrowserBoxObject).docShell;
|
||||
if (docShell) {
|
||||
var webNavigation = docShell.QueryInterface(Components.interfaces.nsIWebNavigation);
|
||||
var webNavigation = browserElement.webNavigation;
|
||||
if (webNavigation)
|
||||
{
|
||||
var shistory = webNavigation.sessionHistory;
|
||||
|
@ -102,9 +85,8 @@ function FillHistoryMenu( aParent, aMenu )
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function executeUrlBarHistoryCommand( aTarget)
|
||||
function executeUrlBarHistoryCommand( aTarget )
|
||||
{
|
||||
var index = aTarget.getAttribute("index");
|
||||
var value = aTarget.getAttribute("value");
|
||||
|
@ -117,7 +99,6 @@ function executeUrlBarHistoryCommand( aTarget)
|
|||
|
||||
function createUBHistoryMenu( aParent )
|
||||
{
|
||||
var ubHistory = appCore.urlbarHistory;
|
||||
if (localstore) {
|
||||
var entries = rdfc.MakeSeq(localstore, rdf.GetResource("nc:urlbar-history")).GetElements();
|
||||
var i= MAX_HISTORY_MENU_ITEMS;
|
||||
|
@ -145,7 +126,6 @@ function createUBHistoryMenu( aParent )
|
|||
|
||||
function addToUrlbarHistory()
|
||||
{
|
||||
//var ubHistory = appCore.urlbarHistory;
|
||||
var urlToAdd = gURLBar.value;
|
||||
if (!urlToAdd)
|
||||
return;
|
||||
|
@ -192,7 +172,7 @@ function createCheckboxMenuItem( aParent, aIndex, aValue, aChecked)
|
|||
aParent.appendChild( menuitem );
|
||||
}
|
||||
|
||||
function deleteHistoryItems( aParent)
|
||||
function deleteHistoryItems(aParent)
|
||||
{
|
||||
var children = aParent.childNodes;
|
||||
for (var i = 0; i < children.length; i++ )
|
||||
|
|
Загрузка…
Ссылка в новой задаче