| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 IOS_WEB_PUBLIC_SSL_STATUS_H_ | 5 #ifndef IOS_WEB_PUBLIC_SSL_STATUS_H_ |
| 6 #define IOS_WEB_PUBLIC_SSL_STATUS_H_ | 6 #define IOS_WEB_PUBLIC_SSL_STATUS_H_ |
| 7 | 7 |
| 8 #include <string> |
| 9 |
| 8 #include "ios/web/public/security_style.h" | 10 #include "ios/web/public/security_style.h" |
| 9 #include "net/cert/cert_status_flags.h" | 11 #include "net/cert/cert_status_flags.h" |
| 10 | 12 |
| 11 namespace web { | 13 namespace web { |
| 12 | 14 |
| 13 // Collects the SSL information for this NavigationItem. | 15 // Collects the SSL information for this NavigationItem. |
| 14 struct SSLStatus { | 16 struct SSLStatus { |
| 15 // Flags used for the page security content status. | 17 // Flags used for the page security content status. |
| 16 enum ContentStatusFlags { | 18 enum ContentStatusFlags { |
| 17 // HTTP page, or HTTPS page with no insecure content. | 19 // HTTP page, or HTTPS page with no insecure content. |
| 18 NORMAL_CONTENT = 0, | 20 NORMAL_CONTENT = 0, |
| 19 | 21 |
| 20 // HTTPS page containing "displayed" HTTP resources (e.g. images, CSS). | 22 // HTTPS page containing "displayed" HTTP resources (e.g. images, CSS). |
| 21 DISPLAYED_INSECURE_CONTENT = 1 << 0, | 23 DISPLAYED_INSECURE_CONTENT = 1 << 0, |
| 22 | 24 |
| 23 // The RAN_INSECURE_CONTENT flag is intentionally omitted on iOS because | 25 // The RAN_INSECURE_CONTENT flag is intentionally omitted on iOS because |
| 24 // there is no way to tell when insecure content is run in a web view. | 26 // there is no way to tell when insecure content is run in a web view. |
| 25 }; | 27 }; |
| 26 | 28 |
| 27 SSLStatus(); | 29 SSLStatus(); |
| 28 ~SSLStatus(); | 30 ~SSLStatus(); |
| 29 | 31 |
| 30 bool Equals(const SSLStatus& status) const { | 32 bool Equals(const SSLStatus& status) const { |
| 31 return security_style == status.security_style && | 33 return security_style == status.security_style && |
| 32 cert_id == status.cert_id && | 34 cert_id == status.cert_id && |
| 33 cert_status == status.cert_status && | 35 cert_status == status.cert_status && |
| 34 security_bits == status.security_bits && | 36 security_bits == status.security_bits && |
| 35 content_status == status.content_status; | 37 content_status == status.content_status; |
| 38 // |cert_status_host| is not used for comparison intentionally. |
| 36 } | 39 } |
| 37 | 40 |
| 38 web::SecurityStyle security_style; | 41 web::SecurityStyle security_style; |
| 39 int cert_id; | 42 int cert_id; |
| 40 net::CertStatus cert_status; | 43 net::CertStatus cert_status; |
| 41 int security_bits; | 44 int security_bits; |
| 42 int connection_status; | 45 int connection_status; |
| 43 // A combination of the ContentStatusFlags above. | 46 // A combination of the ContentStatusFlags above. |
| 44 int content_status; | 47 int content_status; |
| 48 // Host which was used for |cert_status| calculation. It is not an actual part |
| 49 // of SSL status, hence it's not taken into account in |Equals| method. |
| 50 // Used to check if |cert_status| is still valid or needs to be recalculated |
| 51 // (e.g. after redirect). |
| 52 std::string cert_status_host; |
| 45 }; | 53 }; |
| 46 | 54 |
| 47 } // namespace web | 55 } // namespace web |
| 48 | 56 |
| 49 #endif // IOS_WEB_PUBLIC_SSL_STATUS_H_ | 57 #endif // IOS_WEB_PUBLIC_SSL_STATUS_H_ |
| OLD | NEW |