~ubuntu-branches/ubuntu/precise/kompozer/precise

« back to all changes in this revision

Viewing changes to mozilla/security/manager/boot/src/nsSecureBrowserUIImpl.h

  • Committer: Bazaar Package Importer
  • Author(s): Anthony Yarusso
  • Date: 2007-08-27 01:11:03 UTC
  • Revision ID: james.westby@ubuntu.com-20070827011103-2jgf4s6532gqu2ka
Tags: upstream-0.7.10
ImportĀ upstreamĀ versionĀ 0.7.10

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 
2
/* ***** BEGIN LICENSE BLOCK *****
 
3
 * Version: MPL 1.1
 
4
 *
 
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/
 
9
 *
 
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
 
13
 * License.
 
14
 *
 
15
 * The Original Code is mozilla.org code.
 
16
 *
 
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.
 
21
 *
 
22
 * Contributor(s):
 
23
 *   Hubbie Shaw
 
24
 *   Doug Turner <dougt@netscape.com>
 
25
 *   Brian Ryner <bryner@brianryner.com>
 
26
 *   Kai Engert <kaie@netscape.com>
 
27
 *
 
28
 * ***** END LICENSE BLOCK ***** */
 
29
 
 
30
#ifndef nsSecureBrowserUIImpl_h_
 
31
#define nsSecureBrowserUIImpl_h_
 
32
 
 
33
#include "nsCOMPtr.h"
 
34
#include "nsXPIDLString.h"
 
35
#include "nsString.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"
 
44
#include "nsIURI.h"
 
45
#include "nsISecurityEventSink.h"
 
46
#include "nsWeakReference.h"
 
47
#include "nsISSLStatusProvider.h"
 
48
#include "pldhash.h"
 
49
 
 
50
class nsITransportSecurityInfo;
 
51
class nsISecurityWarningDialogs;
 
52
class nsIChannel;
 
53
 
 
54
#define NS_SECURE_BROWSER_UI_CID \
 
55
{ 0xcc75499a, 0x1dd1, 0x11b2, {0x8a, 0x82, 0xca, 0x41, 0x0a, 0xc9, 0x07, 0xb8}}
 
56
 
 
57
 
 
58
class nsSecureBrowserUIImpl : public nsISecureBrowserUI,
 
59
                              public nsIWebProgressListener,
 
60
                              public nsIFormSubmitObserver,
 
61
                              public nsIObserver,
 
62
                              public nsSupportsWeakReference,
 
63
                              public nsISSLStatusProvider
 
64
{
 
65
public:
 
66
  
 
67
  nsSecureBrowserUIImpl();
 
68
  virtual ~nsSecureBrowserUIImpl();
 
69
  
 
70
  NS_DECL_ISUPPORTS
 
71
  NS_DECL_NSIWEBPROGRESSLISTENER
 
72
  NS_DECL_NSISECUREBROWSERUI
 
73
  
 
74
  // nsIObserver
 
75
  NS_DECL_NSIOBSERVER
 
76
  NS_DECL_NSISSLSTATUSPROVIDER
 
77
 
 
78
  NS_IMETHOD Notify(nsIContent* formNode, nsIDOMWindowInternal* window,
 
79
                    nsIURI *actionURL, PRBool* cancelSubmit);
 
80
  
 
81
protected:
 
82
  
 
83
  nsCOMPtr<nsIDOMWindow> mWindow;
 
84
  nsCOMPtr<nsIStringBundle> mStringBundle;
 
85
  nsCOMPtr<nsIURI> mCurrentURI;
 
86
  nsCOMPtr<nsISecurityEventSink> mToplevelEventSink;
 
87
  
 
88
  enum lockIconState {
 
89
    lis_no_security,
 
90
    lis_broken_security,
 
91
    lis_mixed_security,
 
92
    lis_low_security,
 
93
    lis_high_security
 
94
  };
 
95
 
 
96
  lockIconState mPreviousSecurityState;
 
97
 
 
98
  void ResetStateTracking();
 
99
  PRUint32 mNewToplevelSecurityState;
 
100
  PRPackedBool mNewToplevelSecurityStateKnown;
 
101
  PRPackedBool mIsViewSource;
 
102
 
 
103
  nsXPIDLString mInfoTooltip;
 
104
  PRInt32 mDocumentRequestsInProgress;
 
105
  PRInt32 mSubRequestsInProgress;
 
106
  PRInt32 mSubRequestsHighSecurity;
 
107
  PRInt32 mSubRequestsLowSecurity;
 
108
  PRInt32 mSubRequestsBrokenSecurity;
 
109
  PRInt32 mSubRequestsNoSecurity;
 
110
 
 
111
  nsresult UpdateSecurityState(nsIRequest* aRequest);
 
112
  void ObtainEventSink(nsIChannel *channel);
 
113
  
 
114
  nsCOMPtr<nsISupports> mSSLStatus;
 
115
 
 
116
  void GetBundleString(const PRUnichar* name, nsAString &outString);
 
117
  
 
118
  nsresult CheckPost(nsIURI *formURI, nsIURI *actionURL, PRBool *okayToPost);
 
119
  nsresult IsURLHTTPS(nsIURI* aURL, PRBool *value);
 
120
 
 
121
  PRBool ConfirmEnteringSecure();
 
122
  PRBool ConfirmEnteringWeak();
 
123
  PRBool ConfirmLeavingSecure();
 
124
  PRBool ConfirmMixedMode();
 
125
  PRBool ConfirmPostToInsecure();
 
126
  PRBool ConfirmPostToInsecureFromSecure();
 
127
 
 
128
  // Support functions
 
129
  nsresult GetNSSDialogs(nsISecurityWarningDialogs **);
 
130
 
 
131
  PLDHashTable mTransferringRequests;
 
132
};
 
133
 
 
134
 
 
135
#endif /* nsSecureBrowserUIImpl_h_ */