fix for bug #2343 - Preferences are not initialized in the apprunner...

git-svn-id: svn://10.0.0.236/trunk@24206 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
rpotts%netscape.com
1999-03-16 07:25:43 +00:00
parent 5dcafd7b80
commit 7bbc87b3d0
2 changed files with 22 additions and 1 deletions

View File

@@ -23,6 +23,7 @@
#include "nsIComponentManager.h"
#include "nsIServiceManager.h"
#include "nsIURL.h"
#include "nsIPref.h"
#include "nsGUIEvent.h"
#include "nsWidgetsCID.h"
@@ -73,6 +74,9 @@ static NS_DEFINE_IID(kMenuBarCID, NS_MENUBAR_CID);
static NS_DEFINE_IID(kMenuCID, NS_MENU_CID);
static NS_DEFINE_IID(kMenuItemCID, NS_MENUITEM_CID);
static NS_DEFINE_CID(kPrefCID, NS_PREF_CID);
/* Define Interface IDs */
static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID);
static NS_DEFINE_IID(kIWebShellWindowIID, NS_IWEBSHELL_WINDOW_IID);
@@ -233,7 +237,23 @@ nsresult nsWebShellWindow::Initialize(nsIWidget* aParent,
if (nsnull != docLoader) {
docLoader->AddObserver((nsIDocumentLoaderObserver *)this);
}
/// webShell->SetPrefs(aPrefs);
/*
* XXX: How should preferences be supplied to the nsWebShellWindow?
* Should there be the notion of a global preferences service?
* Or should there be many preferences components based on
* the user profile...
*/
// Initialize the webshell with the preferences service
nsIPref *prefs;
rv = nsServiceManager::GetService(kPrefCID,
nsIPref::GetIID(),
(nsISupports **)&prefs);
if (NS_SUCCEEDED(rv)) {
mWebShell->SetPrefs(prefs);
nsServiceManager::ReleaseService(kPrefCID, prefs);
}
NS_IF_RELEASE(mCallbacks);
mCallbacks = aCallbacks;