Fixing bug 262689. Don't get stuck in view-source mode when a view-source URI is visited. r=caillon@gmail.com, sr=dveditz@cruzio.com

This commit is contained in:
jst%mozilla.jstenback.com 2004-10-08 22:58:16 +00:00
Родитель 1b9fe6c972
Коммит 0c400c441c
2 изменённых файлов: 15 добавлений и 13 удалений

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

@ -141,8 +141,8 @@ static PLDHashTableOps gMapOps = {
nsSecureBrowserUIImpl::nsSecureBrowserUIImpl()
: mIsViewSource(PR_FALSE),
mPreviousSecurityState(lis_no_security)
: mPreviousSecurityState(lis_no_security),
mIsViewSource(PR_FALSE)
{
mTransferringRequests.ops = nsnull;
mNewToplevelSecurityState = STATE_IS_INSECURE;
@ -1122,21 +1122,23 @@ nsSecureBrowserUIImpl::OnLocationChange(nsIWebProgress* aWebProgress,
nsIRequest* aRequest,
nsIURI* aLocation)
{
mCurrentURI = aLocation;
if (mCurrentURI)
if (aLocation)
{
PRBool vs;
if (NS_SUCCEEDED(mCurrentURI->SchemeIs("view-source", &vs)) && vs)
{
nsresult rv = aLocation->SchemeIs("view-source", &vs);
NS_ENSURE_SUCCESS(rv, rv);
if (vs) {
PR_LOG(gSecureDocLog, PR_LOG_DEBUG,
("SecureUI:%p: OnLocationChange: view-source\n", this));
mIsViewSource = PR_TRUE;
}
mIsViewSource = vs;
}
mCurrentURI = aLocation;
return NS_OK;
}

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

@ -105,13 +105,13 @@ protected:
lis_high_security
};
PRBool mIsViewSource;
lockIconState mPreviousSecurityState;
void ResetStateTracking();
PRUint32 mNewToplevelSecurityState;
PRBool mNewToplevelSecurityStateKnown;
PRPackedBool mNewToplevelSecurityStateKnown;
PRPackedBool mIsViewSource;
nsXPIDLString mInfoTooltip;
PRInt32 mDocumentRequestsInProgress;
PRInt32 mSubRequestsInProgress;