41110. r=sspitzer. more nsIWebshellWindow removal.

This commit is contained in:
valeski%netscape.com 2000-06-14 03:30:53 +00:00
Родитель 8c03caa216
Коммит 4491a90adc
3 изменённых файлов: 25 добавлений и 22 удалений

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

@ -22,8 +22,6 @@
#include "nsISupports.idl"
interface nsIWebShellWindow;
%{C++
#define NS_PROFILEMIGRATION_PROGID "component://netscape/profile/migration"

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

@ -53,7 +53,11 @@
#include "nsVoidArray.h"
#include "nsIWebShellWindow.h"
#include "nsIBaseWindow.h"
#include "nsIDocShell.h"
#include "nsIDocShellTreeItem.h"
#include "nsIDocShellTreeOwner.h"
#include "nsIWebBrowserChrome.h"
#include "nsIWebBrowserChrome.h"
#ifdef DEBUG_seth
@ -239,7 +243,7 @@ nsPrefMigration::GetInstance()
nsPrefMigration::nsPrefMigration() : m_prefs(0)
nsPrefMigration::nsPrefMigration()
{
NS_INIT_REFCNT();
mErrorCode = NS_OK;
@ -257,9 +261,6 @@ PRBool ProfilesToMigrateCleanup(void* aElement, void *aData)
nsPrefMigration::~nsPrefMigration()
{
if (m_prefs) {
NS_RELEASE(m_prefs);
}
mProfilesToMigrate.EnumerateForwards((nsVoidArrayEnumFunc)ProfilesToMigrateCleanup, nsnull);
}
@ -278,15 +279,12 @@ nsPrefMigration::getPrefService()
if(NS_FAILED(rv))
return rv;
rv = pIProxyObjectManager->GetProxyObject(NS_UI_THREAD_EVENTQ,
return pIProxyObjectManager->GetProxyObject(NS_UI_THREAD_EVENTQ,
NS_GET_IID(nsIPref),
pIMyService,
PROXY_SYNC,
(void**)&m_prefs);
if (NS_FAILED(rv)) return rv;
getter_AddRefs(m_prefs));
// m_prefs is good now
return NS_OK;
}
NS_IMPL_THREADSAFE_ISUPPORTS1(nsPrefMigration, nsIPrefMigration)
@ -385,10 +383,18 @@ extern "C" void ProfileMigrationController(void *data)
NS_IMETHODIMP
nsPrefMigration::WindowCloseCallback()
{
nsCOMPtr<nsIDocShell> docShell;
nsresult rv = mPMProgressWindow->GetDocShell(getter_AddRefs(docShell));
if (NS_FAILED(rv)) return rv;
nsCOMPtr<nsIWebShellWindow> progressWindow(do_QueryInterface(mPMProgressWindow));
if(progressWindow)
progressWindow->Close();
nsCOMPtr<nsIDocShellTreeItem> treeItem(do_QueryInterface(docShell));
if (treeItem) {
nsCOMPtr<nsIDocShellTreeOwner> treeOwner;
nsresult rv = treeItem->GetTreeOwner(getter_AddRefs(treeOwner));
if (NS_FAILED(rv)) return rv;
nsCOMPtr<nsIBaseWindow> baseWindow(do_QueryInterface(treeOwner));
if (baseWindow) (void)baseWindow->Destroy();
}
#ifdef DEBUG
printf("end of pref migration\n");

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

@ -141,13 +141,12 @@ class nsPrefMigration: public nsIPrefMigration
nsresult GetPremigratedFilePref(const char *pref_name, nsIFileSpec **filePath);
#endif /* NEED_TO_COPY_AND_RENAME_NEWSRC_FILES */
nsIPref* m_prefs;
nsresult getPrefService();
nsCOMPtr<nsIFileSpec> m_prefsFile;
nsCOMPtr<nsIDOMWindow> m_parentWindow;
nsIDOMWindow *m_progressWindow;
nsCOMPtr<nsIXULWindow> mPMProgressWindow;
nsCOMPtr<nsIPref> m_prefs;
nsCOMPtr<nsIFileSpec> m_prefsFile;
nsCOMPtr<nsIDOMWindow> m_parentWindow;
nsCOMPtr<nsIXULWindow> mPMProgressWindow;
};
#endif /* nsPrefMigration_h___ */