зеркало из https://github.com/mozilla/pjs.git
Remove global history; move to webshell.
This commit is contained in:
Родитель
9d36bc350c
Коммит
732f94e884
|
@ -156,7 +156,6 @@ nsBrowserAppCore::nsBrowserAppCore()
|
||||||
mWebShellWin = nsnull;
|
mWebShellWin = nsnull;
|
||||||
mWebShell = nsnull;
|
mWebShell = nsnull;
|
||||||
mContentAreaWebShell = nsnull;
|
mContentAreaWebShell = nsnull;
|
||||||
mGHistory = nsnull;
|
|
||||||
mSHistory = nsnull;
|
mSHistory = nsnull;
|
||||||
IncInstanceCount();
|
IncInstanceCount();
|
||||||
NS_INIT_REFCNT();
|
NS_INIT_REFCNT();
|
||||||
|
@ -173,11 +172,6 @@ nsBrowserAppCore::~nsBrowserAppCore()
|
||||||
//NS_IF_RELEASE(mWebShellWin);
|
//NS_IF_RELEASE(mWebShellWin);
|
||||||
//NS_IF_RELEASE(mWebShell);
|
//NS_IF_RELEASE(mWebShell);
|
||||||
//NS_IF_RELEASE(mContentAreaWebShell);
|
//NS_IF_RELEASE(mContentAreaWebShell);
|
||||||
|
|
||||||
if (nsnull != mGHistory) {
|
|
||||||
nsServiceManager::ReleaseService(kCGlobalHistoryCID, mGHistory);
|
|
||||||
}
|
|
||||||
|
|
||||||
NS_IF_RELEASE(mSHistory);
|
NS_IF_RELEASE(mSHistory);
|
||||||
|
|
||||||
DecInstanceCount();
|
DecInstanceCount();
|
||||||
|
@ -303,11 +297,6 @@ nsBrowserAppCore::Init(const nsString& aId)
|
||||||
nsServiceManager::ReleaseService(kAppCoresManagerCID, appCoreManager);
|
nsServiceManager::ReleaseService(kAppCoresManagerCID, appCoreManager);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get the Global history service
|
|
||||||
rv = nsServiceManager::GetService(kCGlobalHistoryCID, kIGlobalHistoryIID,
|
|
||||||
(nsISupports **)&mGHistory);
|
|
||||||
if (NS_FAILED(rv)) return rv;
|
|
||||||
|
|
||||||
rv = nsComponentManager::CreateInstance(kCSessionHistoryCID,
|
rv = nsComponentManager::CreateInstance(kCSessionHistoryCID,
|
||||||
nsnull,
|
nsnull,
|
||||||
kISessionHistoryIID,
|
kISessionHistoryIID,
|
||||||
|
@ -1195,24 +1184,6 @@ nsBrowserAppCore::OnEndDocumentLoad(nsIDocumentLoader* aLoader, nsIURI *aUrl, PR
|
||||||
// XXX Ignore rv for now. They are using nsIEnumerator instead of
|
// XXX Ignore rv for now. They are using nsIEnumerator instead of
|
||||||
// nsISimpleEnumerator.
|
// nsISimpleEnumerator.
|
||||||
|
|
||||||
// Update global history.
|
|
||||||
//NS_ASSERTION(mGHistory != nsnull, "history not initialized");
|
|
||||||
if (mGHistory && mWebShell) {
|
|
||||||
nsresult rv;
|
|
||||||
|
|
||||||
do {
|
|
||||||
rv = mGHistory->AddPage(url, /* XXX referrer? */ nsnull, PR_Now());
|
|
||||||
if (NS_FAILED(rv)) break;
|
|
||||||
|
|
||||||
const PRUnichar* title;
|
|
||||||
rv = mWebShell->GetTitle(&title);
|
|
||||||
if (NS_FAILED(rv)) break;
|
|
||||||
|
|
||||||
rv = mGHistory->SetPageTitle(url, title);
|
|
||||||
if (NS_FAILED(rv)) break;
|
|
||||||
} while (0);
|
|
||||||
}
|
|
||||||
|
|
||||||
done:
|
done:
|
||||||
// Stop the throbber and set the urlbar string
|
// Stop the throbber and set the urlbar string
|
||||||
if (aStatus == NS_OK)
|
if (aStatus == NS_OK)
|
||||||
|
@ -1703,11 +1674,6 @@ nsBrowserAppCore::Close()
|
||||||
{
|
{
|
||||||
EndObserving();
|
EndObserving();
|
||||||
|
|
||||||
if (nsnull != mGHistory) {
|
|
||||||
nsServiceManager::ReleaseService(kCGlobalHistoryCID, mGHistory);
|
|
||||||
}
|
|
||||||
mGHistory = nsnull;
|
|
||||||
|
|
||||||
// Undo other stuff we did in SetContentWindow.
|
// Undo other stuff we did in SetContentWindow.
|
||||||
if ( mContentAreaWebShell ) {
|
if ( mContentAreaWebShell ) {
|
||||||
mContentAreaWebShell->SetDocLoaderObserver( 0 );
|
mContentAreaWebShell->SetDocLoaderObserver( 0 );
|
||||||
|
|
|
@ -42,7 +42,6 @@ class nsIScriptContext;
|
||||||
class nsIDOMWindow;
|
class nsIDOMWindow;
|
||||||
class nsIURI;
|
class nsIURI;
|
||||||
class nsIWebShellWindow;
|
class nsIWebShellWindow;
|
||||||
class nsIGlobalHistory;
|
|
||||||
class nsIFindComponent;
|
class nsIFindComponent;
|
||||||
|
|
||||||
|
|
||||||
|
@ -216,7 +215,6 @@ class nsBrowserAppCore : public nsBaseAppCore,
|
||||||
nsIWebShell * mWebShell; // weak reference
|
nsIWebShell * mWebShell; // weak reference
|
||||||
nsIWebShell * mContentAreaWebShell; // weak reference
|
nsIWebShell * mContentAreaWebShell; // weak reference
|
||||||
|
|
||||||
nsIGlobalHistory* mGHistory; // this is a service
|
|
||||||
nsISessionHistory* mSHistory; // this is a service
|
nsISessionHistory* mSHistory; // this is a service
|
||||||
|
|
||||||
nsCOMPtr<nsISupports> mSearchContext; // at last, something we really own
|
nsCOMPtr<nsISupports> mSearchContext; // at last, something we really own
|
||||||
|
|
Загрузка…
Ссылка в новой задаче