Bug 333863 - several fixes to places behavior in non-browser windows on Mac. r=annie, sr=ben.

git-svn-id: svn://10.0.0.236/trunk@194358 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
mozilla.mano%sent.com
2006-04-13 23:07:06 +00:00
parent 9776ca9ad4
commit 9e19de5e02
3 changed files with 20 additions and 7 deletions

View File

@@ -1123,6 +1123,10 @@ function nonBrowserWindowDelayedStartup()
#ifndef MOZ_PLACES
initServices();
initBMService();
#else
var menu = document.getElementById("bookmarksMenuPopup");
menu._init();
window.controllers.appendController(PlacesController);
#endif
// init global pref service
@@ -2891,7 +2895,13 @@ function FillHistoryMenu(aParent, aMenu, aInsertBefore)
// Remove old entries if any
deleteHistoryItems(aParent);
var sessionHistory = getWebNavigation().sessionHistory;
var webNav = getWebNavigation();
if (!webNav) {
// This is always the case for non-browser windows (and the hidden window)
// on OS X
return true;
}
var sessionHistory = webNav.sessionHistory;
var count = sessionHistory.count;
var index = sessionHistory.index;

View File

@@ -48,6 +48,9 @@
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<?xml-stylesheet href="chrome://browser/content/places/places.css" type="text/css"?>
<?xml-stylesheet href="chrome://browser/skin/" type="text/css"?>
<?xul-overlay href="chrome://browser/content/baseMenuOverlay.xul"?>
# All JS files which are not content (only) dependent that browser.xul

View File

@@ -35,11 +35,11 @@
#
# ***** END LICENSE BLOCK *****
const nsIWindowDataSource = Components.interfaces.nsIWindowDataSource;
function checkFocusedWindow()
{
var windowManagerDS = Components.classes['@mozilla.org/rdf/datasource;1?name=window-mediator'].getService(nsIWindowDataSource);
var windowManagerDS =
Components.classes['@mozilla.org/rdf/datasource;1?name=window-mediator']
.getService(Components.interfaces.nsIWindowDataSource);
var sep = document.getElementById("sep-window-list");
// Using double parens to avoid warning
@@ -60,8 +60,9 @@ function toOpenWindow( aWindow )
function ShowWindowFromResource( node )
{
var windowManagerDS = Components.classes['@mozilla.org/rdf/datasource;1?name=window-mediator']
.getService(nsIWindowDataSource);
var windowManagerDS =
Components.classes['@mozilla.org/rdf/datasource;1?name=window-mediator']
.getService(Components.interfaces.nsIWindowDataSource);
var desiredWindow = null;
var url = node.getAttribute('id');
@@ -77,4 +78,3 @@ function zoomWindow()
else
window.restore();
}