1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2
/* ***** BEGIN LICENSE BLOCK *****
5
* The contents of this file are subject to the Mozilla Public License Version
6
* 1.1 (the "License"); you may not use this file except in compliance with
7
* the License. You may obtain a copy of the License at
8
* http://www.mozilla.org/MPL/
10
* Software distributed under the License is distributed on an "AS IS" basis,
11
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
12
* for the specific language governing rights and limitations under the
15
* The Original Code is mozilla.org code.
17
* The Initial Developer of the Original Code is
18
* Netscape Communications Corporation.
19
* Portions created by the Initial Developer are Copyright (C) 1998-2001
20
* the Initial Developer. All Rights Reserved.
24
* Doug Turner <dougt@netscape.com>
25
* Brian Ryner <bryner@brianryner.com>
26
* Kai Engert <kaie@netscape.com>
28
* ***** END LICENSE BLOCK ***** */
30
#ifndef nsSecureBrowserUIImpl_h_
31
#define nsSecureBrowserUIImpl_h_
34
#include "nsXPIDLString.h"
36
#include "nsIObserver.h"
37
#include "nsIDOMElement.h"
38
#include "nsIDOMWindow.h"
39
#include "nsIStringBundle.h"
40
#include "nsISecureBrowserUI.h"
41
#include "nsIDocShell.h"
42
#include "nsIWebProgressListener.h"
43
#include "nsIFormSubmitObserver.h"
45
#include "nsISecurityEventSink.h"
46
#include "nsWeakReference.h"
47
#include "nsISSLStatusProvider.h"
50
class nsITransportSecurityInfo;
51
class nsISecurityWarningDialogs;
54
#define NS_SECURE_BROWSER_UI_CID \
55
{ 0xcc75499a, 0x1dd1, 0x11b2, {0x8a, 0x82, 0xca, 0x41, 0x0a, 0xc9, 0x07, 0xb8}}
58
class nsSecureBrowserUIImpl : public nsISecureBrowserUI,
59
public nsIWebProgressListener,
60
public nsIFormSubmitObserver,
62
public nsSupportsWeakReference,
63
public nsISSLStatusProvider
67
nsSecureBrowserUIImpl();
68
virtual ~nsSecureBrowserUIImpl();
71
NS_DECL_NSIWEBPROGRESSLISTENER
72
NS_DECL_NSISECUREBROWSERUI
76
NS_DECL_NSISSLSTATUSPROVIDER
78
NS_IMETHOD Notify(nsIContent* formNode, nsIDOMWindowInternal* window,
79
nsIURI *actionURL, PRBool* cancelSubmit);
83
nsCOMPtr<nsIDOMWindow> mWindow;
84
nsCOMPtr<nsIStringBundle> mStringBundle;
85
nsCOMPtr<nsIURI> mCurrentURI;
86
nsCOMPtr<nsISecurityEventSink> mToplevelEventSink;
96
lockIconState mPreviousSecurityState;
98
void ResetStateTracking();
99
PRUint32 mNewToplevelSecurityState;
100
PRPackedBool mNewToplevelSecurityStateKnown;
101
PRPackedBool mIsViewSource;
103
nsXPIDLString mInfoTooltip;
104
PRInt32 mDocumentRequestsInProgress;
105
PRInt32 mSubRequestsInProgress;
106
PRInt32 mSubRequestsHighSecurity;
107
PRInt32 mSubRequestsLowSecurity;
108
PRInt32 mSubRequestsBrokenSecurity;
109
PRInt32 mSubRequestsNoSecurity;
111
nsresult UpdateSecurityState(nsIRequest* aRequest);
112
void ObtainEventSink(nsIChannel *channel);
114
nsCOMPtr<nsISupports> mSSLStatus;
116
void GetBundleString(const PRUnichar* name, nsAString &outString);
118
nsresult CheckPost(nsIURI *formURI, nsIURI *actionURL, PRBool *okayToPost);
119
nsresult IsURLHTTPS(nsIURI* aURL, PRBool *value);
121
PRBool ConfirmEnteringSecure();
122
PRBool ConfirmEnteringWeak();
123
PRBool ConfirmLeavingSecure();
124
PRBool ConfirmMixedMode();
125
PRBool ConfirmPostToInsecure();
126
PRBool ConfirmPostToInsecureFromSecure();
129
nsresult GetNSSDialogs(nsISecurityWarningDialogs **);
131
PLDHashTable mTransferringRequests;
135
#endif /* nsSecureBrowserUIImpl_h_ */