webBrowser now depends on the docShell implementing nsIWebProgress interface. It now passes all the work on to it as well.
git-svn-id: svn://10.0.0.236/trunk@62896 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
3412dcc6dc
commit
c0147da47d
@ -433,105 +433,54 @@ NS_IMETHODIMP nsWebBrowser::GetSessionHistory(nsISHistory** aSessionHistory)
|
|||||||
//*****************************************************************************
|
//*****************************************************************************
|
||||||
|
|
||||||
NS_IMETHODIMP nsWebBrowser::AddProgressListener(nsIWebProgressListener* aListener,
|
NS_IMETHODIMP nsWebBrowser::AddProgressListener(nsIWebProgressListener* aListener,
|
||||||
PRInt32* cookie)
|
PRInt32* aCookie)
|
||||||
{
|
{
|
||||||
//XXXTAB First Check
|
NS_ENSURE_STATE(mDocShell);
|
||||||
/*
|
|
||||||
Registers a listener to be notified of Progress Events
|
return mDocShellAsProgress->AddProgressListener(aListener, aCookie);
|
||||||
|
|
||||||
@param listener - The listener interface to be called when a progress event
|
|
||||||
occurs.
|
|
||||||
|
|
||||||
@param cookie - This is an optional parameter to receieve a cookie to use
|
|
||||||
to unregister rather than the original interface pointer. This may
|
|
||||||
be nsnull.
|
|
||||||
|
|
||||||
@return NS_OK - Listener was registered successfully.
|
|
||||||
NS_INVALID_ARG - The listener passed in was either nsnull,
|
|
||||||
or was already registered with this progress interface.
|
|
||||||
*/
|
|
||||||
return NS_ERROR_FAILURE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_IMETHODIMP nsWebBrowser::RemoveProgressListener(nsIWebProgressListener* listener,
|
NS_IMETHODIMP nsWebBrowser::RemoveProgressListener(nsIWebProgressListener* aListener,
|
||||||
PRInt32 cookie)
|
PRInt32 aCookie)
|
||||||
{
|
{
|
||||||
//XXXTAB First Check
|
NS_ENSURE_STATE(mDocShell);
|
||||||
//XXX First Check
|
|
||||||
/*
|
|
||||||
Removes a previously registered listener of Progress Events
|
|
||||||
|
|
||||||
@param listener - The listener interface previously registered with
|
|
||||||
AddListener() this may be nsnull if a valid cookie is provided.
|
|
||||||
|
|
||||||
@param cookie - A cookie that was returned from a previously called
|
return mDocShellAsProgress->RemoveProgressListener(aListener, aCookie);
|
||||||
AddListener() call. This may be nsnull if a valid listener interface
|
|
||||||
is passed in.
|
|
||||||
|
|
||||||
@return NS_OK - Listener was successfully unregistered.
|
|
||||||
NS_ERROR_INVALID_ARG - Neither the cookie nor the listener point
|
|
||||||
to a previously registered listener.
|
|
||||||
*/
|
|
||||||
return NS_ERROR_FAILURE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_IMETHODIMP nsWebBrowser::GetProgressStatusFlags(PRInt32* aProgressStatusFlags)
|
NS_IMETHODIMP nsWebBrowser::GetProgressStatusFlags(PRInt32* aProgressStatusFlags)
|
||||||
{
|
{
|
||||||
//XXXTAB First Check
|
NS_ENSURE_STATE(mDocShell);
|
||||||
//XXX First Check
|
|
||||||
/*
|
return mDocShellAsProgress->GetProgressStatusFlags(aProgressStatusFlags);
|
||||||
Current connection Status of the browser. This will be one of the enumerated
|
|
||||||
connection progress steps.
|
|
||||||
*/
|
|
||||||
return NS_ERROR_FAILURE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_IMETHODIMP nsWebBrowser::GetCurSelfProgress(PRInt32* curSelfProgress)
|
NS_IMETHODIMP nsWebBrowser::GetCurSelfProgress(PRInt32* aCurSelfProgress)
|
||||||
{
|
{
|
||||||
//XXXTAB First Check
|
NS_ENSURE_STATE(mDocShell);
|
||||||
//XXX First Check
|
|
||||||
/*
|
return mDocShellAsProgress->GetCurSelfProgress(aCurSelfProgress);
|
||||||
The current position of progress. This is between 0 and maxSelfProgress.
|
|
||||||
This is the position of only this progress object. It doesn not include
|
|
||||||
the progress of all children.
|
|
||||||
*/
|
|
||||||
return NS_ERROR_FAILURE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_IMETHODIMP nsWebBrowser::GetMaxSelfProgress(PRInt32* maxSelfProgress)
|
NS_IMETHODIMP nsWebBrowser::GetMaxSelfProgress(PRInt32* aMaxSelfProgress)
|
||||||
{
|
{
|
||||||
//XXXTAB First Check
|
NS_ENSURE_STATE(mDocShell);
|
||||||
//XXX First Check
|
|
||||||
/*
|
return mDocShellAsProgress->GetMaxSelfProgress(aMaxSelfProgress);
|
||||||
The maximum position that progress will go to. This sets a relative
|
|
||||||
position point for the current progress to relate to. This is the max
|
|
||||||
position of only this progress object. It does not include the progress of
|
|
||||||
all the children.
|
|
||||||
*/
|
|
||||||
return NS_ERROR_FAILURE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_IMETHODIMP nsWebBrowser::GetCurTotalProgress(PRInt32* curTotalProgress)
|
NS_IMETHODIMP nsWebBrowser::GetCurTotalProgress(PRInt32* aCurTotalProgress)
|
||||||
{
|
{
|
||||||
//XXXTAB First Check
|
NS_ENSURE_STATE(mDocShell);
|
||||||
//XXX First Check
|
|
||||||
/*
|
return mDocShellAsProgress->GetCurTotalProgress(aCurTotalProgress);
|
||||||
The current position of progress for this object and all children added
|
|
||||||
together. This is between 0 and maxTotalProgress.
|
|
||||||
*/
|
|
||||||
return NS_ERROR_FAILURE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_IMETHODIMP nsWebBrowser::GetMaxTotalProgress(PRInt32* maxTotalProgress)
|
NS_IMETHODIMP nsWebBrowser::GetMaxTotalProgress(PRInt32* aMaxTotalProgress)
|
||||||
{
|
{
|
||||||
//XXXTAB First Check
|
NS_ENSURE_STATE(mDocShell);
|
||||||
//XXX First Check
|
|
||||||
/*
|
return mDocShellAsProgress->GetMaxTotalProgress(aMaxTotalProgress);
|
||||||
The maximum position that progress will go to for the max of this progress
|
|
||||||
object and all children. This sets the relative position point for the
|
|
||||||
current progress to relate to.
|
|
||||||
*/
|
|
||||||
return NS_ERROR_FAILURE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//*****************************************************************************
|
//*****************************************************************************
|
||||||
@ -1017,16 +966,18 @@ NS_IMETHODIMP nsWebBrowser::SetDocShell(nsIDocShell* aDocShell)
|
|||||||
nsCOMPtr<nsIBaseWindow> baseWin(do_QueryInterface(aDocShell));
|
nsCOMPtr<nsIBaseWindow> baseWin(do_QueryInterface(aDocShell));
|
||||||
nsCOMPtr<nsIDocShellTreeItem> item(do_QueryInterface(aDocShell));
|
nsCOMPtr<nsIDocShellTreeItem> item(do_QueryInterface(aDocShell));
|
||||||
nsCOMPtr<nsIWebNavigation> nav(do_QueryInterface(aDocShell));
|
nsCOMPtr<nsIWebNavigation> nav(do_QueryInterface(aDocShell));
|
||||||
|
nsCOMPtr<nsIWebProgress> progress(do_QueryInterface(aDocShell));
|
||||||
nsCOMPtr<nsIScrollable> scrollable(do_QueryInterface(aDocShell));
|
nsCOMPtr<nsIScrollable> scrollable(do_QueryInterface(aDocShell));
|
||||||
nsCOMPtr<nsITextScroll> textScroll(do_QueryInterface(aDocShell));
|
nsCOMPtr<nsITextScroll> textScroll(do_QueryInterface(aDocShell));
|
||||||
NS_ENSURE_TRUE(req && baseWin && item && nav && scrollable && textScroll,
|
NS_ENSURE_TRUE(req && baseWin && item && nav && scrollable && textScroll &&
|
||||||
NS_ERROR_FAILURE);
|
progress, NS_ERROR_FAILURE);
|
||||||
|
|
||||||
mDocShell = aDocShell;
|
mDocShell = aDocShell;
|
||||||
mDocShellAsReq = req;
|
mDocShellAsReq = req;
|
||||||
mDocShellAsWin = baseWin;
|
mDocShellAsWin = baseWin;
|
||||||
mDocShellAsItem = item;
|
mDocShellAsItem = item;
|
||||||
mDocShellAsNav = nav;
|
mDocShellAsNav = nav;
|
||||||
|
mDocShellAsProgress = progress;
|
||||||
mDocShellAsScrollable = scrollable;
|
mDocShellAsScrollable = scrollable;
|
||||||
mDocShellAsTextScroll = textScroll;
|
mDocShellAsTextScroll = textScroll;
|
||||||
}
|
}
|
||||||
@ -1039,6 +990,7 @@ NS_IMETHODIMP nsWebBrowser::SetDocShell(nsIDocShell* aDocShell)
|
|||||||
mDocShellAsWin = nsnull;
|
mDocShellAsWin = nsnull;
|
||||||
mDocShellAsItem = nsnull;
|
mDocShellAsItem = nsnull;
|
||||||
mDocShellAsNav = nsnull;
|
mDocShellAsNav = nsnull;
|
||||||
|
mDocShellAsProgress = nsnull;
|
||||||
mDocShellAsScrollable = nsnull;
|
mDocShellAsScrollable = nsnull;
|
||||||
mDocShellAsTextScroll = nsnull;
|
mDocShellAsTextScroll = nsnull;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -98,7 +98,8 @@ protected:
|
|||||||
nsCOMPtr<nsIInterfaceRequestor> mDocShellAsReq;
|
nsCOMPtr<nsIInterfaceRequestor> mDocShellAsReq;
|
||||||
nsCOMPtr<nsIBaseWindow> mDocShellAsWin;
|
nsCOMPtr<nsIBaseWindow> mDocShellAsWin;
|
||||||
nsCOMPtr<nsIDocShellTreeItem> mDocShellAsItem;
|
nsCOMPtr<nsIDocShellTreeItem> mDocShellAsItem;
|
||||||
nsCOMPtr<nsIWebNavigation> mDocShellAsNav;
|
nsCOMPtr<nsIWebNavigation> mDocShellAsNav;
|
||||||
|
nsCOMPtr<nsIWebProgress> mDocShellAsProgress;
|
||||||
nsCOMPtr<nsIScrollable> mDocShellAsScrollable;
|
nsCOMPtr<nsIScrollable> mDocShellAsScrollable;
|
||||||
nsCOMPtr<nsITextScroll> mDocShellAsTextScroll;
|
nsCOMPtr<nsITextScroll> mDocShellAsTextScroll;
|
||||||
nsCOMPtr<nsIWidget> mInternalWidget;
|
nsCOMPtr<nsIWidget> mInternalWidget;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user