bug #46856 (r=valeski, sr=darin). API Changes to nsIWebProgress/nsIWebProgressListener)

This commit is contained in:
rpotts%netscape.com 2002-05-16 20:57:37 +00:00
Родитель 1b19de50f9
Коммит 4d4116d281
71 изменённых файлов: 785 добавлений и 1447 удалений

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

@ -456,12 +456,12 @@ NS_IMETHODIMP nsRootAccessible::AddAccessibleEventListener(nsIAccessibleEventLis
nsCOMPtr<nsIDocShell> docShell(do_QueryInterface(container));
if (docShell) {
mWebProgress = do_GetInterface(docShell);
mWebProgress->AddProgressListener(this);
mWebProgress->AddProgressListener(this, nsIWebProgress::NOTIFY_LOCATION |
nsIWebProgress::NOTIFY_STATE_DOCUMENT);
}
}
}
NS_ASSERTION(mWebProgress, "Could not get nsIWebProgress for nsRootAccessible");
mWebProgress->AddProgressListener(this);
}
return NS_OK;
@ -704,7 +704,7 @@ NS_IMETHODIMP nsRootAccessible::GetDocument(nsIDocument **doc)
}
NS_IMETHODIMP nsRootAccessible::OnStateChange(nsIWebProgress *aWebProgress,
nsIRequest *aRequest, PRInt32 aStateFlags, PRUint32 aStatus)
nsIRequest *aRequest, PRUint32 aStateFlags, nsresult aStatus)
{
if ((aStateFlags & STATE_IS_DOCUMENT) && (aStateFlags & STATE_STOP)) {
// Set up scroll position listener
@ -730,6 +730,7 @@ NS_IMETHODIMP nsRootAccessible::OnProgressChange(nsIWebProgress *aWebProgress,
nsIRequest *aRequest, PRInt32 aCurSelfProgress, PRInt32 aMaxSelfProgress,
PRInt32 aCurTotalProgress, PRInt32 aMaxTotalProgress)
{
NS_NOTREACHED("notification excluded in AddProgressListener(...)");
return NS_OK;
}
@ -765,13 +766,15 @@ NS_IMETHODIMP nsRootAccessible::OnLocationChange(nsIWebProgress *aWebProgress,
NS_IMETHODIMP nsRootAccessible::OnStatusChange(nsIWebProgress *aWebProgress,
nsIRequest *aRequest, nsresult aStatus, const PRUnichar *aMessage)
{
NS_NOTREACHED("notification excluded in AddProgressListener(...)");
return NS_OK;
}
/* void onSecurityChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in long state); */
/* void onSecurityChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in unsigned long state); */
NS_IMETHODIMP nsRootAccessible::OnSecurityChange(nsIWebProgress *aWebProgress,
nsIRequest *aRequest, PRInt32 state)
nsIRequest *aRequest, PRUint32 state)
{
NS_NOTREACHED("notification excluded in AddProgressListener(...)");
return NS_OK;
}

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

@ -793,7 +793,7 @@ nsHTMLFormElement::DoSubmit(nsIPresContext* aPresContext, nsEvent* aEvent)
if (docShell) {
nsCOMPtr<nsIWebProgress> webProgress = do_GetInterface(docShell);
NS_ASSERTION(webProgress, "nsIDocShell not converted to nsIWebProgress!");
rv = webProgress->AddProgressListener(this);
rv = webProgress->AddProgressListener(this, nsIWebProgress::NOTIFY_STATE_ALL);
NS_ENSURE_SUBMIT_SUCCESS(rv);
}
else {
@ -1204,7 +1204,7 @@ nsHTMLFormElement::GetLength(PRInt32* aLength)
NS_IMETHODIMP
nsHTMLFormElement::OnStateChange(nsIWebProgress* aWebProgress,
nsIRequest* aRequest,
PRInt32 aStateFlags,
PRUint32 aStateFlags,
PRUint32 aStatus)
{
// If STATE_STOP is never fired for any reason (redirect? Failed state
@ -1229,6 +1229,7 @@ nsHTMLFormElement::OnProgressChange(nsIWebProgress* aWebProgress,
PRInt32 aCurTotalProgress,
PRInt32 aMaxTotalProgress)
{
NS_NOTREACHED("notification excluded in AddProgressListener(...)");
return NS_OK;
}
@ -1237,6 +1238,7 @@ nsHTMLFormElement::OnLocationChange(nsIWebProgress* aWebProgress,
nsIRequest* aRequest,
nsIURI* location)
{
NS_NOTREACHED("notification excluded in AddProgressListener(...)");
return NS_OK;
}
@ -1246,14 +1248,16 @@ nsHTMLFormElement::OnStatusChange(nsIWebProgress* aWebProgress,
nsresult aStatus,
const PRUnichar* aMessage)
{
NS_NOTREACHED("notification excluded in AddProgressListener(...)");
return NS_OK;
}
NS_IMETHODIMP
nsHTMLFormElement::OnSecurityChange(nsIWebProgress* aWebProgress,
nsIRequest* aRequest,
PRInt32 state)
PRUint32 state)
{
NS_NOTREACHED("notification excluded in AddProgressListener(...)");
return NS_OK;
}

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

@ -1861,7 +1861,8 @@ nsDocShell::SetTreeOwner(nsIDocShellTreeOwner * aTreeOwner)
}
if (newListener) {
webProgress->AddProgressListener(newListener);
webProgress->AddProgressListener(newListener,
nsIWebProgress::NOTIFY_ALL);
}
}
}
@ -3812,7 +3813,7 @@ nsDocShell::OnProgressChange(nsIWebProgress * aProgress,
NS_IMETHODIMP
nsDocShell::OnStateChange(nsIWebProgress * aProgress, nsIRequest * aRequest,
PRInt32 aStateFlags, nsresult aStatus)
PRUint32 aStateFlags, nsresult aStatus)
{
nsresult rv;
@ -3865,14 +3866,11 @@ nsDocShell::OnStateChange(nsIWebProgress * aProgress, nsIRequest * aRequest,
mainWidget->SetCursor(eCursor_standard);
}
}
if ((~aStateFlags & (STATE_IS_DOCUMENT | STATE_STOP)) == 0) {
nsCOMPtr<nsIWebProgress> webProgress(do_QueryInterface(mLoadCookie));
// Is the document stop notification for this document?
if (aProgress == webProgress.get()) {
nsCOMPtr<nsIChannel> channel(do_QueryInterface(aRequest));
EndPageLoad(aProgress, channel, aStatus);
}
}
@ -3919,6 +3917,7 @@ NS_IMETHODIMP
nsDocShell::OnLocationChange(nsIWebProgress * aProgress,
nsIRequest * aRequest, nsIURI * aURI)
{
NS_NOTREACHED("notification excluded in AddProgressListener(...)");
return NS_OK;
}
@ -3927,14 +3926,16 @@ nsDocShell::OnStatusChange(nsIWebProgress * aWebProgress,
nsIRequest * aRequest,
nsresult aStatus, const PRUnichar * aMessage)
{
NS_NOTREACHED("notification excluded in AddProgressListener(...)");
return NS_OK;
}
NS_IMETHODIMP
nsDocShell::OnSecurityChange(nsIWebProgress * aWebProgress,
nsIRequest * aRequest, PRInt32 state)
nsIRequest * aRequest, PRUint32 state)
{
return NS_ERROR_NOT_IMPLEMENTED;
NS_NOTREACHED("notification excluded in AddProgressListener(...)");
return NS_OK;
}
@ -6053,7 +6054,9 @@ nsDocShell::SetLoadCookie(nsISupports * aCookie)
nsCOMPtr<nsIWebProgress> webProgress(do_QueryInterface(mLoadCookie));
if (webProgress) {
webProgress->AddProgressListener(this);
webProgress->AddProgressListener(this,
nsIWebProgress::NOTIFY_STATE_DOCUMENT |
nsIWebProgress::NOTIFY_STATE_NETWORK);
}
nsCOMPtr<nsILoadGroup> loadGroup(do_GetInterface(mLoadCookie));

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

@ -1,681 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Simon Fraser <sfraser@netscape.com>
*
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the NPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include "nsIDOMWindow.h"
#include "nsIDOMWindowInternal.h"
#include "nsIDOMDocument.h"
#include "nsIScriptGlobalObject.h"
#include "nsISelectionPrivate.h"
#include "nsITransactionManager.h"
#include "nsIEditorDocShell.h"
#include "nsIChannel.h"
#include "nsIWebProgress.h"
#include "nsIControllers.h"
#include "nsIController.h"
#include "nsIEditorController.h"
#include "nsIPresShell.h"
#include "nsComposerCommandsUpdater.h"
#include "nsEditingSession.h"
#include "nsIComponentManager.h"
#include "nsIInterfaceRequestor.h"
#include "nsIInterfaceRequestorUtils.h"
#if DEBUG
#define NOISY_DOC_LOADING 1
#endif
/*---------------------------------------------------------------------------
nsEditingSession
----------------------------------------------------------------------------*/
nsEditingSession::nsEditingSession()
: mDoneSetup(PR_FALSE)
{
NS_INIT_ISUPPORTS();
}
/*---------------------------------------------------------------------------
~nsEditingSession
----------------------------------------------------------------------------*/
nsEditingSession::~nsEditingSession()
{
NS_IF_RELEASE(mStateMaintainer);
}
NS_IMPL_ISUPPORTS3(nsEditingSession, nsIEditingSession, nsIWebProgressListener, nsISupportsWeakReference)
/*---------------------------------------------------------------------------
GetEditingShell
void init (in nsIDOMWindow aWindow)
----------------------------------------------------------------------------*/
NS_IMETHODIMP
nsEditingSession::Init(nsIDOMWindow *aWindow)
{
nsCOMPtr<nsIDocShell> docShell;
nsresult rv = GetDocShellFromWindow(aWindow, getter_AddRefs(docShell));
if (NS_FAILED(rv)) return rv;
mEditingShell = getter_AddRefs(NS_GetWeakReference(docShell));
if (!mEditingShell) return NS_ERROR_NO_INTERFACE;
return NS_OK;
}
/*---------------------------------------------------------------------------
MakeWindowEditable
void makeWindowEditable (in nsIDOMWindow aWindow, in boolean inDoAfterUriLoad);
----------------------------------------------------------------------------*/
NS_IMETHODIMP
nsEditingSession::MakeWindowEditable(nsIDOMWindow *aWindow, PRBool inDoAfterUriLoad)
{
nsresult rv = PrepareForEditing();
if (NS_FAILED(rv)) return rv;
nsCOMPtr<nsIEditorDocShell> editorDocShell;
rv = GetEditorDocShellFromWindow(aWindow, getter_AddRefs(editorDocShell));
if (NS_FAILED(rv)) return rv;
// set the flag on the docShell to say that it's editable
rv = editorDocShell->MakeEditable(inDoAfterUriLoad);
if (NS_FAILED(rv)) return rv;
rv = SetupFrameControllers(aWindow);
if (NS_FAILED(rv)) return rv;
// make an editor immediately
if (!inDoAfterUriLoad)
{
rv = SetupEditorOnWindow(aWindow);
if (NS_FAILED(rv)) return rv;
}
return NS_OK;
}
/*---------------------------------------------------------------------------
WindowIsEditable
boolean windowIsEditable (in nsIDOMWindow aWindow);
----------------------------------------------------------------------------*/
NS_IMETHODIMP nsEditingSession::WindowIsEditable(nsIDOMWindow *aWindow, PRBool *outIsEditable)
{
nsCOMPtr<nsIEditorDocShell> editorDocShell;
nsresult rv = GetEditorDocShellFromWindow(aWindow, getter_AddRefs(editorDocShell));
if (NS_FAILED(rv)) return rv;
return editorDocShell->GetEditable(outIsEditable);
}
/*---------------------------------------------------------------------------
SetupEditorOnWindow
nsIEditor setupEditorOnWindow (in nsIDOMWindow aWindow);
----------------------------------------------------------------------------*/
NS_IMETHODIMP
nsEditingSession::SetupEditorOnWindow(nsIDOMWindow *aWindow)
{
nsresult rv = PrepareForEditing();
if (NS_FAILED(rv)) return rv;
nsCOMPtr<nsIDocShell> docShell;
rv = GetDocShellFromWindow(aWindow, getter_AddRefs(docShell));
if (NS_FAILED(rv)) return rv;
nsCOMPtr<nsIEditorDocShell> editorDocShell(do_QueryInterface(docShell, &rv));
if (NS_FAILED(rv)) return rv;
nsCOMPtr<nsIEditor> editor(do_CreateInstance("@mozilla.org/editor/htmleditor;1", &rv));
if (NS_FAILED(rv)) return rv;
// set the editor on the docShell. The docShell now owns it.
rv = editorDocShell->SetEditor(editor);
if (NS_FAILED(rv)) return rv;
nsCOMPtr<nsIPresShell> presShell;
rv = docShell->GetPresShell(getter_AddRefs(presShell));
if (NS_FAILED(rv)) return rv;
if (!presShell) return NS_ERROR_FAILURE;
nsCOMPtr<nsIContentViewer> contentViewer;
rv = docShell->GetContentViewer(getter_AddRefs(contentViewer));
if (NS_FAILED(rv)) return rv;
if (!contentViewer) return NS_ERROR_FAILURE;
nsCOMPtr<nsIDOMDocument> domDoc;
rv = contentViewer->GetDOMDocument(getter_AddRefs(domDoc));
if (NS_FAILED(rv)) return rv;
if (!domDoc) return NS_ERROR_FAILURE;
nsCOMPtr<nsISelectionController> selCon = do_QueryInterface(presShell);
rv = editor->Init(domDoc, presShell, nsnull /* root content */, selCon, 0);
if (NS_FAILED(rv)) return rv;
rv = editor->PostCreate();
if (NS_FAILED(rv)) return rv;
// set the editor on the controller
rv = SetEditorOnControllers(aWindow, editor);
if (NS_FAILED(rv)) return rv;
// make the UI state maintainer
NS_NEWXPCOM(mStateMaintainer, nsComposerCommandsUpdater);
if (!mStateMaintainer) return NS_ERROR_OUT_OF_MEMORY;
mStateMaintainer->AddRef(); // the owning reference
// now init the state maintainer
// XXX this needs to swap out editors
rv = mStateMaintainer->Init(editor);
if (NS_FAILED(rv)) return rv;
nsCOMPtr<nsISelection> selection;
editor->GetSelection(getter_AddRefs(selection));
nsCOMPtr<nsISelectionPrivate> selPriv = do_QueryInterface(selection);
if (!selPriv) return NS_ERROR_FAILURE;
rv = selPriv->AddSelectionListener(mStateMaintainer);
if (NS_FAILED(rv)) return rv;
// and set it up as a doc state listener
rv = editor->AddDocumentStateListener(NS_STATIC_CAST(nsIDocumentStateListener*, mStateMaintainer));
if (NS_FAILED(rv)) return rv;
// and as a transaction listener
nsCOMPtr<nsITransactionManager> txnMgr;
editor->GetTransactionManager(getter_AddRefs(txnMgr));
if (txnMgr)
{
txnMgr->AddListener(NS_STATIC_CAST(nsITransactionListener*, mStateMaintainer));
}
return NS_OK;
}
/*---------------------------------------------------------------------------
TearDownEditorOnWindow
void tearDownEditorOnWindow (in nsIDOMWindow aWindow);
----------------------------------------------------------------------------*/
NS_IMETHODIMP
nsEditingSession::TearDownEditorOnWindow(nsIDOMWindow *aWindow)
{
nsresult rv;
// null out the editor on the controller
rv = SetEditorOnControllers(aWindow, nsnull);
if (NS_FAILED(rv)) return rv;
nsCOMPtr<nsIEditorDocShell> editorDocShell;
rv = GetEditorDocShellFromWindow(aWindow, getter_AddRefs(editorDocShell));
if (NS_FAILED(rv)) return rv;
// null out the editor on the docShell
rv = editorDocShell->SetEditor(nsnull);
if (NS_FAILED(rv)) return rv;
return NS_OK;
}
/*---------------------------------------------------------------------------
GetEditorForFrame
nsIEditor getEditorForFrame (in nsIDOMWindow aWindow);
----------------------------------------------------------------------------*/
NS_IMETHODIMP
nsEditingSession::GetEditorForWindow(nsIDOMWindow *aWindow, nsIEditor **outEditor)
{
nsCOMPtr<nsIEditorDocShell> editorDocShell;
nsresult rv = GetEditorDocShellFromWindow(aWindow, getter_AddRefs(editorDocShell));
if (NS_FAILED(rv)) return rv;
return editorDocShell->GetEditor(outEditor);
}
#ifdef XP_MAC
#pragma mark -
#endif
/*---------------------------------------------------------------------------
OnStateChange
----------------------------------------------------------------------------*/
NS_IMETHODIMP
nsEditingSession::OnStateChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, PRInt32 aStateFlags, PRUint32 aStatus)
{
//
// A Request has started...
//
if (aStateFlags & nsIWebProgressListener::STATE_START)
{
// Page level notification...
if (aStateFlags & nsIWebProgressListener::STATE_IS_NETWORK)
{
StartPageLoad(aWebProgress);
}
// Document level notification...
if (aStateFlags & nsIWebProgressListener::STATE_IS_DOCUMENT)
{
if (NotifyingCurrentDocument(aWebProgress))
(void)StartDocumentLoad(aWebProgress);
}
}
//
// A Request is being processed
//
else if (aStateFlags & nsIWebProgressListener::STATE_TRANSFERRING)
{
if (aStateFlags * nsIWebProgressListener::STATE_IS_DOCUMENT)
{
// document transfer started
}
}
//
// Got a redirection
//
else if (aStateFlags & nsIWebProgressListener::STATE_REDIRECTING)
{
if (aStateFlags * nsIWebProgressListener::STATE_IS_DOCUMENT)
{
// got a redirect
}
}
//
// A network or document Request as finished...
//
else if (aStateFlags & nsIWebProgressListener::STATE_STOP)
{
// Document level notification...
if (aStateFlags & nsIWebProgressListener::STATE_IS_DOCUMENT)
{
if (NotifyingCurrentDocument(aWebProgress))
{
nsCOMPtr<nsIChannel> channel(do_QueryInterface(aRequest));
(void)EndDocumentLoad(aWebProgress, channel, aStatus);
}
}
// Page level notification...
if (aStateFlags & nsIWebProgressListener::STATE_IS_NETWORK)
{
nsCOMPtr<nsIChannel> channel(do_QueryInterface(aRequest));
(void)EndPageLoad(aWebProgress, channel, aStatus);
}
}
return NS_OK;
}
/*---------------------------------------------------------------------------
OnProgressChange
----------------------------------------------------------------------------*/
NS_IMETHODIMP
nsEditingSession::OnProgressChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, PRInt32 aCurSelfProgress, PRInt32 aMaxSelfProgress, PRInt32 aCurTotalProgress, PRInt32 aMaxTotalProgress)
{
return NS_OK;
}
/*---------------------------------------------------------------------------
OnLocationChange
----------------------------------------------------------------------------*/
NS_IMETHODIMP
nsEditingSession::OnLocationChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, nsIURI *location)
{
return NS_OK;
}
/*---------------------------------------------------------------------------
OnStatusChange
----------------------------------------------------------------------------*/
NS_IMETHODIMP
nsEditingSession::OnStatusChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, nsresult aStatus, const PRUnichar *aMessage)
{
return NS_OK;
}
/*---------------------------------------------------------------------------
OnSecurityChange
----------------------------------------------------------------------------*/
NS_IMETHODIMP
nsEditingSession::OnSecurityChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, PRInt32 state)
{
return NS_OK;
}
#ifdef XP_MAC
#pragma mark -
#endif
/*---------------------------------------------------------------------------
NotifyingCurrentDocument
Check that this notification is for our document. Necessary?
----------------------------------------------------------------------------*/
PRBool
nsEditingSession::NotifyingCurrentDocument(nsIWebProgress *aWebProgress)
{
return PR_TRUE;
}
/*---------------------------------------------------------------------------
StartDocumentLoad
Called on start of load in a single frame
----------------------------------------------------------------------------*/
nsresult
nsEditingSession::StartDocumentLoad(nsIWebProgress *aWebProgress)
{
#ifdef NOISY_DOC_LOADING
printf("Editing session StartDocumentLoad\n");
#endif
NS_ENSURE_ARG(aWebProgress);
// If we have an editor here, then we got a reload after making the editor.
// We need to blow it away and make a new one at the end of the load.
nsCOMPtr<nsIDOMWindow> domWindow;
aWebProgress->GetDOMWindow(getter_AddRefs(domWindow));
if (domWindow)
{
nsresult rv = TearDownEditorOnWindow(domWindow);
}
return NS_OK;
}
/*---------------------------------------------------------------------------
EndDocumentLoad
Called on end of load in a single frame
----------------------------------------------------------------------------*/
nsresult
nsEditingSession::EndDocumentLoad(nsIWebProgress *aWebProgress, nsIChannel* aChannel, nsresult aStatus)
{
NS_ENSURE_ARG(aWebProgress);
#ifdef NOISY_DOC_LOADING
printf("Editing shell EndDocumentLoad\n");
#endif
// we want to call the base class EndDocumentLoad, but avoid some of the stuff
// that nsWebShell does (need to refactor).
// OK, time to make an editor on this document
nsCOMPtr<nsIDOMWindow> domWindow;
aWebProgress->GetDOMWindow(getter_AddRefs(domWindow));
nsCOMPtr<nsIDocShell> docShell;
nsresult rv = GetDocShellFromWindow(domWindow, getter_AddRefs(docShell));
if (NS_FAILED(rv)) return rv; // better error handling?
nsCOMPtr<nsIEditorDocShell> editorDocShell(do_QueryInterface(docShell));
// did someone set the flag to make this shell editable?
if (editorDocShell)
{
PRBool makeEditable;
editorDocShell->GetEditable(&makeEditable);
if (makeEditable)
{
nsresult rv = SetupEditorOnWindow(domWindow);
}
}
return NS_OK;
}
/*---------------------------------------------------------------------------
StartPageLoad
Called on start load of the entire page (incl. subframes)
----------------------------------------------------------------------------*/
nsresult
nsEditingSession::StartPageLoad(nsIWebProgress *aWebProgress)
{
return NS_OK;
}
/*---------------------------------------------------------------------------
EndPageLoad
Called on end load of the entire page (incl. subframes)
----------------------------------------------------------------------------*/
nsresult
nsEditingSession::EndPageLoad(nsIWebProgress *aWebProgress, nsIChannel* aChannel, nsresult aStatus)
{
return NS_OK;
}
#ifdef XP_MAC
#pragma mark -
#endif
/*---------------------------------------------------------------------------
GetDocShellFromWindow
Utility method. This will always return an error if no docShell
is returned.
----------------------------------------------------------------------------*/
nsresult
nsEditingSession::GetDocShellFromWindow(nsIDOMWindow *inWindow, nsIDocShell** outDocShell)
{
nsCOMPtr<nsIScriptGlobalObject> scriptGO(do_QueryInterface(inWindow));
if (!scriptGO) return NS_ERROR_FAILURE;
nsresult rv = scriptGO->GetDocShell(outDocShell);
if (NS_FAILED(rv)) return rv;
if (!*outDocShell) return NS_ERROR_FAILURE;
return NS_OK;
}
/*---------------------------------------------------------------------------
GetEditorDocShellFromWindow
Utility method. This will always return an error if no docShell
is returned.
----------------------------------------------------------------------------*/
nsresult
nsEditingSession::GetEditorDocShellFromWindow(nsIDOMWindow *inWindow, nsIEditorDocShell** outDocShell)
{
nsCOMPtr<nsIDocShell> docShell;
nsresult rv = GetDocShellFromWindow(inWindow, getter_AddRefs(docShell));
if (NS_FAILED(rv)) return rv;
return docShell->QueryInterface(NS_GET_IID(nsIEditorDocShell), outDocShell);
}
/*---------------------------------------------------------------------------
PrepareForEditing
Set up this editing session for one or more editors
----------------------------------------------------------------------------*/
nsresult
nsEditingSession::PrepareForEditing()
{
if (mDoneSetup)
return NS_OK;
mDoneSetup = PR_TRUE;
nsCOMPtr<nsIDocShell> docShell = do_QueryReferent(mEditingShell);
if (!docShell) return NS_ERROR_NOT_INITIALIZED;
nsCOMPtr<nsIDOMWindow> domWindow = do_GetInterface(docShell);
if (!domWindow) return NS_ERROR_FAILURE;
// register callback
nsCOMPtr<nsIWebProgress> webProgress = do_GetInterface(docShell);
if (!webProgress) return NS_ERROR_FAILURE;
nsresult rv = webProgress->AddProgressListener(this);
if (NS_FAILED(rv)) return rv;
return NS_OK;
}
/*---------------------------------------------------------------------------
SetupFrameControllers
Set up the controller for this frame.
----------------------------------------------------------------------------*/
nsresult
nsEditingSession::SetupFrameControllers(nsIDOMWindow *inWindow)
{
nsresult rv;
nsCOMPtr<nsIDOMWindowInternal> domWindowInt(do_QueryInterface(inWindow, &rv));
if (NS_FAILED(rv)) return rv;
nsCOMPtr<nsIControllers> controllers;
rv = domWindowInt->GetControllers(getter_AddRefs(controllers));
if (NS_FAILED(rv)) return rv;
// the first is an editor controller, and takes an nsIEditor as the refCon
nsCOMPtr<nsIController> controller(do_CreateInstance("@mozilla.org/editor/editorcontroller;1", &rv));
if (NS_FAILED(rv)) return rv;
nsCOMPtr<nsIEditorController> editorController(do_QueryInterface(controller));
rv = editorController->Init(nsnull); // we set the editor later when we have one
if (NS_FAILED(rv)) return rv;
rv = controllers->InsertControllerAt(0, controller);
if (NS_FAILED(rv)) return rv;
// the second is an composer controller, and also takes an nsIEditor as the refCon
controller = do_CreateInstance("@mozilla.org/editor/composercontroller;1", &rv);
if (NS_FAILED(rv)) return rv;
nsCOMPtr<nsIEditorController> composerController(do_QueryInterface(controller));
rv = composerController->Init(nsnull); // we set the editor later when we have one
if (NS_FAILED(rv)) return rv;
rv = controllers->InsertControllerAt(1, controller);
if (NS_FAILED(rv)) return rv;
return NS_OK;
}
/*---------------------------------------------------------------------------
SetEditorOnControllers
Set the editor on the controller(s) for this window
----------------------------------------------------------------------------*/
nsresult
nsEditingSession::SetEditorOnControllers(nsIDOMWindow *inWindow, nsIEditor* inEditor)
{
nsresult rv;
// set the editor on the controller
nsCOMPtr<nsIDOMWindowInternal> domWindowInt(do_QueryInterface(inWindow, &rv));
if (NS_FAILED(rv)) return rv;
nsCOMPtr<nsIControllers> controllers;
rv = domWindowInt->GetControllers(getter_AddRefs(controllers));
if (NS_FAILED(rv)) return rv;
// find the editor controllers by QIing each one. This sucks.
// Controllers need to have IDs of some kind.
PRUint32 numControllers;
rv = controllers->GetControllerCount(&numControllers);
if (NS_FAILED(rv)) return rv;
for (PRUint32 i = 0; i < numControllers; i ++)
{
nsCOMPtr<nsIController> thisController;
controllers->GetControllerAt(i, getter_AddRefs(thisController));
nsCOMPtr<nsIEditorController> editorController(do_QueryInterface(thisController)); // ok with nil controller
if (editorController)
{
rv = editorController->SetCommandRefCon(inEditor);
if (NS_FAILED(rv)) break;
}
}
if (NS_FAILED(rv)) return rv;
return NS_OK;
}

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

@ -301,7 +301,7 @@ nsEditingSession::GetEditorForWindow(nsIDOMWindow *aWindow, nsIEditor **outEdito
----------------------------------------------------------------------------*/
NS_IMETHODIMP
nsEditingSession::OnStateChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, PRInt32 aStateFlags, PRUint32 aStatus)
nsEditingSession::OnStateChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, PRUint32 aStateFlags, nsresult aStatus)
{
//
// A Request has started...
@ -376,6 +376,7 @@ nsEditingSession::OnStateChange(nsIWebProgress *aWebProgress, nsIRequest *aReque
NS_IMETHODIMP
nsEditingSession::OnProgressChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, PRInt32 aCurSelfProgress, PRInt32 aMaxSelfProgress, PRInt32 aCurTotalProgress, PRInt32 aMaxTotalProgress)
{
NS_NOTREACHED("notification excluded in AddProgressListener(...)");
return NS_OK;
}
@ -387,6 +388,7 @@ nsEditingSession::OnProgressChange(nsIWebProgress *aWebProgress, nsIRequest *aRe
NS_IMETHODIMP
nsEditingSession::OnLocationChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, nsIURI *location)
{
NS_NOTREACHED("notification excluded in AddProgressListener(...)");
return NS_OK;
}
@ -398,6 +400,7 @@ nsEditingSession::OnLocationChange(nsIWebProgress *aWebProgress, nsIRequest *aRe
NS_IMETHODIMP
nsEditingSession::OnStatusChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, nsresult aStatus, const PRUnichar *aMessage)
{
NS_NOTREACHED("notification excluded in AddProgressListener(...)");
return NS_OK;
}
@ -407,8 +410,9 @@ nsEditingSession::OnStatusChange(nsIWebProgress *aWebProgress, nsIRequest *aRequ
----------------------------------------------------------------------------*/
NS_IMETHODIMP
nsEditingSession::OnSecurityChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, PRInt32 state)
nsEditingSession::OnSecurityChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, PRUint32 state)
{
NS_NOTREACHED("notification excluded in AddProgressListener(...)");
return NS_OK;
}
@ -590,7 +594,7 @@ nsEditingSession::PrepareForEditing()
nsCOMPtr<nsIWebProgress> webProgress = do_GetInterface(docShell);
if (!webProgress) return NS_ERROR_FAILURE;
nsresult rv = webProgress->AddProgressListener(this);
nsresult rv = webProgress->AddProgressListener(this, nsIWebProgress::NOTIFY_STATE_ALL);
if (NS_FAILED(rv)) return rv;
return NS_OK;

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

@ -651,7 +651,10 @@ nsEditorShell::SetContentWindow(nsIDOMWindowInternal* aWin)
// Attach a WebProgress listener to the new docShell
webProgress = do_GetInterface(docShell, &rv);
if (webProgress) {
rv = webProgress->AddProgressListener(this);
rv = webProgress->AddProgressListener(this,
(nsIWebProgress::NOTIFY_STATE_NETWORK |
nsIWebProgress::NOTIFY_STATE_DOCUMENT |
nsIWebProgress::NOTIFY_LOCATION));
}
if (NS_FAILED(rv)) return rv;
@ -4390,7 +4393,7 @@ nsEditorShell::OnProgressChange(nsIWebProgress *aProgress,
NS_IMETHODIMP
nsEditorShell::OnStateChange(nsIWebProgress *aProgress,
nsIRequest *aRequest,
PRInt32 aStateFlags,
PRUint32 aStateFlags,
nsresult aStatus)
{
NS_ENSURE_ARG_POINTER(aProgress);
@ -4502,14 +4505,16 @@ nsEditorShell::OnStatusChange(nsIWebProgress* aWebProgress,
nsresult aStatus,
const PRUnichar* aMessage)
{
NS_NOTREACHED("notification excluded in AddProgressListener(...)");
return NS_OK;
}
NS_IMETHODIMP
nsEditorShell::OnSecurityChange(nsIWebProgress *aWebProgress,
nsIRequest *aRequest,
PRInt32 state)
PRUint32 state)
{
NS_NOTREACHED("notification excluded in AddProgressListener(...)");
return NS_OK;
}

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

@ -68,6 +68,7 @@ class nsIDOMElement;
class nsIDOMNode;
class nsIDOMHTMLDocument;
class nsIURI;
class nsIChannel;
class nsIPresShell;
class nsIOutputStream;
class nsISupportsArray;

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

@ -3308,8 +3308,8 @@ void PrintListener::WaitForComplete()
::CloseHandle(hFakeEvent);
}
/* void onStateChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in long aStateFlags, in unsigned long aStatus); */
NS_IMETHODIMP PrintListener::OnStateChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, PRInt32 aStateFlags, PRUint32 aStatus)
/* void onStateChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in unsigned long aStateFlags, in nsresult aStatus); */
NS_IMETHODIMP PrintListener::OnStateChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, PRUint32 aStateFlags, nsresult aStatus)
{
if (aStatus == nsIWebProgressListener::STATE_STOP) {
mComplete = PR_TRUE;
@ -3320,23 +3320,23 @@ NS_IMETHODIMP PrintListener::OnStateChange(nsIWebProgress *aWebProgress, nsIRequ
/* void onProgressChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in long aCurSelfProgress, in long aMaxSelfProgress, in long aCurTotalProgress, in long aMaxTotalProgress); */
NS_IMETHODIMP PrintListener::OnProgressChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, PRInt32 aCurSelfProgress, PRInt32 aMaxSelfProgress, PRInt32 aCurTotalProgress, PRInt32 aMaxTotalProgress)
{
return NS_ERROR_NOT_IMPLEMENTED;
return NS_OK;
}
/* void onLocationChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in nsIURI location); */
NS_IMETHODIMP PrintListener::OnLocationChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, nsIURI *location)
{
return NS_ERROR_NOT_IMPLEMENTED;
return NS_OK;
}
/* void onStatusChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in nsresult aStatus, in wstring aMessage); */
NS_IMETHODIMP PrintListener::OnStatusChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, nsresult aStatus, const PRUnichar *aMessage)
{
return NS_ERROR_NOT_IMPLEMENTED;
return NS_OK;
}
/* void onSecurityChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in long state); */
NS_IMETHODIMP PrintListener::OnSecurityChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, PRInt32 state)
/* void onSecurityChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in unsigned long state); */
NS_IMETHODIMP PrintListener::OnSecurityChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, PRUint32 state)
{
return NS_ERROR_NOT_IMPLEMENTED;
return NS_OK;
}

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

@ -134,8 +134,8 @@ NS_IMETHODIMP CWebBrowserContainer::OnProgressChange(nsIWebProgress *aProgress,
/* void onStateChange (in nsIWebProgress aWebProgress, in nsIRequest request, in long progressStateFlags, in unsinged long aStatus); */
NS_IMETHODIMP CWebBrowserContainer::OnStateChange(nsIWebProgress* aWebProgress, nsIRequest *aRequest, PRInt32 progressStateFlags, nsresult aStatus)
/* void onStateChange (in nsIWebProgress aWebProgress, in nsIRequest request, in unsigned long progressStateFlags, in unsinged long aStatus); */
NS_IMETHODIMP CWebBrowserContainer::OnStateChange(nsIWebProgress* aWebProgress, nsIRequest *aRequest, PRUint32 progressStateFlags, nsresult aStatus)
{
nsresult rv = NS_OK;
@ -186,11 +186,11 @@ NS_IMETHODIMP CWebBrowserContainer::OnStateChange(nsIWebProgress* aWebProgress,
if (!aChannel) return NS_ERROR_NULL_POINTER;
rv = aChannel->GetURI(getter_AddRefs(pURI));
if (NS_FAILED(rv)) return rv;
if (NS_FAILED(rv)) return NS_OK;
nsCAutoString aURI;
rv = pURI->GetAsciiSpec(aURI);
if (NS_FAILED(rv)) return rv;
if (NS_FAILED(rv)) return NS_OK;
USES_CONVERSION;
BSTR bstrURI = SysAllocString(A2OLE(aURI.get()));
@ -279,7 +279,7 @@ NS_IMETHODIMP CWebBrowserContainer::OnLocationChange(nsIWebProgress* aWebProgres
{
// nsXPIDLCString aPath;
// location->GetPath(getter_Copies(aPath));
return NS_ERROR_NOT_IMPLEMENTED;
return NS_OK;
}
NS_IMETHODIMP
@ -301,9 +301,9 @@ CWebBrowserContainer::OnStatusChange(nsIWebProgress* aWebProgress,
NS_IMETHODIMP
CWebBrowserContainer::OnSecurityChange(nsIWebProgress *aWebProgress,
nsIRequest *aRequest,
PRInt32 state)
PRUint32 state)
{
return NS_ERROR_NOT_IMPLEMENTED;
return NS_OK;
}

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

@ -131,7 +131,7 @@ function MiniNavStartup()
var interfaceRequestor = getBrowser().docShell.QueryInterface(Components.interfaces.nsIInterfaceRequestor);
var webProgress = interfaceRequestor.getInterface(Components.interfaces.nsIWebProgress);
webProgress.addProgressListener(gBrowserStatusHandler);
webProgress.addProgressListener(gBrowserStatusHandler, Components.interfaces.nsIWebProgress.NOTIFY_LOCATION);
} catch (e) {
alert("Error opening a mini-nav window");
dump(e+"\n");

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

@ -94,17 +94,17 @@ NS_IMETHODIMP EmbedPrintListener::OnProgressChange(nsIWebProgress *aWebProgress,
/* void onLocationChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in nsIURI location); */
NS_IMETHODIMP EmbedPrintListener::OnLocationChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, nsIURI *location)
{
return NS_ERROR_NOT_IMPLEMENTED;
return NS_OK;
}
/* void onStatusChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in nsresult aStatus, in wstring aMessage); */
NS_IMETHODIMP EmbedPrintListener::OnStatusChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, nsresult aStatus, const PRUnichar *aMessage)
{
return NS_ERROR_NOT_IMPLEMENTED;
return NS_OK;
}
/* void onSecurityChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in long state); */
NS_IMETHODIMP EmbedPrintListener::OnSecurityChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, PRInt32 state)
/* void onSecurityChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in unsigned long state); */
NS_IMETHODIMP EmbedPrintListener::OnSecurityChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, PRUint32 state)
{
return NS_ERROR_NOT_IMPLEMENTED;
return NS_OK;
}

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

@ -320,7 +320,7 @@ EmbedProgress::OnStatusChange(nsIWebProgress *aWebProgress,
NS_IMETHODIMP
EmbedProgress::OnSecurityChange(nsIWebProgress *aWebProgress,
nsIRequest *aRequest,
PRInt32 aState)
PRUint32 aState)
{
return NS_OK;
}

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

@ -188,7 +188,7 @@ NS_IMETHODIMP nsWebProgressListener::OnLocationChange(nsIWebProgress* aWebProgre
NS_IMETHODIMP nsWebProgressListener::OnStatusChange(nsIWebProgress* aWebProgress, nsIRequest* aRequest, nsresult aStatus, const PRUnichar* aMessage) {
return NS_OK;
}
NS_IMETHODIMP nsWebProgressListener::OnSecurityChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, PRInt32 state) {
NS_IMETHODIMP nsWebProgressListener::OnSecurityChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, PRUint32 state) {
return NS_OK;
}

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

@ -1,153 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 2002
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Conrad Carlen <ccarlen@netscape.com>
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#ifndef __CBrowserShellMsgDefs__
#define __CBrowserShellMsgDefs__
#pragma once
// Messages sent by CBrowserShell
#ifndef EMBED_MSG_BASE_ID
#define EMBED_MSG_BASE_ID 1000
#endif
enum {
msg_OnNetStartChange = EMBED_MSG_BASE_ID + 0,
msg_OnNetStopChange = EMBED_MSG_BASE_ID + 1,
msg_OnProgressChange = EMBED_MSG_BASE_ID + 2,
msg_OnLocationChange = EMBED_MSG_BASE_ID + 3,
msg_OnStatusChange = EMBED_MSG_BASE_ID + 4,
msg_OnSecurityChange = EMBED_MSG_BASE_ID + 5,
msg_OnChromeStatusChange = EMBED_MSG_BASE_ID + 6
};
/**
* CBrowserShell and CBrowserChrome broadcast changes using LBroadcaster::BroadcastMessage()
* A pointer to one of the following types is passed as the ioParam.
*/
// msg_OnNetStartChange
struct MsgNetStartInfo
{
MsgNetStartInfo(CBrowserShell* broadcaster) :
mBroadcaster(broadcaster)
{ }
CBrowserShell *mBroadcaster;
};
// msg_OnNetStopChange
struct MsgNetStopInfo
{
MsgNetStopInfo(CBrowserShell* broadcaster) :
mBroadcaster(broadcaster)
{ }
CBrowserShell *mBroadcaster;
};
// msg_OnProgressChange
struct MsgOnProgressChangeInfo
{
MsgOnProgressChangeInfo(CBrowserShell* broadcaster, PRInt32 curProgress, PRInt32 maxProgress) :
mBroadcaster(broadcaster), mCurProgress(curProgress), mMaxProgress(maxProgress)
{ }
CBrowserShell *mBroadcaster;
PRInt32 mCurProgress, mMaxProgress;
};
// msg_OnLocationChange
struct MsgLocationChangeInfo
{
MsgLocationChangeInfo(CBrowserShell* broadcaster,
const char* urlSpec) :
mBroadcaster(broadcaster), mURLSpec(urlSpec)
{ }
CBrowserShell *mBroadcaster;
const char *mURLSpec;
};
// msg_OnStatusChange
struct MsgStatusChangeInfo
{
MsgStatusChangeInfo(CBrowserShell* broadcaster,
nsresult status, const PRUnichar *message) :
mBroadcaster(broadcaster),
mStatus(status), mMessage(message)
{ }
CBrowserShell *mBroadcaster;
nsresult mStatus;
const PRUnichar *mMessage;
};
// msg_OnSecurityChange
struct MsgSecurityChangeInfo
{
MsgSecurityChangeInfo(CBrowserShell* broadcaster,
PRInt32 state) :
mBroadcaster(broadcaster),
mState(state)
{ }
CBrowserShell *mBroadcaster;
PRInt32 mState;
};
// msg_OnChromeStatusChange
// See nsIWebBrowserChrome::SetStatus
struct MsgChromeStatusChangeInfo
{
MsgChromeStatusChangeInfo(CBrowserShell* broadcaster,
PRUint32 statusType,
const PRUnichar* status) :
mBroadcaster(broadcaster),
mStatusType(statusType), mStatus(status)
{ }
CBrowserShell *mBroadcaster;
PRUint32 mStatusType;
const PRUnichar *mStatus;
};
#endif // __CBrowserShellMsgDefs__

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

@ -230,7 +230,7 @@ NS_IMETHODIMP CBrowserShellProgressListener::OnStatusChange(nsIWebProgress *aWeb
return NS_OK;
}
NS_IMETHODIMP CBrowserShellProgressListener::OnSecurityChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, PRInt32 state)
NS_IMETHODIMP CBrowserShellProgressListener::OnSecurityChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, PRUint32 state)
{
NS_ENSURE_TRUE(mpOwner, NS_ERROR_NULL_POINTER);

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

@ -234,7 +234,7 @@ NS_IMETHODIMP CWebBrowserChrome::OnProgressChange(nsIWebProgress *progress, nsIR
PRInt32 curSelfProgress, PRInt32 maxSelfProgress,
PRInt32 curTotalProgress, PRInt32 maxTotalProgress)
{
NS_ENSURE_TRUE(mBrowserWindow, NS_ERROR_NOT_INITIALIZED);
NS_ENSURE_TRUE(mBrowserWindow, NS_OK);
return mBrowserWindow->OnProgressChange(progress, request,
curSelfProgress, maxSelfProgress,
@ -244,7 +244,7 @@ NS_IMETHODIMP CWebBrowserChrome::OnProgressChange(nsIWebProgress *progress, nsIR
NS_IMETHODIMP CWebBrowserChrome::OnStateChange(nsIWebProgress *progress, nsIRequest *request,
PRInt32 progressStateFlags, PRUint32 status)
{
NS_ENSURE_TRUE(mBrowserWindow, NS_ERROR_NOT_INITIALIZED);
NS_ENSURE_TRUE(mBrowserWindow, NS_OK);
if (progressStateFlags & STATE_IS_NETWORK) {
if (progressStateFlags & STATE_START)
@ -261,7 +261,7 @@ NS_IMETHODIMP CWebBrowserChrome::OnLocationChange(nsIWebProgress* aWebProgress,
nsIRequest* aRequest,
nsIURI *location)
{
NS_ENSURE_TRUE(mBrowserWindow, NS_ERROR_NOT_INITIALIZED);
NS_ENSURE_TRUE(mBrowserWindow, NS_OK);
char *buf = nsnull;
@ -291,9 +291,9 @@ CWebBrowserChrome::OnStatusChange(nsIWebProgress* aWebProgress,
NS_IMETHODIMP
CWebBrowserChrome::OnSecurityChange(nsIWebProgress *aWebProgress,
nsIRequest *aRequest,
PRInt32 state)
PRUint32 state)
{
return NS_ERROR_NOT_IMPLEMENTED;
return NS_OK;
}

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

@ -686,17 +686,17 @@ nsDocShellTreeOwner::OnProgressChange(nsIWebProgress* aProgress,
NS_IMETHODIMP
nsDocShellTreeOwner::OnStateChange(nsIWebProgress* aProgress,
nsIRequest* aRequest,
PRInt32 aProgressStateFlags,
PRUint32 aProgressStateFlags,
nsresult aStatus)
{
return NS_ERROR_NOT_IMPLEMENTED;
return NS_OK;
}
NS_IMETHODIMP nsDocShellTreeOwner::OnLocationChange(nsIWebProgress* aWebProgress,
nsIRequest* aRequest,
nsIURI* aURI)
{
return NS_ERROR_NOT_IMPLEMENTED;
return NS_OK;
}
NS_IMETHODIMP
@ -705,15 +705,15 @@ nsDocShellTreeOwner::OnStatusChange(nsIWebProgress* aWebProgress,
nsresult aStatus,
const PRUnichar* aMessage)
{
return NS_ERROR_NOT_IMPLEMENTED;
return NS_OK;
}
NS_IMETHODIMP
nsDocShellTreeOwner::OnSecurityChange(nsIWebProgress *aWebProgress,
nsIRequest *aRequest,
PRInt32 state)
PRUint32 state)
{
return NS_ERROR_NOT_IMPLEMENTED;
return NS_OK;
}

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

@ -234,7 +234,7 @@ NS_IMETHODIMP nsWebBrowser::BindListener(nsISupports *aListener, const nsIID& aI
if (aIID.Equals(NS_GET_IID(nsIWebProgressListener))) {
nsCOMPtr<nsIWebProgressListener> listener = do_QueryInterface(aListener, &rv);
if (NS_FAILED(rv)) return rv;
rv = mWebProgress->AddProgressListener(listener);
rv = mWebProgress->AddProgressListener(listener, nsIWebProgress::NOTIFY_ALL);
}
else if (aIID.Equals(NS_GET_IID(nsISHistoryListener))) {
nsCOMPtr<nsISHistory> shistory(do_GetInterface(mDocShell, &rv));
@ -757,8 +757,8 @@ NS_IMETHODIMP nsWebBrowser::SetProperty(PRUint32 aId, PRUint32 aValue)
// nsWebBrowser::nsIWebProgressListener
//*****************************************************************************
/* void onStateChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in long aStateFlags, in unsigned long aStatus); */
NS_IMETHODIMP nsWebBrowser::OnStateChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, PRInt32 aStateFlags, PRUint32 aStatus)
/* void onStateChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in unsigned long aStateFlags, in nsresult aStatus); */
NS_IMETHODIMP nsWebBrowser::OnStateChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, PRUint32 aStateFlags, nsresult aStatus)
{
if (mPersist)
{
@ -809,8 +809,8 @@ NS_IMETHODIMP nsWebBrowser::OnStatusChange(nsIWebProgress *aWebProgress, nsIRequ
return NS_OK;
}
/* void onSecurityChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in long state); */
NS_IMETHODIMP nsWebBrowser::OnSecurityChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, PRInt32 state)
/* void onSecurityChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in unsigned long state); */
NS_IMETHODIMP nsWebBrowser::OnSecurityChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, PRUint32 state)
{
if (mProgressListener)
{

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

@ -189,8 +189,8 @@ NS_IMETHODIMP nsPrintProgress::DoneIniting()
return NS_OK;
}
/* void onStateChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in long aStateFlags, in unsigned long aStatus); */
NS_IMETHODIMP nsPrintProgress::OnStateChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, PRInt32 aStateFlags, PRUint32 aStatus)
/* void onStateChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in unsigned long aStateFlags, in nsresult aStatus); */
NS_IMETHODIMP nsPrintProgress::OnStateChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, PRUint32 aStateFlags, nsresult aStatus)
{
nsresult rv = NS_OK;
@ -253,7 +253,7 @@ NS_IMETHODIMP nsPrintProgress::OnProgressChange(nsIWebProgress *aWebProgress, ns
/* void onLocationChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in nsIURI location); */
NS_IMETHODIMP nsPrintProgress::OnLocationChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, nsIURI *location)
{
return NS_ERROR_NOT_IMPLEMENTED;
return NS_OK;
}
/* void onStatusChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in nsresult aStatus, in wstring aMessage); */
@ -287,10 +287,10 @@ NS_IMETHODIMP nsPrintProgress::OnStatusChange(nsIWebProgress *aWebProgress, nsIR
return rv;
}
/* void onSecurityChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in long state); */
NS_IMETHODIMP nsPrintProgress::OnSecurityChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, PRInt32 state)
/* void onSecurityChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in unsigned long state); */
NS_IMETHODIMP nsPrintProgress::OnSecurityChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, PRUint32 state)
{
return NS_ERROR_NOT_IMPLEMENTED;
return NS_OK;
}
nsresult nsPrintProgress::ReleaseListeners()

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

@ -505,7 +505,7 @@ nsPrintingPromptService::ShowPrinterProperties(nsIDOMWindow *parent, const PRUni
//*****************************************************************************
NS_IMETHODIMP
nsPrintingPromptService::OnStateChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, PRInt32 aStateFlags, PRUint32 aStatus)
nsPrintingPromptService::OnStateChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, PRUint32 aStateFlags, nsresult aStatus)
{
if (aStateFlags & STATE_STOP)
{
@ -535,7 +535,7 @@ nsPrintingPromptService::OnStatusChange(nsIWebProgress *aWebProgress, nsIRequest
}
NS_IMETHODIMP
nsPrintingPromptService::OnSecurityChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, PRInt32 state)
nsPrintingPromptService::OnSecurityChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, PRUint32 state)
{
return mWebProgressListener->OnSecurityChange(aWebProgress, aRequest, state);
}

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

@ -189,8 +189,8 @@ NS_IMETHODIMP nsPrintProgress::DoneIniting()
return NS_OK;
}
/* void onStateChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in long aStateFlags, in unsigned long aStatus); */
NS_IMETHODIMP nsPrintProgress::OnStateChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, PRInt32 aStateFlags, PRUint32 aStatus)
/* void onStateChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in unsigned long aStateFlags, in nsresult aStatus); */
NS_IMETHODIMP nsPrintProgress::OnStateChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, PRUint32 aStateFlags, nsresult aStatus)
{
nsresult rv = NS_OK;
@ -253,7 +253,7 @@ NS_IMETHODIMP nsPrintProgress::OnProgressChange(nsIWebProgress *aWebProgress, ns
/* void onLocationChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in nsIURI location); */
NS_IMETHODIMP nsPrintProgress::OnLocationChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, nsIURI *location)
{
return NS_ERROR_NOT_IMPLEMENTED;
return NS_OK;
}
/* void onStatusChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in nsresult aStatus, in wstring aMessage); */
@ -287,10 +287,10 @@ NS_IMETHODIMP nsPrintProgress::OnStatusChange(nsIWebProgress *aWebProgress, nsIR
return rv;
}
/* void onSecurityChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in long state); */
NS_IMETHODIMP nsPrintProgress::OnSecurityChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, PRInt32 state)
/* void onSecurityChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in unsigned long state); */
NS_IMETHODIMP nsPrintProgress::OnSecurityChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, PRUint32 state)
{
return NS_ERROR_NOT_IMPLEMENTED;
return NS_OK;
}
nsresult nsPrintProgress::ReleaseListeners()

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

@ -279,9 +279,9 @@ nsPrintingPromptService::DoDialog(nsIDOMWindow *aParent,
// nsIWebProgressListener
//////////////////////////////////////////////////////////////////////
/* void onStateChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in long aStateFlags, in unsigned long aStatus); */
/* void onStateChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in unsigned long aStateFlags, in nsresult aStatus); */
NS_IMETHODIMP
nsPrintingPromptService::OnStateChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, PRInt32 aStateFlags, PRUint32 aStatus)
nsPrintingPromptService::OnStateChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, PRUint32 aStateFlags, nsresult aStatus)
{
if (aStateFlags & STATE_STOP) {
mWebProgressListener->OnStateChange(aWebProgress, aRequest, aStateFlags, aStatus);
@ -312,7 +312,7 @@ nsPrintingPromptService::OnStatusChange(nsIWebProgress *aWebProgress, nsIRequest
return mWebProgressListener->OnStatusChange(aWebProgress, aRequest, aStatus, aMessage);
}
/* void onSecurityChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in long state); */
/* void onSecurityChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in unsigned long state); */
NS_IMETHODIMP
nsPrintingPromptService::OnSecurityChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, PRInt32 state)
{

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

@ -189,8 +189,8 @@ NS_IMETHODIMP nsPrintProgress::DoneIniting()
return NS_OK;
}
/* void onStateChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in long aStateFlags, in unsigned long aStatus); */
NS_IMETHODIMP nsPrintProgress::OnStateChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, PRInt32 aStateFlags, PRUint32 aStatus)
/* void onStateChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in unsigned long aStateFlags, in nsresult aStatus); */
NS_IMETHODIMP nsPrintProgress::OnStateChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, PRUint32 aStateFlags, nsresult aStatus)
{
nsresult rv = NS_OK;
@ -287,10 +287,10 @@ NS_IMETHODIMP nsPrintProgress::OnStatusChange(nsIWebProgress *aWebProgress, nsIR
return rv;
}
/* void onSecurityChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in long state); */
NS_IMETHODIMP nsPrintProgress::OnSecurityChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, PRInt32 state)
/* void onSecurityChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in unsigned long state); */
NS_IMETHODIMP nsPrintProgress::OnSecurityChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, PRUint32 state)
{
return NS_ERROR_NOT_IMPLEMENTED;
return NS_OK;
}
nsresult nsPrintProgress::ReleaseListeners()

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

@ -285,9 +285,9 @@ nsPrintingPromptService::DoDialog(nsIDOMWindow *aParent,
// nsIWebProgressListener
//////////////////////////////////////////////////////////////////////
/* void onStateChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in long aStateFlags, in unsigned long aStatus); */
/* void onStateChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in unsigned long aStateFlags, in nsresult aStatus); */
NS_IMETHODIMP
nsPrintingPromptService::OnStateChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, PRInt32 aStateFlags, PRUint32 aStatus)
nsPrintingPromptService::OnStateChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, PRUint32 aStateFlags, nsresult aStatus)
{
if (aStateFlags & STATE_STOP) {
mWebProgressListener->OnStateChange(aWebProgress, aRequest, aStateFlags, aStatus);
@ -318,9 +318,9 @@ nsPrintingPromptService::OnStatusChange(nsIWebProgress *aWebProgress, nsIRequest
return mWebProgressListener->OnStatusChange(aWebProgress, aRequest, aStatus, aMessage);
}
/* void onSecurityChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in long state); */
/* void onSecurityChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in unsigned long state); */
NS_IMETHODIMP
nsPrintingPromptService::OnSecurityChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, PRInt32 state)
nsPrintingPromptService::OnSecurityChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, PRUint32 state)
{
return mWebProgressListener->OnSecurityChange(aWebProgress, aRequest, state);
}

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

@ -190,8 +190,8 @@ NS_IMETHODIMP nsPrintProgress::DoneIniting()
return NS_OK;
}
/* void onStateChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in long aStateFlags, in unsigned long aStatus); */
NS_IMETHODIMP nsPrintProgress::OnStateChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, PRInt32 aStateFlags, PRUint32 aStatus)
/* void onStateChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in unsigned long aStateFlags, in nsresult aStatus); */
NS_IMETHODIMP nsPrintProgress::OnStateChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, PRUint32 aStateFlags, nsresult aStatus)
{
nsresult rv = NS_OK;
@ -254,7 +254,7 @@ NS_IMETHODIMP nsPrintProgress::OnProgressChange(nsIWebProgress *aWebProgress, ns
/* void onLocationChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in nsIURI location); */
NS_IMETHODIMP nsPrintProgress::OnLocationChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, nsIURI *location)
{
return NS_ERROR_NOT_IMPLEMENTED;
return NS_OK;
}
/* void onStatusChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in nsresult aStatus, in wstring aMessage); */
@ -288,10 +288,10 @@ NS_IMETHODIMP nsPrintProgress::OnStatusChange(nsIWebProgress *aWebProgress, nsIR
return rv;
}
/* void onSecurityChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in long state); */
NS_IMETHODIMP nsPrintProgress::OnSecurityChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, PRInt32 state)
/* void onSecurityChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in unsigned long state); */
NS_IMETHODIMP nsPrintProgress::OnSecurityChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, PRUint32 state)
{
return NS_ERROR_NOT_IMPLEMENTED;
return NS_OK;
}
nsresult nsPrintProgress::ReleaseListeners()

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

@ -317,9 +317,9 @@ nsPrintingPromptService::DoDialog(nsIDOMWindow *aParent,
// nsIWebProgressListener
//////////////////////////////////////////////////////////////////////
/* void onStateChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in long aStateFlags, in unsigned long aStatus); */
/* void onStateChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in long aStateFlags, in nsresult aStatus); */
NS_IMETHODIMP
nsPrintingPromptService::OnStateChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, PRInt32 aStateFlags, PRUint32 aStatus)
nsPrintingPromptService::OnStateChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, PRUint32 aStateFlags, nsresult aStatus)
{
if (aStateFlags & STATE_STOP)
{
@ -351,9 +351,9 @@ nsPrintingPromptService::OnStatusChange(nsIWebProgress *aWebProgress, nsIRequest
return mWebProgressListener->OnStatusChange(aWebProgress, aRequest, aStatus, aMessage);
}
/* void onSecurityChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in long state); */
/* void onSecurityChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in unsigned long state); */
NS_IMETHODIMP
nsPrintingPromptService::OnSecurityChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, PRInt32 state)
nsPrintingPromptService::OnSecurityChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, PRUint32 state)
{
return mWebProgressListener->OnSecurityChange(aWebProgress, aRequest, state);
}

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

@ -112,7 +112,7 @@ NS_IMETHODIMP CBrowserImpl::OnProgressChange(nsIWebProgress *progress, nsIReques
}
NS_IMETHODIMP CBrowserImpl::OnStateChange(nsIWebProgress *progress, nsIRequest *request,
PRInt32 progressStateFlags, PRUint32 status)
PRUint32 progressStateFlags, nsresult status)
{
char theDocType[100];
char theStateType[100];
@ -315,7 +315,7 @@ CBrowserImpl::OnStatusChange(nsIWebProgress* aWebProgress,
NS_IMETHODIMP
CBrowserImpl::OnSecurityChange(nsIWebProgress *aWebProgress,
nsIRequest *aRequest,
PRInt32 state)
PRUint32 state)
{
nsCString stringMsg;

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

@ -89,9 +89,9 @@ CDlgPrintListener::OnStatusChange(nsIWebProgress *aWebProgress, nsIRequest *aReq
return NS_ERROR_NOT_IMPLEMENTED;
}
/* void onSecurityChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in long state); */
/* void onSecurityChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in unsigned long state); */
NS_IMETHODIMP
CDlgPrintListener::OnSecurityChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, PRInt32 state)
CDlgPrintListener::OnSecurityChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, PRUint32 state)
{
return NS_ERROR_NOT_IMPLEMENTED;
}

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

@ -50,56 +50,63 @@
// - Implements browser progress update functionality
// while loading a page into the embedded browser
//
// - Calls methods via the IBrowserFrameGlue interace
// (available thru' the m_pBrowserFrameGlue member var)
// to do the actual statusbar/progress bar updates.
// - Calls methods via the IBrowserFrameGlue interace
// (available thru' the m_pBrowserFrameGlue member var)
// to do the actual statusbar/progress bar updates.
//
NS_IMETHODIMP CBrowserImpl::OnProgressChange(nsIWebProgress *progress, nsIRequest *request,
PRInt32 curSelfProgress, PRInt32 maxSelfProgress,
PRInt32 curTotalProgress, PRInt32 maxTotalProgress)
NS_IMETHODIMP CBrowserImpl::OnProgressChange(nsIWebProgress *progress,
nsIRequest *request,
PRInt32 curSelfProgress,
PRInt32 maxSelfProgress,
PRInt32 curTotalProgress,
PRInt32 maxTotalProgress)
{
if(! m_pBrowserFrameGlue)
return NS_ERROR_FAILURE;
PRInt32 nProgress = curTotalProgress;
PRInt32 nProgressMax = maxTotalProgress;
if (nProgressMax == 0)
nProgressMax = LONG_MAX;
if (nProgress > nProgressMax)
nProgress = nProgressMax; // Progress complete
m_pBrowserFrameGlue->UpdateProgress(nProgress, nProgressMax);
if(! m_pBrowserFrameGlue) {
// always return NS_OK
return NS_OK;
}
PRInt32 nProgress = curTotalProgress;
PRInt32 nProgressMax = maxTotalProgress;
if (nProgressMax == 0)
nProgressMax = LONG_MAX;
if (nProgress > nProgressMax)
nProgress = nProgressMax; // Progress complete
m_pBrowserFrameGlue->UpdateProgress(nProgress, nProgressMax);
return NS_OK;
}
NS_IMETHODIMP CBrowserImpl::OnStateChange(nsIWebProgress *progress, nsIRequest *request,
PRInt32 progressStateFlags, PRUint32 status)
NS_IMETHODIMP CBrowserImpl::OnStateChange(nsIWebProgress *progress,
nsIRequest *request,
PRUint32 progressStateFlags,
nsresult status)
{
if(! m_pBrowserFrameGlue)
return NS_ERROR_FAILURE;
if ((progressStateFlags & STATE_START) && (progressStateFlags & STATE_IS_DOCUMENT))
{
// Navigation has begun
if(m_pBrowserFrameGlue)
m_pBrowserFrameGlue->UpdateBusyState(PR_TRUE);
}
if ((progressStateFlags & STATE_STOP) && (progressStateFlags & STATE_IS_DOCUMENT))
{
// We've completed the navigation
m_pBrowserFrameGlue->UpdateBusyState(PR_FALSE);
m_pBrowserFrameGlue->UpdateProgress(0, 100); // Clear the prog bar
m_pBrowserFrameGlue->UpdateStatusBarText(nsnull); // Clear the status bar
}
if(! m_pBrowserFrameGlue) {
// always return NS_OK
return NS_OK;
}
if ((progressStateFlags & STATE_START) && (progressStateFlags & STATE_IS_DOCUMENT))
{
// Navigation has begun
m_pBrowserFrameGlue->UpdateBusyState(PR_TRUE);
}
if ((progressStateFlags & STATE_STOP) && (progressStateFlags & STATE_IS_DOCUMENT))
{
// We've completed the navigation
m_pBrowserFrameGlue->UpdateBusyState(PR_FALSE);
m_pBrowserFrameGlue->UpdateProgress(0, 100); // Clear the prog bar
m_pBrowserFrameGlue->UpdateStatusBarText(nsnull); // Clear the status bar
}
return NS_OK;
}
@ -107,8 +114,10 @@ NS_IMETHODIMP CBrowserImpl::OnLocationChange(nsIWebProgress* aWebProgress,
nsIRequest* aRequest,
nsIURI *location)
{
if(! m_pBrowserFrameGlue)
return NS_ERROR_FAILURE;
if(! m_pBrowserFrameGlue) {
// always return NS_OK
return NS_OK;
}
PRBool isSubFrameLoad = PR_FALSE; // Is this a subframe load
if (aWebProgress) {
@ -124,7 +133,7 @@ NS_IMETHODIMP CBrowserImpl::OnLocationChange(nsIWebProgress* aWebProgress,
}
if (!isSubFrameLoad) // Update urlbar only if it is not a subframe load
m_pBrowserFrameGlue->UpdateCurrentURI(location);
m_pBrowserFrameGlue->UpdateCurrentURI(location);
return NS_OK;
}
@ -135,12 +144,10 @@ CBrowserImpl::OnStatusChange(nsIWebProgress* aWebProgress,
nsresult aStatus,
const PRUnichar* aMessage)
{
if(! m_pBrowserFrameGlue)
return NS_ERROR_FAILURE;
if(m_pBrowserFrameGlue)
m_pBrowserFrameGlue->UpdateStatusBarText(aMessage);
m_pBrowserFrameGlue->UpdateStatusBarText(aMessage);
return NS_OK;
return NS_OK;
}
@ -148,9 +155,9 @@ CBrowserImpl::OnStatusChange(nsIWebProgress* aWebProgress,
NS_IMETHODIMP
CBrowserImpl::OnSecurityChange(nsIWebProgress *aWebProgress,
nsIRequest *aRequest,
PRInt32 state)
PRUint32 state)
{
m_pBrowserFrameGlue->UpdateSecurityStatus(state);
m_pBrowserFrameGlue->UpdateSecurityStatus(state);
return NS_OK;
return NS_OK;
}

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

@ -49,9 +49,9 @@ CDlgPrintListener::CDlgPrintListener(CPrintProgressDialog* aDlg) :
//NS_ADDREF_THIS();
}
/* void onStateChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in long aStateFlags, in unsigned long aStatus); */
/* void onStateChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in unsigned long aStateFlags, in nsresult aStatus); */
NS_IMETHODIMP
CDlgPrintListener::OnStateChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, PRInt32 aStateFlags, PRUint32 aStatus)
CDlgPrintListener::OnStateChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, PRUint32 aStateFlags, nsresult aStatus)
{
if (m_PrintDlg) {
if (aStateFlags == (nsIWebProgressListener::STATE_START|nsIWebProgressListener::STATE_IS_DOCUMENT)) {
@ -78,21 +78,21 @@ CDlgPrintListener::OnProgressChange(nsIWebProgress *aWebProgress, nsIRequest *aR
NS_IMETHODIMP
CDlgPrintListener::OnLocationChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, nsIURI *location)
{
return NS_ERROR_NOT_IMPLEMENTED;
return NS_OK;
}
/* void onStatusChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in nsresult aStatus, in wstring aMessage); */
NS_IMETHODIMP
CDlgPrintListener::OnStatusChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, nsresult aStatus, const PRUnichar *aMessage)
{
return NS_ERROR_NOT_IMPLEMENTED;
return NS_OK;
}
/* void onSecurityChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in long state); */
/* void onSecurityChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in unsigned long state); */
NS_IMETHODIMP
CDlgPrintListener::OnSecurityChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, PRInt32 state)
CDlgPrintListener::OnSecurityChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, PRUint32 state)
{
return NS_ERROR_NOT_IMPLEMENTED;
return NS_OK;
}

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

@ -530,8 +530,8 @@ CProgressDlg::~CProgressDlg()
}
NS_IMETHODIMP CProgressDlg::OnStateChange(nsIWebProgress *aWebProgress,
nsIRequest *aRequest, PRInt32 aStateFlags,
PRUint32 aStatus)
nsIRequest *aRequest, PRUint32 aStateFlags,
nsresult aStatus)
{
if((aStateFlags & STATE_STOP) && (aStateFlags & STATE_IS_DOCUMENT))
{
@ -565,20 +565,20 @@ NS_IMETHODIMP CProgressDlg::OnProgressChange(nsIWebProgress *aWebProgress,
NS_IMETHODIMP CProgressDlg::OnLocationChange(nsIWebProgress *aWebProgress,
nsIRequest *aRequest, nsIURI *location)
{
return NS_ERROR_NOT_IMPLEMENTED;
return NS_OK;
}
NS_IMETHODIMP CProgressDlg::OnStatusChange(nsIWebProgress *aWebProgress,
nsIRequest *aRequest, nsresult aStatus,
const PRUnichar *aMessage)
{
return NS_ERROR_NOT_IMPLEMENTED;
return NS_OK;
}
NS_IMETHODIMP CProgressDlg::OnSecurityChange(nsIWebProgress *aWebProgress,
nsIRequest *aRequest, PRInt32 state)
nsIRequest *aRequest, PRUint32 state)
{
return NS_ERROR_NOT_IMPLEMENTED;
return NS_OK;
}
BOOL CProgressDlg::OnInitDialog()

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

@ -250,7 +250,7 @@ NS_IMETHODIMP WebBrowserChrome::OnProgressChange(nsIWebProgress *progress, nsIRe
}
NS_IMETHODIMP WebBrowserChrome::OnStateChange(nsIWebProgress *progress, nsIRequest *request,
PRInt32 progressStateFlags, PRUint32 status)
PRUint32 progressStateFlags, nsresult status)
{
if ((progressStateFlags & STATE_START) && (progressStateFlags & STATE_IS_DOCUMENT))
{
@ -304,9 +304,9 @@ WebBrowserChrome::OnStatusChange(nsIWebProgress* aWebProgress,
NS_IMETHODIMP
WebBrowserChrome::OnSecurityChange(nsIWebProgress *aWebProgress,
nsIRequest *aRequest,
PRInt32 state)
PRUint32 state)
{
return NS_ERROR_NOT_IMPLEMENTED;
return NS_OK;
}
//*****************************************************************************

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

@ -185,7 +185,8 @@ NS_IMETHODIMP nsAccessProxy::Observe(nsISupports *aSubject, const char *aTopic,
nsCOMPtr<nsIWebProgress> progress(do_GetService(NS_DOCUMENTLOADER_SERVICE_CONTRACTID));
rv = NS_ERROR_FAILURE;
if (progress) {
rv = progress->AddProgressListener(NS_STATIC_CAST(nsIWebProgressListener*,this));
rv = progress->AddProgressListener(NS_STATIC_CAST(nsIWebProgressListener*,this),
nsIWebProgress::NOTIFY_STATE_DOCUMENT);
if (NS_SUCCEEDED(rv))
AddRef();
}
@ -201,9 +202,9 @@ NS_IMETHODIMP nsAccessProxy::Observe(nsISupports *aSubject, const char *aTopic,
NS_IMETHODIMP nsAccessProxy::OnStateChange(nsIWebProgress *aWebProgress,
nsIRequest *aRequest, PRInt32 aStateFlags, PRUint32 aStatus)
nsIRequest *aRequest, PRUint32 aStateFlags, nsresult aStatus)
{
/* PRInt32 aStateFlags ...
/* PRUint32 aStateFlags ...
*
* ===== What has happened =====
* STATE_START, STATE_REDIRECTING, STATE_TRANSFERRING,
@ -259,9 +260,7 @@ NS_IMETHODIMP nsAccessProxy::OnProgressChange(nsIWebProgress *aWebProgress,
PRInt32 aCurTotalProgress, PRInt32 aMaxTotalProgress)
{
// We can use this to report the percentage done
#ifdef NS_DEBUG_ACCESS_BUILTIN
// printf ("** nsAccessProxy ** OnProgressChange ** \n");
#endif
NS_NOTREACHED("notification excluded in AddProgressListener(...)");
return NS_OK;
}
@ -270,9 +269,7 @@ NS_IMETHODIMP nsAccessProxy::OnLocationChange(nsIWebProgress *aWebProgress,
nsIRequest *aRequest, nsIURI *location)
{
// Load has been verified, it will occur, about to commence
#ifdef NS_DEBUG_ACCESS_BUILTIN
// printf ("** nsAccessProxy ** OnLocationChange ** \n");
#endif
NS_NOTREACHED("notification excluded in AddProgressListener(...)");
return NS_OK;
}
@ -281,20 +278,16 @@ NS_IMETHODIMP nsAccessProxy::OnStatusChange(nsIWebProgress *aWebProgress,
nsIRequest *aRequest, nsresult aStatus, const PRUnichar *aMessage)
{
// Status bar has changed
#ifdef NS_DEBUG_ACCESS_BUILTIN
// printf ("** nsAccessProxy ** OnStatusChange ** \n");
#endif
NS_NOTREACHED("notification excluded in AddProgressListener(...)");
return NS_OK;
}
/* void onSecurityChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in long state); */
/* void onSecurityChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in unsigned long state); */
NS_IMETHODIMP nsAccessProxy::OnSecurityChange(nsIWebProgress *aWebProgress,
nsIRequest *aRequest, PRInt32 state)
nsIRequest *aRequest, PRUint32 state)
{
// Security setting has changed
#ifdef NS_DEBUG_ACCESS_BUILTIN
printf ("** nsAccessProxy ** OnSecurityChange ** \n");
#endif
NS_NOTREACHED("notification excluded in AddProgressListener(...)");
return NS_OK;
}

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

@ -99,7 +99,8 @@ nsresult nsCookieService::Init()
if (NS_SUCCEEDED(rv) && docLoaderService) {
nsCOMPtr<nsIWebProgress> progress(do_QueryInterface(docLoaderService));
if (progress)
(void) progress->AddProgressListener((nsIWebProgressListener*)this);
(void) progress->AddProgressListener((nsIWebProgressListener*)this,
nsIWebProgress::NOTIFY_STATE_DOCUMENT);
} else {
NS_ASSERTION(PR_FALSE, "Could not get nsIDocumentLoader");
}
@ -116,13 +117,14 @@ nsCookieService::OnProgressChange(nsIWebProgress *aProgress,
PRInt32 curTotalProgress,
PRInt32 maxTotalProgress)
{
return NS_ERROR_NOT_IMPLEMENTED;
NS_NOTREACHED("notification excluded in AddProgressListener(...)");
return NS_OK;
}
NS_IMETHODIMP
nsCookieService::OnStateChange(nsIWebProgress* aWebProgress,
nsIRequest *aRequest,
PRInt32 progressStateFlags,
PRUint32 progressStateFlags,
nsresult aStatus)
{
if (progressStateFlags & STATE_IS_DOCUMENT)
@ -137,7 +139,8 @@ NS_IMETHODIMP nsCookieService::OnLocationChange(nsIWebProgress* aWebProgress,
nsIRequest* aRequest,
nsIURI *location)
{
return NS_ERROR_NOT_IMPLEMENTED;
NS_NOTREACHED("notification excluded in AddProgressListener(...)");
return NS_OK;
}
NS_IMETHODIMP
@ -146,15 +149,17 @@ nsCookieService::OnStatusChange(nsIWebProgress* aWebProgress,
nsresult aStatus,
const PRUnichar* aMessage)
{
return NS_ERROR_NOT_IMPLEMENTED;
NS_NOTREACHED("notification excluded in AddProgressListener(...)");
return NS_OK;
}
NS_IMETHODIMP
nsCookieService::OnSecurityChange(nsIWebProgress *aWebProgress,
nsIRequest *aRequest,
PRInt32 state)
PRUint32 state)
{
return NS_ERROR_NOT_IMPLEMENTED;
NS_NOTREACHED("notification excluded in AddProgressListener(...)");
return NS_OK;
}

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

@ -110,7 +110,7 @@ function init() {
// hook up UI through progress listener
var interfaceRequestor = helpBrowser.docShell.QueryInterface(Components.interfaces.nsIInterfaceRequestor);
var webProgress = interfaceRequestor.getInterface(Components.interfaces.nsIWebProgress);
webProgress.addProgressListener(window.XULBrowserWindow);
webProgress.addProgressListener(window.XULBrowserWindow, Components.interfaces.nsIWebProgress.NOTIFY_ALL);
}
function normalizeURI(uri) {

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

@ -467,7 +467,8 @@ nsPICS::Init()
if (NS_SUCCEEDED(rv)) {
nsCOMPtr<nsIWebProgress> progress(do_QueryInterface(mDocLoaderService, &rv));
if (NS_SUCCEEDED(rv)) {
(void) process->AddProgressListener((nsIWebProgressListener*)this);
(void) process->AddProgressListener((nsIWebProgressListener*)this,
nsIWebProgress::NOTIFY_STATE_ALL);
}
}
@ -694,7 +695,7 @@ nsPICS::ParsePICSLabel(char * label)
NS_IMETHODIMP
nsPICS::OnStateChange(nsIWebProgress* aWebProgress,
nsIRequest *aRequest,
PRInt32 progressStateFlags,
PRUint32 progressStateFlags,
nsresult aStatus)
{
nsresult rv = NS_OK;
@ -872,15 +873,19 @@ nsPICS::OnProgressChange(nsIWebProgress *aWebProgress,
PRInt32 aCurSelfProgress,
PRInt32 aMaxSelfProgress,
PRInt32 aCurTotalProgress,
PRInt32 aMaxTotalProgress) {
return NS_ERROR_NOT_IMPLEMENTED;
PRInt32 aMaxTotalProgress)
{
NS_NOTREACHED("notification excluded in AddProgressListener(...)");
return NS_OK;
}
NS_IMETHODIMP
nsPICS::OnLocationChange(nsIWebProgress* aWebProgress,
nsIRequest* aRequest,
nsIURI *location) {
return NS_ERROR_NOT_IMPLEMENTED;
nsIURI *location)
{
NS_NOTREACHED("notification excluded in AddProgressListener(...)");
return NS_OK;
}
@ -888,16 +893,20 @@ NS_IMETHODIMP
nsPICS::OnStatusChange(nsIWebProgress* aWebProgress,
nsIRequest* aRequest,
nsresult aStatus,
const PRUnichar* aMessage) {
return NS_ERROR_NOT_IMPLEMENTED;
const PRUnichar* aMessage)
{
NS_NOTREACHED("notification excluded in AddProgressListener(...)");
return NS_OK;
}
NS_IMETHODIMP
nsPICS::OnSecurityChange(nsIWebProgress *aWebProgress,
nsIRequest *aRequest,
PRInt32 state) {
return NS_ERROR_NOT_IMPLEMENTED;
PRUint32 state)
{
NS_NOTREACHED("notification excluded in AddProgressListener(...)");
return NS_OK;
}
void

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

@ -389,7 +389,8 @@ nsresult nsWalletlibService::Init()
if (NS_SUCCEEDED(rv) && docLoaderService) {
nsCOMPtr<nsIWebProgress> progress(do_QueryInterface(docLoaderService, &rv));
if (NS_SUCCEEDED(rv))
(void) progress->AddProgressListener((nsIWebProgressListener*)this);
(void) progress->AddProgressListener((nsIWebProgressListener*)this,
nsIWebProgress::NOTIFY_STATE_DOCUMENT);
}
else
NS_ASSERTION(PR_FALSE, "Could not get nsIDocumentLoader");
@ -408,7 +409,7 @@ nsresult nsWalletlibService::Init()
NS_IMETHODIMP
nsWalletlibService::OnStateChange(nsIWebProgress* aWebProgress,
nsIRequest *aRequest,
PRInt32 progressStateFlags,
PRUint32 progressStateFlags,
nsresult aStatus)
{
nsresult rv = NS_OK;
@ -564,7 +565,8 @@ nsWalletlibService::OnProgressChange(nsIWebProgress *aWebProgress,
PRInt32 aCurTotalProgress,
PRInt32 aMaxTotalProgress)
{
return NS_ERROR_NOT_IMPLEMENTED;
NS_NOTREACHED("notification excluded in AddProgressListener(...)");
return NS_OK;
}
NS_IMETHODIMP
@ -572,7 +574,8 @@ nsWalletlibService::OnLocationChange(nsIWebProgress* aWebProgress,
nsIRequest* aRequest,
nsIURI *location)
{
return NS_ERROR_NOT_IMPLEMENTED;
NS_NOTREACHED("notification excluded in AddProgressListener(...)");
return NS_OK;
}
@ -582,16 +585,18 @@ nsWalletlibService::OnStatusChange(nsIWebProgress* aWebProgress,
nsresult aStatus,
const PRUnichar* aMessage)
{
return NS_ERROR_NOT_IMPLEMENTED;
NS_NOTREACHED("notification excluded in AddProgressListener(...)");
return NS_OK;
}
NS_IMETHODIMP
nsWalletlibService::OnSecurityChange(nsIWebProgress *aWebProgress,
nsIRequest *aRequest,
PRInt32 state)
PRUint32 state)
{
return NS_ERROR_NOT_IMPLEMENTED;
NS_NOTREACHED("notification excluded in AddProgressListener(...)");
return NS_OK;
}

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

@ -224,7 +224,8 @@ NS_IMETHODIMP mozXMLTerminal::Init(nsIDocShell* aDocShell,
nsCOMPtr<nsIWebProgress> progress(do_GetInterface(aDocShell, &result));
if (NS_FAILED(result)) return result;
result = progress->AddProgressListener((nsIWebProgressListener*)this);
result = progress->AddProgressListener((nsIWebProgressListener*)this,
nsIWebProgress::NOTIFY_STATE_REQUEST);
if (NS_FAILED(result))
return NS_ERROR_FAILURE;
@ -1035,7 +1036,7 @@ NS_IMETHODIMP mozXMLTerminal::ExportHTML(const PRUnichar* aFilename,
NS_IMETHODIMP
mozXMLTerminal::OnStateChange(nsIWebProgress* aWebProgress,
nsIRequest *aRequest,
PRInt32 progressStateFlags,
PRUint32 progressStateFlags,
nsresult aStatus) {
if (progressStateFlags & nsIWebProgressListener::STATE_IS_REQUEST)
if (progressStateFlags & nsIWebProgressListener::STATE_START) {
@ -1055,14 +1056,16 @@ mozXMLTerminal::OnProgressChange(nsIWebProgress *aWebProgress,
PRInt32 aMaxSelfProgress,
PRInt32 aCurTotalProgress,
PRInt32 aMaxTotalProgress) {
return NS_ERROR_NOT_IMPLEMENTED;
NS_NOTREACHED("notification excluded in AddProgressListener(...)");
return NS_OK;
}
NS_IMETHODIMP
mozXMLTerminal::OnLocationChange(nsIWebProgress* aWebProgress,
nsIRequest* aRequest,
nsIURI *location) {
return NS_ERROR_NOT_IMPLEMENTED;
NS_NOTREACHED("notification excluded in AddProgressListener(...)");
return NS_OK;
}
@ -1071,13 +1074,15 @@ mozXMLTerminal::OnStatusChange(nsIWebProgress* aWebProgress,
nsIRequest* aRequest,
nsresult aStatus,
const PRUnichar* aMessage) {
return NS_ERROR_NOT_IMPLEMENTED;
NS_NOTREACHED("notification excluded in AddProgressListener(...)");
return NS_OK;
}
NS_IMETHODIMP
mozXMLTerminal::OnSecurityChange(nsIWebProgress *aWebProgress,
nsIRequest *aRequest,
PRInt32 state) {
return NS_ERROR_NOT_IMPLEMENTED;
PRUint32 state) {
NS_NOTREACHED("notification excluded in AddProgressListener(...)");
return NS_OK;
}

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

@ -165,8 +165,9 @@ public:
NS_IMETHODIMP
CStreamListener::OnStateChange(nsIWebProgress* aWebProgress,
nsIRequest *aRequest,
PRInt32 progressStateFlags,
nsresult aStatus) {
PRUint32 progressStateFlags,
nsresult aStatus)
{
if (progressStateFlags & nsIWebProgressListener::STATE_IS_DOCUMENT)
if (progressStateFlags & nsIWebProgressListener::STATE_STOP) {
fputs("done.\n",stdout);
@ -181,15 +182,19 @@ CStreamListener::OnProgressChange(nsIWebProgress *aWebProgress,
PRInt32 aCurSelfProgress,
PRInt32 aMaxSelfProgress,
PRInt32 aCurTotalProgress,
PRInt32 aMaxTotalProgress) {
return NS_ERROR_NOT_IMPLEMENTED;
PRInt32 aMaxTotalProgress)
{
NS_NOTREACHED("notification excluded in AddProgressListener(...)");
return NS_OK;
}
NS_IMETHODIMP
CStreamListener::OnLocationChange(nsIWebProgress* aWebProgress,
nsIRequest* aRequest,
nsIURI *location) {
return NS_ERROR_NOT_IMPLEMENTED;
nsIURI *location)
{
NS_NOTREACHED("notification excluded in AddProgressListener(...)");
return NS_OK;
}
@ -197,16 +202,20 @@ NS_IMETHODIMP
CStreamListener::OnStatusChange(nsIWebProgress* aWebProgress,
nsIRequest* aRequest,
nsresult aStatus,
const PRUnichar* aMessage) {
return NS_ERROR_NOT_IMPLEMENTED;
const PRUnichar* aMessage)
{
NS_NOTREACHED("notification excluded in AddProgressListener(...)");
return NS_OK;
}
NS_IMETHODIMP
CStreamListener::OnSecurityChange(nsIWebProgress *aWebProgress,
nsIRequest *aRequest,
PRInt32 state) {
return NS_ERROR_NOT_IMPLEMENTED;
PRUint32 state)
{
NS_NOTREACHED("notification excluded in AddProgressListener(...)");
return NS_OK;
}
NS_IMPL_ISUPPORTS2(CStreamListener,
@ -329,7 +338,7 @@ extern "C" NS_EXPORT int DebugRobot(
nsCOMPtr<nsIWebProgress> progress(do_GetInterface(docShell, &rv));
if (NS_FAILED(rv)) return rv;
(void) progress->AddProgressListener(pl);
(void) progress->AddProgressListener(pl, nsIWebProgress::NOTIFY_STATE_DOCUMENT);
nsCAutoString spec;
(void)url->GetSpec(spec);

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

@ -82,7 +82,7 @@ NS_IMPL_ISUPPORTS3(nsMsgPrintEngine,
NS_IMETHODIMP
nsMsgPrintEngine::OnStateChange(nsIWebProgress* aWebProgress,
nsIRequest *aRequest,
PRInt32 progressStateFlags,
PRUint32 progressStateFlags,
nsresult aStatus)
{
nsresult rv = NS_OK;
@ -200,15 +200,19 @@ nsMsgPrintEngine::OnProgressChange(nsIWebProgress *aWebProgress,
PRInt32 aCurSelfProgress,
PRInt32 aMaxSelfProgress,
PRInt32 aCurTotalProgress,
PRInt32 aMaxTotalProgress) {
return NS_ERROR_NOT_IMPLEMENTED;
PRInt32 aMaxTotalProgress)
{
NS_NOTREACHED("notification excluded in AddProgressListener(...)");
return NS_OK;
}
NS_IMETHODIMP
nsMsgPrintEngine::OnLocationChange(nsIWebProgress* aWebProgress,
nsIRequest* aRequest,
nsIURI *location) {
return NS_ERROR_NOT_IMPLEMENTED;
nsIURI *location)
{
NS_NOTREACHED("notification excluded in AddProgressListener(...)");
return NS_OK;
}
@ -216,16 +220,20 @@ NS_IMETHODIMP
nsMsgPrintEngine::OnStatusChange(nsIWebProgress* aWebProgress,
nsIRequest* aRequest,
nsresult aStatus,
const PRUnichar* aMessage) {
return NS_ERROR_NOT_IMPLEMENTED;
const PRUnichar* aMessage)
{
NS_NOTREACHED("notification excluded in AddProgressListener(...)");
return NS_OK;
}
NS_IMETHODIMP
nsMsgPrintEngine::OnSecurityChange(nsIWebProgress *aWebProgress,
nsIRequest *aRequest,
PRInt32 state) {
return NS_ERROR_NOT_IMPLEMENTED;
PRUint32 state)
{
NS_NOTREACHED("notification excluded in AddProgressListener(...)");
return NS_OK;
}
NS_IMETHODIMP
@ -465,7 +473,8 @@ nsMsgPrintEngine::SetupObserver()
nsCOMPtr<nsIWebProgress> progress(do_GetInterface(mDocShell));
NS_ASSERTION(progress, "we were expecting a nsIWebProgress");
if (progress) {
(void) progress->AddProgressListener((nsIWebProgressListener *)this);
(void) progress->AddProgressListener((nsIWebProgressListener *)this,
nsIWebProgress::NOTIFY_STATE_DOCUMENT);
}
}
}

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

@ -179,23 +179,21 @@ NS_IMETHODIMP nsMsgProgress::UnregisterListener(nsIWebProgressListener *listener
return NS_OK;
}
/* void onStateChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in long aStateFlags, in unsigned long aStatus); */
NS_IMETHODIMP nsMsgProgress::OnStateChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, PRInt32 aStateFlags, PRUint32 aStatus)
/* void onStateChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in unsigned long aStateFlags, in nsresult aStatus); */
NS_IMETHODIMP nsMsgProgress::OnStateChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, PRUint32 aStateFlags, nsresult aStatus)
{
nsresult rv = NS_OK;
nsresult rv;
m_pendingStateFlags = aStateFlags;
m_pendingStateValue = aStatus;
if (m_listenerList)
{
PRUint32 count;
PRUint32 count = 0;
PRInt32 i;
rv = m_listenerList->Count(&count);
NS_ASSERTION(NS_SUCCEEDED(rv), "m_listenerList->Count() failed");
if (NS_FAILED(rv))
return rv;
nsCOMPtr<nsISupports> aSupports;
nsCOMPtr<nsIWebProgressListener> aProgressListener;
@ -208,23 +206,21 @@ NS_IMETHODIMP nsMsgProgress::OnStateChange(nsIWebProgress *aWebProgress, nsIRequ
}
}
return rv;
return NS_OK;
}
/* void onProgressChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in long aCurSelfProgress, in long aMaxSelfProgress, in long aCurTotalProgress, in long aMaxTotalProgress); */
NS_IMETHODIMP nsMsgProgress::OnProgressChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, PRInt32 aCurSelfProgress, PRInt32 aMaxSelfProgress, PRInt32 aCurTotalProgress, PRInt32 aMaxTotalProgress)
{
nsresult rv = NS_OK;
nsresult rv;
if (m_listenerList)
{
PRUint32 count;
PRUint32 count = 0;
PRInt32 i;
rv = m_listenerList->Count(&count);
NS_ASSERTION(NS_SUCCEEDED(rv), "m_listenerList->Count() failed");
if (NS_FAILED(rv))
return rv;
nsCOMPtr<nsISupports> aSupports;
nsCOMPtr<nsIWebProgressListener> aProgressListener;
@ -237,31 +233,29 @@ NS_IMETHODIMP nsMsgProgress::OnProgressChange(nsIWebProgress *aWebProgress, nsIR
}
}
return rv;
return NS_OK;
}
/* void onLocationChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in nsIURI location); */
NS_IMETHODIMP nsMsgProgress::OnLocationChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, nsIURI *location)
{
return NS_ERROR_NOT_IMPLEMENTED;
return NS_OK;
}
/* void onStatusChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in nsresult aStatus, in wstring aMessage); */
NS_IMETHODIMP nsMsgProgress::OnStatusChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, nsresult aStatus, const PRUnichar *aMessage)
{
nsresult rv = NS_OK;
nsresult rv;
if (aMessage && *aMessage)
m_pendingStatus = aMessage;
if (m_listenerList)
{
PRUint32 count;
PRUint32 count = 0;
PRInt32 i;
rv = m_listenerList->Count(&count);
NS_ASSERTION(NS_SUCCEEDED(rv), "m_listenerList->Count() failed");
if (NS_FAILED(rv))
return rv;
nsCOMPtr<nsISupports> aSupports;
nsCOMPtr<nsIWebProgressListener> aProgressListener;
@ -274,13 +268,13 @@ NS_IMETHODIMP nsMsgProgress::OnStatusChange(nsIWebProgress *aWebProgress, nsIReq
}
}
return rv;
return NS_OK;
}
/* void onSecurityChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in long state); */
NS_IMETHODIMP nsMsgProgress::OnSecurityChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, PRInt32 state)
/* void onSecurityChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in unsigned long state); */
NS_IMETHODIMP nsMsgProgress::OnSecurityChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, PRUint32 state)
{
return NS_ERROR_NOT_IMPLEMENTED;
return NS_OK;
}
nsresult nsMsgProgress::ReleaseListeners()

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

@ -114,7 +114,7 @@ nsMsgStatusFeedback::OnProgressChange(nsIWebProgress* aWebProgress,
NS_IMETHODIMP
nsMsgStatusFeedback::OnStateChange(nsIWebProgress* aWebProgress,
nsIRequest* aRequest,
PRInt32 aProgressStateFlags,
PRUint32 aProgressStateFlags,
nsresult aStatus)
{
nsresult rv;
@ -171,9 +171,9 @@ nsMsgStatusFeedback::OnStatusChange(nsIWebProgress* aWebProgress,
NS_IMETHODIMP
nsMsgStatusFeedback::OnSecurityChange(nsIWebProgress *aWebProgress,
nsIRequest *aRequest,
PRInt32 state)
PRUint32 state)
{
return NS_ERROR_NOT_IMPLEMENTED;
return NS_OK;
}

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

@ -209,7 +209,7 @@ NS_IMETHODIMP nsMsgWindow::SetStatusFeedback(nsIMsgStatusFeedback * aStatusFeedb
if (webProgress && mStatusFeedback && messageWindowDocShell)
{
nsCOMPtr<nsIWebProgressListener> webProgressListener = do_QueryInterface(mStatusFeedback);
webProgress->AddProgressListener(webProgressListener);
webProgress->AddProgressListener(webProgressListener, nsIWebProgress::NOTIFY_ALL);
}
return NS_OK;

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

@ -307,7 +307,8 @@ NS_IMETHODIMP nsMsgMailNewsUrl::GetLoadGroup(nsILoadGroup **aLoadGroup)
if (statusFeedback && docShell)
{
webProgressListener = do_QueryInterface(statusFeedback);
webProgress->AddProgressListener(webProgressListener);
webProgress->AddProgressListener(webProgressListener,
nsIWebProgress::NOTIFY_ALL);
}
}
#endif

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

@ -1009,7 +1009,7 @@ nsresult nsMsgCompose::SendMsg(MSG_DeliverMode deliverMode, nsIMsgIdentity *ide
}
}
mProgress->OnStateChange(nsnull, nsnull, nsIWebProgressListener::STATE_START, 0);
mProgress->OnStateChange(nsnull, nsnull, nsIWebProgressListener::STATE_START, NS_OK);
}
rv = _SendMsg(deliverMode, identity, entityConversionDone);
@ -2886,8 +2886,8 @@ nsMsgComposeSendListener::GetMessageId(nsCString* aMessageId)
return NS_OK;
}
/* void onStateChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in long aStateFlags, in unsigned long aStatus); */
NS_IMETHODIMP nsMsgComposeSendListener::OnStateChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, PRInt32 aStateFlags, PRUint32 aStatus)
/* void onStateChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in unsigned long aStateFlags, in nsresult aStatus); */
NS_IMETHODIMP nsMsgComposeSendListener::OnStateChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, PRUint32 aStateFlags, nsresult aStatus)
{
if (aStateFlags == nsIWebProgressListener::STATE_STOP)
{
@ -2944,8 +2944,8 @@ NS_IMETHODIMP nsMsgComposeSendListener::OnStatusChange(nsIWebProgress *aWebProgr
return NS_OK;
}
/* void onSecurityChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in long state); */
NS_IMETHODIMP nsMsgComposeSendListener::OnSecurityChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, PRInt32 state)
/* void onSecurityChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in unsigned long state); */
NS_IMETHODIMP nsMsgComposeSendListener::OnSecurityChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, PRUint32 state)
{
/* Ignore this call */
return NS_OK;

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

@ -194,13 +194,11 @@ NS_IMETHODIMP nsMsgComposeProgress::OnStateChange(nsIWebProgress *aWebProgress,
if (m_listenerList)
{
PRUint32 count;
PRUint32 count = 0;
PRInt32 i;
rv = m_listenerList->Count(&count);
NS_ASSERTION(NS_SUCCEEDED(rv), "m_listenerList->Count() failed");
if (NS_FAILED(rv))
return rv;
nsCOMPtr<nsISupports> aSupports;
nsCOMPtr<nsIWebProgressListener> aProgressListener;
@ -213,7 +211,7 @@ NS_IMETHODIMP nsMsgComposeProgress::OnStateChange(nsIWebProgress *aWebProgress,
}
}
return rv;
return NS_OK;
}
/* void onProgressChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in long aCurSelfProgress, in long aMaxSelfProgress, in long aCurTotalProgress, in long aMaxTotalProgress); */
@ -223,13 +221,11 @@ NS_IMETHODIMP nsMsgComposeProgress::OnProgressChange(nsIWebProgress *aWebProgres
if (m_listenerList)
{
PRUint32 count;
PRUint32 count = 0;
PRInt32 i;
rv = m_listenerList->Count(&count);
NS_ASSERTION(NS_SUCCEEDED(rv), "m_listenerList->Count() failed");
if (NS_FAILED(rv))
return rv;
nsCOMPtr<nsISupports> aSupports;
nsCOMPtr<nsIWebProgressListener> aProgressListener;
@ -242,30 +238,28 @@ NS_IMETHODIMP nsMsgComposeProgress::OnProgressChange(nsIWebProgress *aWebProgres
}
}
return rv;
return NS_OK;
}
/* void onLocationChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in nsIURI location); */
NS_IMETHODIMP nsMsgComposeProgress::OnLocationChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, nsIURI *location)
{
return NS_ERROR_NOT_IMPLEMENTED;
return NS_OK;
}
/* void onStatusChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in nsresult aStatus, in wstring aMessage); */
NS_IMETHODIMP nsMsgComposeProgress::OnStatusChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, nsresult aStatus, const PRUnichar *aMessage)
{
nsresult rv = NS_OK;
nsresult rv;
m_pendingStatus = aMessage;
if (m_listenerList)
{
PRUint32 count;
PRUint32 count = 0;
PRInt32 i;
rv = m_listenerList->Count(&count);
NS_ASSERTION(NS_SUCCEEDED(rv), "m_listenerList->Count() failed");
if (NS_FAILED(rv))
return rv;
nsCOMPtr<nsISupports> aSupports;
nsCOMPtr<nsIWebProgressListener> aProgressListener;
@ -278,13 +272,13 @@ NS_IMETHODIMP nsMsgComposeProgress::OnStatusChange(nsIWebProgress *aWebProgress,
}
}
return rv;
return NS_OK;
}
/* void onSecurityChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in long state); */
NS_IMETHODIMP nsMsgComposeProgress::OnSecurityChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, PRInt32 state)
/* void onSecurityChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in unsigned long state); */
NS_IMETHODIMP nsMsgComposeProgress::OnSecurityChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, PRUint32 state)
{
return NS_ERROR_NOT_IMPLEMENTED;
return NS_OK;
}
nsresult nsMsgComposeProgress::ReleaseListeners()

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

@ -213,7 +213,7 @@ nsURLFetcher::SetLoadCookie(nsISupports * aLoadCookie)
nsCOMPtr<nsIWebProgress> webProgress(do_QueryInterface(mLoadCookie));
if (webProgress)
webProgress->AddProgressListener(this);
webProgress->AddProgressListener(this, nsIWebProgress::NOTIFY_STATE_ALL);
}
return NS_OK;
@ -408,7 +408,7 @@ nsURLFetcher::OnProgressChange(nsIWebProgress *aProgress, nsIRequest *aRequest,
NS_IMETHODIMP
nsURLFetcher::OnStateChange(nsIWebProgress *aProgress, nsIRequest *aRequest,
PRInt32 aStateFlags, nsresult aStatus)
PRUint32 aStateFlags, nsresult aStatus)
{
// all we care about is the case where an error occurred (as in we were unable to locate the
// the url....
@ -424,6 +424,7 @@ nsURLFetcher::OnLocationChange(nsIWebProgress* aWebProgress,
nsIRequest* aRequest,
nsIURI *aURI)
{
NS_NOTREACHED("notification excluded in AddProgressListener(...)");
return NS_OK;
}
@ -433,15 +434,17 @@ nsURLFetcher::OnStatusChange(nsIWebProgress* aWebProgress,
nsresult aStatus,
const PRUnichar* aMessage)
{
NS_NOTREACHED("notification excluded in AddProgressListener(...)");
return NS_OK;
}
NS_IMETHODIMP
nsURLFetcher::OnSecurityChange(nsIWebProgress *aWebProgress,
nsIRequest *aRequest,
PRInt32 state)
PRUint32 state)
{
return NS_ERROR_NOT_IMPLEMENTED;
NS_NOTREACHED("notification excluded in AddProgressListener(...)");
return NS_OK;
}

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

@ -32,7 +32,7 @@ interface nsISecureBrowserUI : nsISupports
{
void init(in nsIDOMWindow window);
readonly attribute long state;
readonly attribute unsigned long state;
readonly attribute AString tooltipText;
};

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

@ -50,7 +50,7 @@ interface nsISecurityEventSink : nsISupports
* changed. State flags are in nsIWebProgressListener.idl
*/
void onSecurityChange(in nsISupports i_Context, in long state);
void onSecurityChange(in nsISupports i_Context, in unsigned long state);
};

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

@ -26,7 +26,7 @@
[noscript, uuid(68e21b66-1dd2-11b2-aa67-e2b87175e792)]
interface nsITransportSecurityInfo : nsISupports {
readonly attribute long securityState;
readonly attribute unsigned long securityState;
readonly attribute wstring shortSecurityDescription;
};

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

@ -165,8 +165,9 @@ public:
NS_IMETHODIMP
CStreamListener::OnStateChange(nsIWebProgress* aWebProgress,
nsIRequest *aRequest,
PRInt32 progressStateFlags,
nsresult aStatus) {
PRUint32 progressStateFlags,
nsresult aStatus)
{
if (progressStateFlags & nsIWebProgressListener::STATE_IS_DOCUMENT)
if (progressStateFlags & nsIWebProgressListener::STATE_STOP) {
fputs("done.\n",stdout);
@ -181,15 +182,19 @@ CStreamListener::OnProgressChange(nsIWebProgress *aWebProgress,
PRInt32 aCurSelfProgress,
PRInt32 aMaxSelfProgress,
PRInt32 aCurTotalProgress,
PRInt32 aMaxTotalProgress) {
return NS_ERROR_NOT_IMPLEMENTED;
PRInt32 aMaxTotalProgress)
{
NS_NOTREACHED("notification excluded in AddProgressListener(...)");
return NS_OK;
}
NS_IMETHODIMP
CStreamListener::OnLocationChange(nsIWebProgress* aWebProgress,
nsIRequest* aRequest,
nsIURI *location) {
return NS_ERROR_NOT_IMPLEMENTED;
nsIURI *location)
{
NS_NOTREACHED("notification excluded in AddProgressListener(...)");
return NS_OK;
}
@ -197,16 +202,20 @@ NS_IMETHODIMP
CStreamListener::OnStatusChange(nsIWebProgress* aWebProgress,
nsIRequest* aRequest,
nsresult aStatus,
const PRUnichar* aMessage) {
return NS_ERROR_NOT_IMPLEMENTED;
const PRUnichar* aMessage)
{
NS_NOTREACHED("notification excluded in AddProgressListener(...)");
return NS_OK;
}
NS_IMETHODIMP
CStreamListener::OnSecurityChange(nsIWebProgress *aWebProgress,
nsIRequest *aRequest,
PRInt32 state) {
return NS_ERROR_NOT_IMPLEMENTED;
PRUint32 state)
{
NS_NOTREACHED("notification excluded in AddProgressListener(...)");
return NS_OK;
}
NS_IMPL_ISUPPORTS2(CStreamListener,
@ -329,7 +338,7 @@ extern "C" NS_EXPORT int DebugRobot(
nsCOMPtr<nsIWebProgress> progress(do_GetInterface(docShell, &rv));
if (NS_FAILED(rv)) return rv;
(void) progress->AddProgressListener(pl);
(void) progress->AddProgressListener(pl, nsIWebProgress::NOTIFY_STATE_DOCUMENT);
nsCAutoString spec;
(void)url->GetSpec(spec);

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

@ -156,13 +156,17 @@ nsSecureBrowserUIImpl::Init(nsIDOMWindow *window)
if (!wp) return NS_ERROR_FAILURE;
/* end GetWebProgress */
wp->AddProgressListener(NS_STATIC_CAST(nsIWebProgressListener*,this));
wp->AddProgressListener(NS_STATIC_CAST(nsIWebProgressListener*,this),
nsIWebProgress::NOTIFY_STATE_ALL |
nsIWebProgress::NOTIFY_LOCATION |
nsIWebProgress::NOTIFY_SECURITY);
return NS_OK;
}
NS_IMETHODIMP
nsSecureBrowserUIImpl::GetState(PRInt32* aState)
nsSecureBrowserUIImpl::GetState(PRUint32* aState)
{
NS_ENSURE_ARG(aState);
@ -237,10 +241,10 @@ static nsresult IsChildOfDomWindow(nsIDOMWindow *parent, nsIDOMWindow *child,
return NS_OK;
}
static PRInt32 GetSecurityStateFromChannel(nsIChannel* aChannel)
static PRUint32 GetSecurityStateFromChannel(nsIChannel* aChannel)
{
nsresult res;
PRInt32 securityState;
PRUint32 securityState;
// qi for the psm information about this channel load.
nsCOMPtr<nsISupports> info;
@ -313,6 +317,7 @@ nsSecureBrowserUIImpl::OnProgressChange(nsIWebProgress* aWebProgress,
PRInt32 aCurTotalProgress,
PRInt32 aMaxTotalProgress)
{
NS_NOTREACHED("notification excluded in AddProgressListener(...)");
return NS_OK;
}
@ -331,7 +336,7 @@ void nsSecureBrowserUIImpl::ResetStateTracking()
NS_IMETHODIMP
nsSecureBrowserUIImpl::OnStateChange(nsIWebProgress* aWebProgress,
nsIRequest* aRequest,
PRInt32 aProgressStateFlags,
PRUint32 aProgressStateFlags,
nsresult aStatus)
{
/*
@ -545,7 +550,7 @@ nsSecureBrowserUIImpl::OnStateChange(nsIWebProgress* aWebProgress,
const char *_status = NS_SUCCEEDED(aStatus) ? "1" : "0";
nsCString info;
PRInt32 f = aProgressStateFlags;
PRUint32 f = aProgressStateFlags;
if (f & nsIWebProgressListener::STATE_START)
{
f -= nsIWebProgressListener::STATE_START;
@ -764,15 +769,15 @@ nsSecureBrowserUIImpl::OnStateChange(nsIWebProgress* aWebProgress,
// if we arrive here, LOAD_DOCUMENT_URI is not set
PRInt32 aState = nsIWebProgressListener::STATE_IS_INSECURE;
PRUint32 reqState = nsIWebProgressListener::STATE_IS_INSECURE;
if (channel) {
aState = GetSecurityStateFromChannel(channel);
reqState = GetSecurityStateFromChannel(channel);
}
if (aState & STATE_IS_SECURE)
if (reqState & STATE_IS_SECURE)
{
if (aState & STATE_SECURE_LOW || aState & STATE_SECURE_MED)
if (reqState & STATE_SECURE_LOW || reqState & STATE_SECURE_MED)
{
PR_LOG(gSecureDocLog, PR_LOG_DEBUG,
("SecureUI:%p: OnStateChange: subreq LOW\n", this));
@ -785,7 +790,7 @@ nsSecureBrowserUIImpl::OnStateChange(nsIWebProgress* aWebProgress,
++mSubRequestsHighSecurity;
}
}
else if (aState & STATE_IS_BROKEN)
else if (reqState & STATE_IS_BROKEN)
{
PR_LOG(gSecureDocLog, PR_LOG_DEBUG,
("SecureUI:%p: OnStateChange: subreq BROKEN\n", this));
@ -969,7 +974,7 @@ nsresult nsSecureBrowserUIImpl::FinishedLoadingStateChange(nsIRequest* aRequest)
if (mToplevelEventSink)
{
PRInt32 newState = STATE_IS_INSECURE;
PRUint32 newState = STATE_IS_INSECURE;
switch (newSecurityState)
{
@ -1042,20 +1047,19 @@ nsSecureBrowserUIImpl::OnStatusChange(nsIWebProgress* aWebProgress,
nsresult aStatus,
const PRUnichar* aMessage)
{
NS_NOTREACHED("notification excluded in AddProgressListener(...)");
return NS_OK;
}
nsresult
nsSecureBrowserUIImpl::OnSecurityChange(nsIWebProgress *aWebProgress,
nsIRequest *aRequest,
PRInt32 state)
PRUint32 state)
{
nsresult res = NS_OK;
#if defined(DEBUG)
nsCOMPtr<nsIChannel> channel(do_QueryInterface(aRequest));
if (!channel)
return NS_ERROR_FAILURE;
return NS_OK;
nsCOMPtr<nsIURI> aURI;
channel->GetURI(getter_AddRefs(aURI));
@ -1067,7 +1071,7 @@ nsSecureBrowserUIImpl::OnSecurityChange(nsIWebProgress *aWebProgress,
state, temp.get()));
#endif
return res;
return NS_OK;
}
// nsISSLStatusProvider methods

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

@ -96,7 +96,7 @@ protected:
lockIconState mPreviousSecurityState;
void ResetStateTracking();
PRInt32 mNewToplevelSecurityState;
PRUint32 mNewToplevelSecurityState;
nsXPIDLString mInfoTooltip;
PRInt32 mDocumentRequestsInProgress;
PRInt32 mSubRequestsInProgress;

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

@ -256,14 +256,14 @@ nsNSSSocketInfo::SetNotificationCallbacks(nsIInterfaceRequestor* aCallbacks)
}
NS_IMETHODIMP
nsNSSSocketInfo::GetSecurityState(PRInt32* state)
nsNSSSocketInfo::GetSecurityState(PRUint32* state)
{
*state = mSecurityState;
return NS_OK;
}
nsresult
nsNSSSocketInfo::SetSecurityState(PRInt32 aState)
nsNSSSocketInfo::SetSecurityState(PRUint32 aState)
{
mSecurityState = aState;
return NS_OK;

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

@ -53,7 +53,7 @@ public:
NS_DECL_NSIINTERFACEREQUESTOR
NS_DECL_NSISSLSTATUSPROVIDER
nsresult SetSecurityState(PRInt32 aState);
nsresult SetSecurityState(PRUint32 aState);
nsresult SetShortSecurityDescription(const PRUnichar *aText);
nsresult SetForTLSStepUp(PRBool useTLS);
@ -82,7 +82,7 @@ public:
protected:
nsCOMPtr<nsIInterfaceRequestor> mCallbacks;
PRFileDesc* mFd;
PRInt32 mSecurityState;
PRUint32 mSecurityState;
nsString mShortDesc;
PRBool mForTLSStepUp;
PRBool mFirstWrite;

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

@ -107,7 +107,23 @@ struct nsRequestInfo {
};
struct nsListenerInfo {
nsListenerInfo(nsIWeakReference *aListener, unsigned long aNotifyMask)
: mWeakListener(aListener),
mNotifyMask(aNotifyMask)
{
}
// Weak pointer for the nsIWebProgressListener...
nsWeakPtr mWeakListener;
// Mask indicating which notifications the listener wants to receive.
unsigned long mNotifyMask;
};
nsDocLoaderImpl::nsDocLoaderImpl()
: mListenerInfoList(8)
{
NS_INIT_REFCNT();
@ -145,10 +161,7 @@ nsDocLoaderImpl::Init()
PR_LOG(gDocLoaderLog, PR_LOG_DEBUG,
("DocLoader:%p: load group %x.\n", this, mLoadGroup.get()));
rv = NS_NewISupportsArray(getter_AddRefs(mChildList));
if (NS_FAILED(rv)) return rv;
return NS_NewISupportsArray(getter_AddRefs(mListenerList));
return NS_NewISupportsArray(getter_AddRefs(mChildList));
}
NS_IMETHODIMP nsDocLoaderImpl::ClearParentDocLoader()
@ -410,8 +423,22 @@ nsDocLoaderImpl::Destroy()
mParent = nsnull;
}
// Release all the information about network requests...
ClearRequestInfoList();
// Release all the information about registered listeners...
nsListenerInfo *info;
PRInt32 i, count;
count = mListenerInfoList.Count();
for(i=0; i<count; i++) {
info = NS_STATIC_CAST(nsListenerInfo*,mListenerInfoList.ElementAt(i));
delete info;
}
mListenerInfoList.Clear();
mListenerInfoList.Compact();
mDocumentRequest = 0;
mLoadGroup->SetGroupObserver(nsnull);
@ -723,7 +750,7 @@ void nsDocLoaderImpl::doStopDocumentLoad(nsIRequest *request,
#endif /* DEBUG */
//
// Fire an OnStatusChange(...) notification indicating the the
// Fire an OnStateChange(...) notification indicating the the
// current document has finished loading...
//
FireOnStateChange(this,
@ -733,7 +760,7 @@ void nsDocLoaderImpl::doStopDocumentLoad(nsIRequest *request,
aStatus);
//
// Fire a final OnStatusChange(...) notification indicating the the
// Fire a final OnStateChange(...) notification indicating the the
// current document has finished loading...
//
FireOnStateChange(this,
@ -760,32 +787,49 @@ nsresult nsDocLoaderImpl::GetParentWebProgressListener(nsDocLoaderImpl * aDocLoa
}
NS_IMETHODIMP
nsDocLoaderImpl::AddProgressListener(nsIWebProgressListener *aListener)
nsDocLoaderImpl::AddProgressListener(nsIWebProgressListener *aListener,
PRUint32 aNotifyMask)
{
nsresult rv;
nsWeakPtr listener = getter_AddRefs(NS_GetWeakReference(aListener));
if (!listener) return NS_ERROR_INVALID_ARG;
if (mListenerList->IndexOf(listener) == -1) {
// XXX this method incorrectly returns a bool
rv = mListenerList->AppendElement(listener) ? NS_OK : NS_ERROR_FAILURE;
} else {
// The listener is already in the list...
rv = NS_ERROR_FAILURE;
if (!listener) {
return NS_ERROR_INVALID_ARG;
}
nsListenerInfo* info = GetListenerInfo(listener);
if (info) {
// The listener is already registered!
return NS_ERROR_FAILURE;
}
info = new nsListenerInfo(listener, aNotifyMask);
if (!info) {
return NS_ERROR_OUT_OF_MEMORY;
}
// XXX this method incorrectly returns a bool
rv = mListenerInfoList.AppendElement(info) ? NS_OK : NS_ERROR_FAILURE;
return rv;
}
NS_IMETHODIMP
nsDocLoaderImpl::RemoveProgressListener(nsIWebProgressListener *aListener)
{
nsresult rv;
nsWeakPtr listener = getter_AddRefs(NS_GetWeakReference(aListener));
if (!listener) return NS_ERROR_INVALID_ARG;
if (!listener) {
return NS_ERROR_INVALID_ARG;
}
// XXX this method incorrectly returns a bool
return mListenerList->RemoveElement(listener) ? NS_OK : NS_ERROR_FAILURE;
nsListenerInfo* info = GetListenerInfo(listener);
if (info) {
rv = mListenerInfoList.RemoveElement(info) ? NS_OK : NS_ERROR_FAILURE;
delete info;
} else {
// The listener is not registered!
rv = NS_ERROR_FAILURE;
}
return rv;
}
NS_IMETHODIMP
@ -810,30 +854,6 @@ nsDocLoaderImpl::GetDOMWindow(nsIDOMWindow **aResult)
return rv;
}
nsresult nsDocLoaderImpl::GetProgressStatusFlags(PRInt32 *aProgressStateFlags)
{
*aProgressStateFlags = mProgressStateFlags;
return NS_OK;
}
nsresult nsDocLoaderImpl::GetCurSelfProgress(PRInt32 *aCurSelfProgress)
{
*aCurSelfProgress = mCurrentSelfProgress;
return NS_OK;
}
nsresult nsDocLoaderImpl::GetMaxSelfProgress(PRInt32 *aMaxSelfProgress)
{
*aMaxSelfProgress = mMaxSelfProgress;
return NS_OK;
}
nsresult nsDocLoaderImpl::GetCurTotalProgress(PRInt32 *aCurTotalProgress)
{
*aCurTotalProgress = mCurrentTotalProgress;
return NS_OK;
}
nsresult nsDocLoaderImpl::GetMaxTotalProgress(PRInt32 *aMaxTotalProgress)
{
PRUint32 count = 0;
@ -991,8 +1011,6 @@ void nsDocLoaderImpl::FireOnProgressChange(nsDocLoaderImpl *aLoadInitiator,
PRInt32 aTotalProgress,
PRInt32 aMaxTotalProgress)
{
PRUint32 count;
if (mIsLoadingDocument) {
mCurrentTotalProgress += aProgressDelta;
GetMaxTotalProgress(&mMaxTotalProgress);
@ -1016,19 +1034,23 @@ void nsDocLoaderImpl::FireOnProgressChange(nsDocLoaderImpl *aLoadInitiator,
* Operate the elements from back to front so that if items get
* get removed from the list it won't affect our iteration
*/
(void)mListenerList->Count(&count);
while (count > 0) {
nsCOMPtr<nsISupports> supports;
nsresult rv = mListenerList->GetElementAt(--count, getter_AddRefs(supports));
if (NS_FAILED(rv)) return;
nsWeakPtr weakPtr = do_QueryInterface(supports);
nsCOMPtr<nsIWebProgressListener> listener;
PRInt32 count = mListenerInfoList.Count();
nsCOMPtr<nsIWebProgressListener> listener;
listener = do_QueryReferent(weakPtr);
while (--count >= 0) {
nsListenerInfo *info;
info = NS_STATIC_CAST(nsListenerInfo*,mListenerInfoList.ElementAt(count));
if (!(info->mNotifyMask & nsIWebProgress::NOTIFY_PROGRESS)) {
continue;
}
listener = do_QueryReferent(info->mWeakListener);
if (!listener) {
// the listener went away. gracefully pull it out of the list.
mListenerList->RemoveElementAt(count);
continue;
// the listener went away. gracefully pull it out of the list.
mListenerInfoList.RemoveElementAt(count);
delete info;
continue;
}
listener->OnProgressChange(aLoadInitiator,request,
@ -1036,7 +1058,7 @@ void nsDocLoaderImpl::FireOnProgressChange(nsDocLoaderImpl *aLoadInitiator,
aTotalProgress, aMaxTotalProgress);
}
mListenerList->Compact();
mListenerInfoList.Compact();
// Pass the notification up to the parent...
if (mParent) {
@ -1054,8 +1076,6 @@ void nsDocLoaderImpl::FireOnStateChange(nsIWebProgress *aProgress,
PRInt32 aStateFlags,
nsresult aStatus)
{
PRUint32 count;
//
// Remove the STATE_IS_NETWORK bit if necessary.
//
@ -1086,25 +1106,29 @@ void nsDocLoaderImpl::FireOnStateChange(nsIWebProgress *aProgress,
* Operate the elements from back to front so that if items get
* get removed from the list it won't affect our iteration
*/
(void)mListenerList->Count(&count);
while (count > 0) {
nsCOMPtr<nsISupports> supports;
nsresult rv = mListenerList->GetElementAt(--count, getter_AddRefs(supports));
if (NS_FAILED(rv)) return;
nsWeakPtr weakPtr = do_QueryInterface(supports);
nsCOMPtr<nsIWebProgressListener> listener;
PRInt32 count = mListenerInfoList.Count();
nsCOMPtr<nsIWebProgressListener> listener;
listener = do_QueryReferent(weakPtr);
while (--count >= 0) {
nsListenerInfo *info;
info = NS_STATIC_CAST(nsListenerInfo*,mListenerInfoList.ElementAt(count));
if (!(info->mNotifyMask & (aStateFlags >>16))) {
continue;
}
listener = do_QueryReferent(info->mWeakListener);
if (!listener) {
// the listener went away, gracefully pull it out of the list.
mListenerList->RemoveElementAt(count);
continue;
// the listener went away. gracefully pull it out of the list.
mListenerInfoList.RemoveElementAt(count);
delete info;
continue;
}
listener->OnStateChange(aProgress, aRequest, aStateFlags, aStatus);
}
mListenerList->Compact();
mListenerInfoList.Compact();
// Pass the notification up to the parent...
if (mParent) {
@ -1119,27 +1143,36 @@ nsDocLoaderImpl::FireOnLocationChange(nsIWebProgress* aWebProgress,
nsIRequest* aRequest,
nsIURI *aUri)
{
PRUint32 count;
/*
* First notify any listeners of the new state info...
*
* Operate the elements from back to front so that if items get
* get removed from the list it won't affect our iteration
*/
nsCOMPtr<nsIWebProgressListener> listener;
PRInt32 count = mListenerInfoList.Count();
(void)mListenerList->Count(&count);
while (count > 0) {
nsCOMPtr<nsISupports> supports;
nsresult rv = mListenerList->GetElementAt(--count, getter_AddRefs(supports));
if (NS_FAILED(rv)) return rv;
nsWeakPtr weakPtr = do_QueryInterface(supports);
while (--count >= 0) {
nsListenerInfo *info;
nsCOMPtr<nsIWebProgressListener> listener;
listener = do_QueryReferent(weakPtr);
info = NS_STATIC_CAST(nsListenerInfo*,mListenerInfoList.ElementAt(count));
if (!(info->mNotifyMask & nsIWebProgress::NOTIFY_LOCATION)) {
continue;
}
listener = do_QueryReferent(info->mWeakListener);
if (!listener) {
// the listener went away. gracefully pull it out of the list.
mListenerList->RemoveElementAt(count);
continue;
// the listener went away. gracefully pull it out of the list.
mListenerInfoList.RemoveElementAt(count);
delete info;
continue;
}
listener->OnLocationChange(aWebProgress, aRequest, aUri);
}
mListenerList->Compact();
mListenerInfoList.Compact();
// Pass the notification up to the parent...
if (mParent) {
mParent->FireOnLocationChange(aWebProgress, aRequest, aUri);
@ -1154,30 +1187,60 @@ nsDocLoaderImpl::FireOnStatusChange(nsIWebProgress* aWebProgress,
nsresult aStatus,
const PRUnichar* aMessage)
{
PRUint32 count;
/*
* First notify any listeners of the new state info...
*
* Operate the elements from back to front so that if items get
* get removed from the list it won't affect our iteration
*/
nsCOMPtr<nsIWebProgressListener> listener;
PRInt32 count = mListenerInfoList.Count();
(void)mListenerList->Count(&count);
while (count > 0) {
nsCOMPtr<nsISupports> supports;
nsresult rv = mListenerList->GetElementAt(--count, getter_AddRefs(supports));
if (NS_FAILED(rv)) return rv;
nsWeakPtr weakPtr = do_QueryInterface(supports);
while (--count >= 0) {
nsListenerInfo *info;
nsCOMPtr<nsIWebProgressListener> listener;
listener = do_QueryReferent(weakPtr);
info = NS_STATIC_CAST(nsListenerInfo*,mListenerInfoList.ElementAt(count));
if (!(info->mNotifyMask & nsIWebProgress::NOTIFY_STATUS)) {
continue;
}
listener = do_QueryReferent(info->mWeakListener);
if (!listener) {
// the listener went away. gracefully pull it out of the list.
mListenerList->RemoveElementAt(count);
continue;
// the listener went away. gracefully pull it out of the list.
mListenerInfoList.RemoveElementAt(count);
delete info;
continue;
}
listener->OnStatusChange(aWebProgress, aRequest, aStatus, aMessage);
}
mListenerList->Compact();
mListenerInfoList.Compact();
// Pass the notification up to the parent...
if (mParent) {
mParent->FireOnStatusChange(aWebProgress, aRequest, aStatus, aMessage);
}
return NS_OK;
}
nsListenerInfo *
nsDocLoaderImpl::GetListenerInfo(nsIWeakReference *aListener)
{
PRInt32 i, count;
nsListenerInfo *info;
count = mListenerInfoList.Count();
for (i=0; i<count; i++) {
info = NS_STATIC_CAST(nsListenerInfo* ,mListenerInfoList.ElementAt(i));
if (aListener == info->mWeakListener) {
return info;
}
}
return nsnull;
}
nsresult nsDocLoaderImpl::AddRequestInfo(nsIRequest *aRequest)
{
nsresult rv;
@ -1200,7 +1263,7 @@ nsRequestInfo * nsDocLoaderImpl::GetRequestInfo(nsIRequest *aRequest)
count = mRequestInfoList.Count();
for(i=0; i<count; i++) {
info = (nsRequestInfo *)mRequestInfoList.ElementAt(i);
info = NS_STATIC_CAST(nsRequestInfo*, mRequestInfoList.ElementAt(i));
if (aRequest == info->mKey) {
return info;
}
@ -1216,7 +1279,7 @@ nsresult nsDocLoaderImpl::ClearRequestInfoList(void)
count = mRequestInfoList.Count();
for(i=0; i<count; i++) {
info = (nsRequestInfo *)mRequestInfoList.ElementAt(i);
info = NS_STATIC_CAST(nsRequestInfo*, mRequestInfoList.ElementAt(i));
delete info;
}
@ -1235,7 +1298,7 @@ void nsDocLoaderImpl::CalculateMaxProgress(PRInt32 *aMax)
for(i=0; i<count; i++) {
nsRequestInfo *info;
info = (nsRequestInfo *)mRequestInfoList.ElementAt(i);
info = NS_STATIC_CAST(nsRequestInfo*, mRequestInfoList.ElementAt(i));
current += info->mCurrentProgress;
if (max >= 0) {
@ -1296,8 +1359,12 @@ NS_IMETHODIMP nsDocLoaderImpl::OnRedirect(nsIHttpChannel *aOldChannel, nsIChanne
return NS_OK;
}
/*
* Implementation of nsISecurityEventSink method...
*/
NS_IMETHODIMP nsDocLoaderImpl::OnSecurityChange(nsISupports * aContext,
PRInt32 state)
PRUint32 aState)
{
//
// Fire progress notifications out to any registered nsIWebProgressListeners.
@ -1306,30 +1373,39 @@ NS_IMETHODIMP nsDocLoaderImpl::OnSecurityChange(nsISupports * aContext,
nsCOMPtr<nsIRequest> request = do_QueryInterface(aContext);
nsIWebProgress* webProgress = NS_STATIC_CAST(nsIWebProgress*, this);
PRUint32 count;
(void)mListenerList->Count(&count);
/*
* First notify any listeners of the new state info...
*
* Operate the elements from back to front so that if items get
* get removed from the list it won't affect our iteration
*/
nsCOMPtr<nsIWebProgressListener> listener;
PRInt32 count = mListenerInfoList.Count();
while (count > 0) {
nsCOMPtr<nsISupports> supports;
nsresult rv = mListenerList->GetElementAt(--count, getter_AddRefs(supports));
if (NS_FAILED(rv)) return rv;
nsWeakPtr weakPtr = do_QueryInterface(supports);
while (--count >= 0) {
nsListenerInfo *info;
nsCOMPtr<nsIWebProgressListener> listener;
listener = do_QueryReferent(weakPtr);
if (!listener) {
// the listener went away. gracefully pull it out of the list.
mListenerList->RemoveElementAt(count);
continue;
info = NS_STATIC_CAST(nsListenerInfo*,mListenerInfoList.ElementAt(count));
if (!(info->mNotifyMask & nsIWebProgress::NOTIFY_SECURITY)) {
continue;
}
listener->OnSecurityChange(webProgress, request, state);
listener = do_QueryReferent(info->mWeakListener);
if (!listener) {
// the listener went away. gracefully pull it out of the list.
mListenerInfoList.RemoveElementAt(count);
delete info;
continue;
}
listener->OnSecurityChange(webProgress, request, aState);
}
mListenerList->Compact();
mListenerInfoList.Compact();
// Pass the notification up to the parent...
if (mParent) {
mParent->OnSecurityChange(aContext, state);
mParent->OnSecurityChange(aContext, aState);
}
return NS_OK;
}

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

@ -59,6 +59,7 @@
#include "nsCOMPtr.h"
struct nsRequestInfo;
struct nsListenerInfo;
/****************************************************************************
* nsDocLoaderImpl implementation...
@ -137,13 +138,11 @@ protected:
// class, please make the ownership explicit (pinkerton, scc).
nsCOMPtr<nsIRequest> mDocumentRequest; // [OWNER] ???compare with document
nsCOMPtr<nsISupportsArray> mListenerList;
nsISupports* mContainer; // [WEAK] it owns me!
nsDocLoaderImpl* mParent; // [WEAK]
nsCString mCommand;
nsVoidArray mListenerInfoList;
/*
* This flag indicates that the loader is loading a document. It is set
* from the call to LoadDocument(...) until the OnConnectionsComplete(...)
@ -168,10 +167,8 @@ protected:
nsAutoVoidArray mRequestInfoList;
private:
nsresult GetProgressStatusFlags(PRInt32* aProgressStatusFlags);
nsresult GetCurSelfProgress(PRInt32* aCurSelfProgress);
nsresult GetMaxSelfProgress(PRInt32* aMaxSelfProgress);
nsresult GetCurTotalProgress(PRInt32* aCurTotalProgress);
nsListenerInfo *GetListenerInfo(nsIWeakReference* aListener);
nsresult GetMaxTotalProgress(PRInt32* aMaxTotalProgress);
nsresult AddRequestInfo(nsIRequest* aRequest);

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

@ -35,18 +35,34 @@ interface nsIWebProgressListener;
[scriptable, uuid(570F39D0-EFD0-11d3-B093-00A024FFC08C)]
interface nsIWebProgress : nsISupports
{
const unsigned long NOTIFY_STATE_REQUEST = 0x00000001;
const unsigned long NOTIFY_STATE_DOCUMENT = 0x00000002;
const unsigned long NOTIFY_STATE_NETWORK = 0x00000004;
const unsigned long NOTIFY_STATE_WINDOW = 0x00000008;
const unsigned long NOTIFY_STATE_ALL = 0x0000000f;
const unsigned long NOTIFY_PROGRESS = 0x00000010;
const unsigned long NOTIFY_STATUS = 0x00000020;
const unsigned long NOTIFY_SECURITY = 0x00000040;
const unsigned long NOTIFY_LOCATION = 0x00000080;
const unsigned long NOTIFY_ALL = 0x000000ff;
/**
* Registers a listener to be notified of Progress Events
*
* @param listener - The listener interface to be called when a progress
* event occurs.
*
* @param aNotifyMask - The types of notifications to receive.
*
* @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.
*/
void addProgressListener(in nsIWebProgressListener listener);
void addProgressListener(in nsIWebProgressListener listener,
in unsigned long aNotifyMask);
/**
* Removes a previously registered listener of Progress Events

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

@ -29,129 +29,138 @@
* @status UNDER_REVIEW
*/
interface nsIRequest;
interface nsIWebProgress;
interface nsIChannel;
interface nsIRequest;
interface nsIURI;
[scriptable, uuid(570F39D1-EFD0-11d3-B093-00A024FFC08C)]
interface nsIWebProgressListener : nsISupports
{
/**
* Progress state transition bits.
* These flags indicate the various states that documents and requests
* may transition through as they are being loaded.
*/
const unsigned long STATE_START = 0x00000001;
const unsigned long STATE_REDIRECTING = 0x00000002;
const unsigned long STATE_TRANSFERRING = 0x00000004;
const unsigned long STATE_NEGOTIATING = 0x00000008;
const unsigned long STATE_STOP = 0x00000010;
/**
* Progress state transition bits.
* These flags indicate the various states that documents and requests
* may transition through as they are being loaded.
*/
const unsigned long STATE_START = 0x00000001;
const unsigned long STATE_REDIRECTING = 0x00000002;
const unsigned long STATE_TRANSFERRING = 0x00000004;
const unsigned long STATE_NEGOTIATING = 0x00000008;
const unsigned long STATE_STOP = 0x00000010;
/**
* Progress type bits.
* These flags indicate whether the transition is occuring on a document
* or an individual request within the document.
*/
const unsigned long STATE_IS_REQUEST = 0x00010000;
const unsigned long STATE_IS_DOCUMENT = 0x00020000;
const unsigned long STATE_IS_NETWORK = 0x00040000;
const unsigned long STATE_IS_WINDOW = 0x00080000;
/**
* Security state bits
*/
const unsigned long STATE_IS_INSECURE = 0x00000000;
const unsigned long STATE_IS_BROKEN = 0x00000001;
const unsigned long STATE_IS_SECURE = 0x00000002;
/**
* Progress State type bits.
* These flags indicate whether the transition is occuring on a document
* or an individual request within the document.
*/
const unsigned long STATE_IS_REQUEST = 0x00010000;
const unsigned long STATE_IS_DOCUMENT = 0x00020000;
const unsigned long STATE_IS_NETWORK = 0x00040000;
const unsigned long STATE_IS_WINDOW = 0x00080000;
const unsigned long STATE_SECURE_HIGH = 0x00000000;
const unsigned long STATE_SECURE_MED = 0x00010000;
const unsigned long STATE_SECURE_LOW = 0x00020000;
/**
* Security state bits
*/
const unsigned long STATE_IS_INSECURE = 0x00000004;
const unsigned long STATE_IS_BROKEN = 0x00000001;
const unsigned long STATE_IS_SECURE = 0x00000002;
const unsigned long STATE_SECURE_HIGH = 0x00040000;
const unsigned long STATE_SECURE_MED = 0x00010000;
const unsigned long STATE_SECURE_LOW = 0x00020000;
/**
* Notification indicating the state has changed for one of the requests
* associated with the document loaded.
*
* @param aWebProgress The nsIWebProgress instance that fired the
* notification
*
* @param aRequest The nsIRequest which has changed state.
*
* @param aStateFlags Flags indicating the state change.
*
* @param aStatus Status code for the state change.
*/
void onStateChange(in nsIWebProgress aWebProgress,
in nsIRequest aRequest,
in long aStateFlags, // XXX TODO unsigned long
in unsigned long aStatus);
/**
* Notification indicating the state has changed for one of the requests
* associated with the document loaded.
*
* @param aWebProgress The nsIWebProgress instance that fired the
* notification
*
* @param aRequest The nsIRequest which has changed state.
*
* @param aStateFlags Flags indicating the state change.
*
* @param aStatus Status code for the state change.
*
* @return NS_OK should always be returned.
*/
void onStateChange(in nsIWebProgress aWebProgress,
in nsIRequest aRequest,
in unsigned long aStateFlags,
in nsresult aStatus);
/**
* Notification that the progress has changed for one of the requests being
* monitored.
*
* @param aWebProgress The nsIWebProgress instance that fired the
* notification
*
* @param aRequest The nsIRequest that has new progress.
*
* @param aCurSelfProgress The current progress for aRequest.
*
* @param aMaxSelfProgress The maximum progress for aRequest. If this
* value is not known then -1 is passed.
*
* @param aCurTotalProgress The current progress for all the requests
* being monitored.
*
* @param aMaxTotalProgress The total progress for all the requests being
* monitored. If this value is not known then
* -1 is passed.
*/
void onProgressChange(in nsIWebProgress aWebProgress,
in nsIRequest aRequest,
in long aCurSelfProgress,
in long aMaxSelfProgress,
in long aCurTotalProgress,
in long aMaxTotalProgress);
/*
Called when the window being watched changes the location that is currently.
This is not when a load is requested, but rather once it is verified that
the load is going to occur in the given window. For instance, a load that
starts in a window might send progress and status messages, for the new site
but it will not send the onLocationChange until we are sure we are loading
this new page here.
@param location - The URI of the location that is being loaded.
*/
void onLocationChange(in nsIWebProgress aWebProgress,
in nsIRequest aRequest,
in nsIURI location);
/**
* Notification that the status has changed. The status message is usually
* printed in the status bar of the browser.
*/
void onStatusChange(in nsIWebProgress aWebProgress,
/**
* Notification that the progress has changed for one of the requests being
* monitored.
*
* @param aWebProgress The nsIWebProgress instance that fired the
* notification
*
* @param aRequest The nsIRequest that has new progress.
*
* @param aCurSelfProgress The current progress for aRequest.
*
* @param aMaxSelfProgress The maximum progress for aRequest. If this
* value is not known then -1 is passed.
*
* @param aCurTotalProgress The current progress for all the requests
* being monitored.
*
* @param aMaxTotalProgress The total progress for all the requests being
* monitored. If this value is not known then
* -1 is passed.
*
* @return NS_OK should always be returned.
*/
void onProgressChange(in nsIWebProgress aWebProgress,
in nsIRequest aRequest,
in nsresult aStatus,
in wstring aMessage);
in long aCurSelfProgress,
in long aMaxSelfProgress,
in long aCurTotalProgress,
in long aMaxTotalProgress);
/**
* Called when the window being watched changes the location that is currently.
* This is not when a load is requested, but rather once it is verified that
* the load is going to occur in the given window. For instance, a load that
* starts in a window might send progress and status messages, for the new site
* but it will not send the onLocationChange until we are sure we are loading
* this new page here.
*
* @param location The URI of the location that is being loaded.
*
* @return NS_OK should always be returned.
*/
void onLocationChange(in nsIWebProgress aWebProgress,
in nsIRequest aRequest,
in nsIURI location);
/**
* Notification that the status has changed. The status message is usually
* printed in the status bar of the browser.
*
* @return NS_OK should always be returned.
*/
void onStatusChange(in nsIWebProgress aWebProgress,
in nsIRequest aRequest,
in nsresult aStatus,
in wstring aMessage);
/**
* Notification called for security progress.
* This method will be called on security transitions (eg HTTP -> HTTPS,
* HTTPS -> HTTP, FOO -> https) and after document load completion.
* It might also be called if an error occurs during network loading.
*
* These notification will only occur if a security package is installed.
*/
/**
* Notification called for security progress.
* This method will be called on security transitions (eg HTTP -> HTTPS,
* HTTPS -> HTTP, FOO -> https) and after document load completion.
* It might also be called if an error occurs during network loading.
*
* These notification will only occur if a security package is installed.
*
* @return NS_OK should always be returned.
*/
void onSecurityChange(in nsIWebProgress aWebProgress,
in nsIRequest aRequest,
in long state);
void onSecurityChange(in nsIWebProgress aWebProgress,
in nsIRequest aRequest,
in unsigned long state);
};

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

@ -35,7 +35,6 @@
// Interfaces needed to be included
#include "nsIDocShellTreeItem.h"
#include "nsIWebProgress.h"
#include "nsIChannel.h"
#include "nsIURI.h"
#include "nsIDOMWindow.h"
@ -405,7 +404,7 @@ nsWebBrowserChrome::OnProgressChange(nsIWebProgress* aProgress,
NS_IMETHODIMP
nsWebBrowserChrome::OnStateChange(nsIWebProgress* aProgress,
nsIRequest* aRequest,
PRInt32 aProgressStateFlags,
PRUint32 aProgressStateFlags,
nsresult aStatus)
{
if (aProgressStateFlags & STATE_START) {
@ -500,9 +499,9 @@ nsWebBrowserChrome::OnStatusChange(nsIWebProgress* aWebProgress,
NS_IMETHODIMP
nsWebBrowserChrome::OnSecurityChange(nsIWebProgress *aWebProgress,
nsIRequest *aRequest,
PRInt32 state)
PRUint32 state)
{
return NS_ERROR_NOT_IMPLEMENTED;
return NS_OK;
}
//*****************************************************************************

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

@ -35,6 +35,7 @@
#include "nsIInterfaceRequestor.h"
#include "nsIInterfaceRequestorUtils.h"
#include "nsIWebProgressListener.h"
#include "nsIChannel.h"
#include "nsTimer.h"
#include "nsWeakReference.h"

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

@ -361,7 +361,7 @@ nsWebCrawler::QueueExitCallback(nsITimer *aTimer, void *aClosure)
NS_IMETHODIMP
nsWebCrawler::OnStateChange(nsIWebProgress* aWebProgress,
nsIRequest* aRequest,
PRInt32 progressStateFlags,
PRUint32 progressStateFlags,
nsresult aStatus)
{
// Make sure that we're being notified for _our_ shell, and not some
@ -479,8 +479,10 @@ nsWebCrawler::OnProgressChange(nsIWebProgress *aWebProgress,
PRInt32 aCurSelfProgress,
PRInt32 aMaxSelfProgress,
PRInt32 aCurTotalProgress,
PRInt32 aMaxTotalProgress) {
return NS_ERROR_NOT_IMPLEMENTED;
PRInt32 aMaxTotalProgress)
{
NS_NOTREACHED("notification excluded in AddProgressListener(...)");
return NS_OK;
}
NS_IMETHODIMP
@ -488,7 +490,8 @@ nsWebCrawler::OnLocationChange(nsIWebProgress* aWebProgress,
nsIRequest* aRequest,
nsIURI *location)
{
return NS_ERROR_NOT_IMPLEMENTED;
NS_NOTREACHED("notification excluded in AddProgressListener(...)");
return NS_OK;
}
@ -498,16 +501,18 @@ nsWebCrawler::OnStatusChange(nsIWebProgress* aWebProgress,
nsresult aStatus,
const PRUnichar* aMessage)
{
return NS_ERROR_NOT_IMPLEMENTED;
NS_NOTREACHED("notification excluded in AddProgressListener(...)");
return NS_OK;
}
NS_IMETHODIMP
nsWebCrawler::OnSecurityChange(nsIWebProgress *aWebProgress,
nsIRequest *aRequest,
PRInt32 state)
PRUint32 state)
{
return NS_ERROR_NOT_IMPLEMENTED;
NS_NOTREACHED("notification excluded in AddProgressListener(...)");
return NS_OK;
}
FILE*
@ -611,7 +616,8 @@ nsWebCrawler::Start()
if (docShell) {
nsCOMPtr<nsIWebProgress> progress(do_GetInterface(docShell));
if (progress) {
progress->AddProgressListener(this);
progress->AddProgressListener(this,
nsIWebProgress::NOTIFY_STATE_DOCUMENT);
LoadNextURL(PR_FALSE);
}
}

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

@ -353,7 +353,7 @@ nsChromeTreeOwner::OnProgressChange(nsIWebProgress* aWebProgress,
NS_IMETHODIMP
nsChromeTreeOwner::OnStateChange(nsIWebProgress* aWebProgress,
nsIRequest* aRequest,
PRInt32 aProgressStateFlags,
PRUint32 aProgressStateFlags,
nsresult aStatus)
{
return NS_OK;
@ -397,9 +397,9 @@ nsChromeTreeOwner::OnStatusChange(nsIWebProgress* aWebProgress,
NS_IMETHODIMP
nsChromeTreeOwner::OnSecurityChange(nsIWebProgress *aWebProgress,
nsIRequest *aRequest,
PRInt32 state)
PRUint32 state)
{
return NS_ERROR_NOT_IMPLEMENTED;
return NS_OK;
}
//*****************************************************************************

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

@ -317,7 +317,7 @@ nsresult nsWebShellWindow::Initialize(nsIXULWindow* aParent,
// Attach a WebProgress listener.during initialization...
nsCOMPtr<nsIWebProgress> webProgress(do_GetInterface(mDocShell, &rv));
if (webProgress) {
webProgress->AddProgressListener(this);
webProgress->AddProgressListener(this, nsIWebProgress::NOTIFY_STATE_NETWORK);
}
nsCOMPtr<nsIDocShellTreeItem> docShellAsItem(do_QueryInterface(mDocShell));
@ -1196,13 +1196,14 @@ nsWebShellWindow::OnProgressChange(nsIWebProgress *aProgress,
PRInt32 aCurTotalProgress,
PRInt32 aMaxTotalProgress)
{
NS_NOTREACHED("notification excluded in AddProgressListener(...)");
return NS_OK;
}
NS_IMETHODIMP
nsWebShellWindow::OnStateChange(nsIWebProgress *aProgress,
nsIRequest *aRequest,
PRInt32 aStateFlags,
PRUint32 aStateFlags,
nsresult aStatus)
{
// If the notification is not about a document finishing, then just
@ -1289,6 +1290,7 @@ nsWebShellWindow::OnLocationChange(nsIWebProgress *aProgress,
nsIRequest *aRequest,
nsIURI *aURI)
{
NS_NOTREACHED("notification excluded in AddProgressListener(...)");
return NS_OK;
}
@ -1298,14 +1300,16 @@ nsWebShellWindow::OnStatusChange(nsIWebProgress* aWebProgress,
nsresult aStatus,
const PRUnichar* aMessage)
{
NS_NOTREACHED("notification excluded in AddProgressListener(...)");
return NS_OK;
}
NS_IMETHODIMP
nsWebShellWindow::OnSecurityChange(nsIWebProgress *aWebProgress,
nsIRequest *aRequest,
PRInt32 state)
PRUint32 state)
{
NS_NOTREACHED("notification excluded in AddProgressListener(...)");
return NS_OK;
}

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

@ -318,7 +318,7 @@ function Startup()
// hook up UI through progress listener
var interfaceRequestor = getBrowser().docShell.QueryInterface(Components.interfaces.nsIInterfaceRequestor);
var webProgress = interfaceRequestor.getInterface(Components.interfaces.nsIWebProgress);
webProgress.addProgressListener(window.XULBrowserWindow);
webProgress.addProgressListener(window.XULBrowserWindow, Components.interfaces.nsIWebProgress.NOTIFY_ALL);
// XXXjag see bug 68662 (needed to hook up web progress listener)
getBrowser().boxObject.setPropertyAsSupports("listenerkungfu", window.XULBrowserWindow);

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

@ -396,7 +396,7 @@ function Startup()
}
// hook up UI through progress listener
getBrowser().addProgressListener(window.XULBrowserWindow);
getBrowser().addProgressListener(window.XULBrowserWindow, Components.interfaces.nsIWebProgress.NOTIFY_ALL);
// load appropriate initial page from commandline
var isPageCycling = false;

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

@ -64,8 +64,8 @@ interface nsIDownloadProgressListener : nsISupports {
void onStateChange(in nsIWebProgress aWebProgress,
in nsIRequest aRequest,
in long aStateFlags,
in unsigned long aStatus,
in unsigned long aStateFlags,
in nsresult aStatus,
in nsIDownload aDownload);
void onProgressChange(in nsIWebProgress aWebProgress,
@ -89,7 +89,7 @@ interface nsIDownloadProgressListener : nsISupports {
void onSecurityChange(in nsIWebProgress aWebProgress,
in nsIRequest aRequest,
in long aState,
in unsigned long aState,
in nsIDownload aDownload);
};

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

@ -1055,8 +1055,8 @@ nsDownload::OnStatusChange(nsIWebProgress *aWebProgress,
NS_IMETHODIMP
nsDownload::OnStateChange(nsIWebProgress* aWebProgress,
nsIRequest* aRequest, PRInt32 aStateFlags,
PRUint32 aStatus)
nsIRequest* aRequest, PRUint32 aStateFlags,
nsresult aStatus)
{
if (aStateFlags & STATE_START)
mStartTime = PR_Now();
@ -1097,7 +1097,7 @@ nsDownload::OnStateChange(nsIWebProgress* aWebProgress,
NS_IMETHODIMP
nsDownload::OnSecurityChange(nsIWebProgress *aWebProgress,
nsIRequest *aRequest, PRInt32 aState)
nsIRequest *aRequest, PRUint32 aState)
{
if (mListener)
mListener->OnSecurityChange(aWebProgress, aRequest, aState);

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

@ -148,13 +148,13 @@ public:
}
NS_IMETHODIMP OnStateChange(nsIWebProgress* aWebProgress,
nsIRequest* aRequest, PRInt32 aStateFlags,
nsIRequest* aRequest, PRUint32 aStateFlags,
PRUint32 aStatus)
{
nsCOMPtr<nsIWebProgressListener> listener = do_QueryInterface(mInner);
if (listener)
return listener->OnStateChange(aWebProgress, aRequest, aStateFlags, aStatus);
return NS_ERROR_FAILURE;
return NS_OK;
}
NS_IMETHODIMP OnStatusChange(nsIWebProgress *aWebProgress,
@ -164,7 +164,7 @@ public:
nsCOMPtr<nsIWebProgressListener> listener = do_QueryInterface(mInner);
if (listener)
return listener->OnStatusChange(aWebProgress, aRequest, aStatus, aMessage);
return NS_ERROR_FAILURE;
return NS_OK;
}
NS_IMETHODIMP OnLocationChange(nsIWebProgress *aWebProgress,
@ -173,7 +173,7 @@ public:
nsCOMPtr<nsIWebProgressListener> listener = do_QueryInterface(mInner);
if (listener)
return listener->OnLocationChange(aWebProgress, aRequest, aLocation);
return NS_ERROR_FAILURE;
return NS_OK;
}
NS_IMETHODIMP OnProgressChange(nsIWebProgress *aWebProgress,
@ -187,16 +187,16 @@ public:
if (listener)
return listener->OnProgressChange(aWebProgress, aRequest, aCurSelfProgress,
aMaxSelfProgress, aCurTotalProgress, aMaxTotalProgress);
return NS_ERROR_FAILURE;
return NS_OK;
}
NS_IMETHODIMP OnSecurityChange(nsIWebProgress *aWebProgress,
nsIRequest *aRequest, PRInt32 aState)
nsIRequest *aRequest, PRUint32 aState)
{
nsCOMPtr<nsIWebProgressListener> listener = do_QueryInterface(mInner);
if (listener)
return listener->OnSecurityChange(aWebProgress, aRequest, aState);
return NS_ERROR_FAILURE;
return NS_OK;
}
private:

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

@ -76,7 +76,8 @@ nsHistoryLoadListener::Init()
NS_ADDREF_THIS();
rv = progress->AddProgressListener(NS_STATIC_CAST(nsIWebProgressListener*,
this));
this),
nsIWebProgress::NOTIFY_STATE_DOCUMENT);
printf("\tSuccess: %8.8X\n", rv);
return NS_OK;
@ -86,11 +87,11 @@ NS_IMPL_ISUPPORTS2(nsHistoryLoadListener,
nsIWebProgressListener,
nsISupportsWeakReference)
/* void onStateChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in long aStateFlags, in unsigned long aStatus); */
/* void onStateChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in long aStateFlags, in nsresult aStatus); */
NS_IMETHODIMP
nsHistoryLoadListener::OnStateChange(nsIWebProgress *aWebProgress,
nsIRequest *aRequest,
PRInt32 aStateFlags, PRUint32 aStatus)
PRUint32 aStateFlags, nsresult aStatus)
{
// we only care about finishing up documents
if (! (aStateFlags & nsIWebProgressListener::STATE_STOP))
@ -149,32 +150,28 @@ nsHistoryLoadListener::OnProgressChange(nsIWebProgress *aWebProgress,
PRInt32 aCurTotalProgress,
PRInt32 aMaxTotalProgress)
{
printf("nsHistoryLoadListener::OnProgressChange(w,r, %d, %d, %d, %d)\n",
aCurSelfProgress, aMaxSelfProgress,
aCurTotalProgress, aMaxTotalProgress );
return NS_ERROR_NOT_IMPLEMENTED;
NS_NOTREACHED("notification excluded in AddProgressListener(...)");
return NS_OK;
}
/* void onLocationChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in nsIURI location); */
NS_IMETHODIMP nsHistoryLoadListener::OnLocationChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, nsIURI *location)
{
printf("nsHistoryLoadListener::OnLocationChange(w,r,l)\n");
return NS_ERROR_NOT_IMPLEMENTED;
NS_NOTREACHED("notification excluded in AddProgressListener(...)");
return NS_OK;
}
/* void onStatusChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in nsresult aStatus, in wstring aMessage); */
NS_IMETHODIMP nsHistoryLoadListener::OnStatusChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, nsresult aStatus, const PRUnichar *aMessage)
{
printf("nsHistoryLoadListener::OnStatusChange(w,r, %8.8X, %s)\n",
aStatus, NS_ConvertUCS2toUTF8(aMessage).get());
return NS_ERROR_NOT_IMPLEMENTED;
NS_NOTREACHED("notification excluded in AddProgressListener(...)");
return NS_OK;
}
/* void onSecurityChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in long state); */
NS_IMETHODIMP nsHistoryLoadListener::OnSecurityChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, PRInt32 state)
/* void onSecurityChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in unsigned long state); */
NS_IMETHODIMP nsHistoryLoadListener::OnSecurityChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, PRUint32 state)
{
printf("nsHistoryLoadListener::OnSecurityChange(w,r, %d)\n", state);
return NS_ERROR_NOT_IMPLEMENTED;
NS_NOTREACHED("notification excluded in AddProgressListener(...)");
return NS_OK;
}

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

@ -257,7 +257,7 @@
<parameter name="aListener"/>
<body>
<![CDATA[
this.webProgress.addProgressListener(aListener);
this.webProgress.addProgressListener(aListener, Components.interfaces.nsIWebProgress.NOTIFY_ALL);
]]>
</body>
</method>