| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 void DidDisplayMixedContent(); | 84 void DidDisplayMixedContent(); |
| 85 void DidContainInsecureFormAction(); | 85 void DidContainInsecureFormAction(); |
| 86 void DidDisplayContentWithCertErrors(); | 86 void DidDisplayContentWithCertErrors(); |
| 87 void DidShowPasswordInputOnHttp(); | 87 void DidShowPasswordInputOnHttp(); |
| 88 void DidHideAllPasswordInputsOnHttp(); | 88 void DidHideAllPasswordInputsOnHttp(); |
| 89 void DidShowCreditCardInputOnHttp(); | 89 void DidShowCreditCardInputOnHttp(); |
| 90 void DidRunMixedContent(const GURL& security_origin); | 90 void DidRunMixedContent(const GURL& security_origin); |
| 91 void DidRunContentWithCertErrors(const GURL& security_origin); | 91 void DidRunContentWithCertErrors(const GURL& security_origin); |
| 92 | 92 |
| 93 // An error occurred with the certificate in an SSL connection. | 93 // An error occurred with the certificate in an SSL connection. |
| 94 // |
| 95 // On Android, OnCertError can cause a Java exception to be thrown - in such a |
| 96 // case we cannot allow calls back into Java after calling OnCertError. If |
| 97 // adding code calling OnCertError, make sure it cannot call into Java after |
| 98 // returning from OnCertError. |
| 94 void OnCertError(std::unique_ptr<SSLErrorHandler> handler); | 99 void OnCertError(std::unique_ptr<SSLErrorHandler> handler); |
| 95 | 100 |
| 96 private: | 101 private: |
| 97 enum OnCertErrorInternalOptionsMask { | 102 enum OnCertErrorInternalOptionsMask { |
| 98 OVERRIDABLE = 1 << 0, | 103 OVERRIDABLE = 1 << 0, |
| 99 STRICT_ENFORCEMENT = 1 << 1, | 104 STRICT_ENFORCEMENT = 1 << 1, |
| 100 EXPIRED_PREVIOUS_DECISION = 1 << 2 | 105 EXPIRED_PREVIOUS_DECISION = 1 << 2 |
| 101 }; | 106 }; |
| 102 | 107 |
| 103 // Helper method for handling certificate errors. | 108 // Helper method for handling certificate errors. |
| 104 // | 109 // |
| 105 // Options should be a bitmask combination of OnCertErrorInternalOptionsMask. | 110 // Options should be a bitmask combination of OnCertErrorInternalOptionsMask. |
| 106 // OVERRIDABLE indicates whether or not the user could (assuming perfect | 111 // OVERRIDABLE indicates whether or not the user could (assuming perfect |
| 107 // knowledge) successfully override the error and still get the security | 112 // knowledge) successfully override the error and still get the security |
| 108 // guarantees of TLS. STRICT_ENFORCEMENT indicates whether or not the site the | 113 // guarantees of TLS. STRICT_ENFORCEMENT indicates whether or not the site the |
| 109 // user is trying to connect to has requested strict enforcement of | 114 // user is trying to connect to has requested strict enforcement of |
| 110 // certificate validation (e.g. with HTTP Strict-Transport-Security). | 115 // certificate validation (e.g. with HTTP Strict-Transport-Security). |
| 111 // EXPIRED_PREVIOUS_DECISION indicates whether a user decision had been | 116 // EXPIRED_PREVIOUS_DECISION indicates whether a user decision had been |
| 112 // previously made but the decision has expired. | 117 // previously made but the decision has expired. |
| 118 // |
| 119 // On Android, OnCertErrorInternal can cause a Java exception to be thrown - |
| 120 // in such a case we cannot allow calls back into Java after calling |
| 121 // OnCertErrorInternal. If adding code calling OnCertErrorInternal, make sure |
| 122 // it cannot call into Java after returning from OnCertErrorInternal. |
| 113 void OnCertErrorInternal(std::unique_ptr<SSLErrorHandler> handler, | 123 void OnCertErrorInternal(std::unique_ptr<SSLErrorHandler> handler, |
| 114 int options_mask); | 124 int options_mask); |
| 115 | 125 |
| 116 // Updates the NavigationEntry's |content_status| flags according to | 126 // Updates the NavigationEntry's |content_status| flags according to |
| 117 // state in |ssl_host_state_delegate|. |add_content_status_flags| and | 127 // state in |ssl_host_state_delegate|. |add_content_status_flags| and |
| 118 // |remove_content_status_flags| are bitmasks of | 128 // |remove_content_status_flags| are bitmasks of |
| 119 // SSLStatus::ContentStatusFlags that will be added or removed from | 129 // SSLStatus::ContentStatusFlags that will be added or removed from |
| 120 // the |content_status| field. (Pass 0 to add/remove no content status | 130 // the |content_status| field. (Pass 0 to add/remove no content status |
| 121 // flags.) This method will notify the WebContents of an SSL state | 131 // flags.) This method will notify the WebContents of an SSL state |
| 122 // change if a change was actually made. | 132 // change if a change was actually made. |
| (...skipping 19 matching lines...) Expand all Loading... |
| 142 | 152 |
| 143 // Delegate that manages SSL state specific to each host. | 153 // Delegate that manages SSL state specific to each host. |
| 144 SSLHostStateDelegate* ssl_host_state_delegate_; | 154 SSLHostStateDelegate* ssl_host_state_delegate_; |
| 145 | 155 |
| 146 DISALLOW_COPY_AND_ASSIGN(SSLManager); | 156 DISALLOW_COPY_AND_ASSIGN(SSLManager); |
| 147 }; | 157 }; |
| 148 | 158 |
| 149 } // namespace content | 159 } // namespace content |
| 150 | 160 |
| 151 #endif // CONTENT_BROWSER_SSL_SSL_MANAGER_H_ | 161 #endif // CONTENT_BROWSER_SSL_SSL_MANAGER_H_ |
| OLD | NEW |