OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CONTENT_BROWSER_SSL_SSL_MANAGER_H_ | 5 #ifndef CONTENT_BROWSER_SSL_SSL_MANAGER_H_ |
6 #define CONTENT_BROWSER_SSL_SSL_MANAGER_H_ | 6 #define CONTENT_BROWSER_SSL_SSL_MANAGER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 10 matching lines...) Expand all Loading... |
21 class LoadFromMemoryCacheDetails; | 21 class LoadFromMemoryCacheDetails; |
22 class NavigationController; | 22 class NavigationController; |
23 class NavigationEntry; | 23 class NavigationEntry; |
24 class ProvisionalLoadDetails; | 24 class ProvisionalLoadDetails; |
25 class ResourceDispatcherHost; | 25 class ResourceDispatcherHost; |
26 class ResourceRedirectDetails; | 26 class ResourceRedirectDetails; |
27 class ResourceRequestDetails; | 27 class ResourceRequestDetails; |
28 class SSLPolicy; | 28 class SSLPolicy; |
29 | 29 |
30 namespace net { | 30 namespace net { |
| 31 class SSLInfo; |
31 class URLRequest; | 32 class URLRequest; |
32 } // namespace net | 33 } // namespace net |
33 | 34 |
34 // The SSLManager SSLManager controls the SSL UI elements in a TabContents. It | 35 // The SSLManager SSLManager controls the SSL UI elements in a TabContents. It |
35 // listens for various events that influence when these elements should or | 36 // listens for various events that influence when these elements should or |
36 // should not be displayed and adjusts them accordingly. | 37 // should not be displayed and adjusts them accordingly. |
37 // | 38 // |
38 // There is one SSLManager per tab. | 39 // There is one SSLManager per tab. |
39 // The security state (secure/insecure) is stored in the navigation entry. | 40 // The security state (secure/insecure) is stored in the navigation entry. |
40 // Along with it are stored any SSL error code and the associated cert. | 41 // Along with it are stored any SSL error code and the associated cert. |
41 | 42 |
42 class SSLManager : public NotificationObserver { | 43 class SSLManager : public NotificationObserver { |
43 public: | 44 public: |
44 // Entry point for SSLCertificateErrors. This function begins the process | 45 // Entry point for SSLCertificateErrors. This function begins the process |
45 // of resolving a certificate error during an SSL connection. SSLManager | 46 // of resolving a certificate error during an SSL connection. SSLManager |
46 // will adjust the security UI and either call |Cancel| or | 47 // will adjust the security UI and either call |Cancel| or |
47 // |ContinueDespiteLastError| on the net::URLRequest. | 48 // |ContinueDespiteLastError| on the net::URLRequest. |
48 // | 49 // |
49 // Called on the IO thread. | 50 // Called on the IO thread. |
50 static void OnSSLCertificateError(ResourceDispatcherHost* resource_dispatcher, | 51 static void OnSSLCertificateError(ResourceDispatcherHost* resource_dispatcher, |
51 net::URLRequest* request, | 52 net::URLRequest* request, |
52 int cert_error, | 53 const net::SSLInfo& ssl_info, |
53 net::X509Certificate* cert); | 54 bool is_hsts_host); |
54 | 55 |
55 // Called when SSL state for a host or tab changes. Broadcasts the | 56 // Called when SSL state for a host or tab changes. Broadcasts the |
56 // SSL_INTERNAL_STATE_CHANGED notification. | 57 // SSL_INTERNAL_STATE_CHANGED notification. |
57 static void NotifySSLInternalStateChanged(NavigationController* controller); | 58 static void NotifySSLInternalStateChanged(NavigationController* controller); |
58 | 59 |
59 // Convenience methods for serializing/deserializing the security info. | 60 // Convenience methods for serializing/deserializing the security info. |
60 static std::string SerializeSecurityInfo(int cert_id, | 61 static std::string SerializeSecurityInfo(int cert_id, |
61 net::CertStatus cert_status, | 62 net::CertStatus cert_status, |
62 int security_bits, | 63 int security_bits, |
63 int connection_status); | 64 int connection_status); |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 // for the security UI of this tab. | 123 // for the security UI of this tab. |
123 NavigationController* controller_; | 124 NavigationController* controller_; |
124 | 125 |
125 // Handles registering notifications with the NotificationService. | 126 // Handles registering notifications with the NotificationService. |
126 NotificationRegistrar registrar_; | 127 NotificationRegistrar registrar_; |
127 | 128 |
128 DISALLOW_COPY_AND_ASSIGN(SSLManager); | 129 DISALLOW_COPY_AND_ASSIGN(SSLManager); |
129 }; | 130 }; |
130 | 131 |
131 #endif // CONTENT_BROWSER_SSL_SSL_MANAGER_H_ | 132 #endif // CONTENT_BROWSER_SSL_SSL_MANAGER_H_ |
OLD | NEW |