Home | History | Annotate | Download | only in common
      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
      3 // found in the LICENSE file.
      4 
      5 #ifndef CONTENT_PUBLIC_COMMON_SSL_STATUS_H_
      6 #define CONTENT_PUBLIC_COMMON_SSL_STATUS_H_
      7 
      8 #include "content/common/content_export.h"
      9 #include "content/public/common/security_style.h"
     10 #include "content/public/common/signed_certificate_timestamp_id_and_status.h"
     11 #include "net/cert/cert_status_flags.h"
     12 
     13 namespace content {
     14 
     15 // Collects the SSL information for this NavigationEntry.
     16 struct CONTENT_EXPORT SSLStatus {
     17   // Flags used for the page security content status.
     18   enum ContentStatusFlags {
     19     // HTTP page, or HTTPS page with no insecure content.
     20     NORMAL_CONTENT             = 0,
     21 
     22     // HTTPS page containing "displayed" HTTP resources (e.g. images, CSS).
     23     DISPLAYED_INSECURE_CONTENT = 1 << 0,
     24 
     25     // HTTPS page containing "executed" HTTP resources (i.e. script).
     26     // Also currently used for HTTPS page containing broken-HTTPS resources;
     27     // this is wrong and should be fixed (see comments in
     28     // SSLPolicy::OnRequestStarted()).
     29     RAN_INSECURE_CONTENT       = 1 << 1,
     30   };
     31 
     32   SSLStatus();
     33   ~SSLStatus();
     34 
     35   bool Equals(const SSLStatus& status) const {
     36     return security_style == status.security_style &&
     37            cert_id == status.cert_id &&
     38            cert_status == status.cert_status &&
     39            security_bits == status.security_bits &&
     40            content_status == status.content_status &&
     41            signed_certificate_timestamp_ids ==
     42                status.signed_certificate_timestamp_ids;
     43   }
     44 
     45   content::SecurityStyle security_style;
     46   int cert_id;
     47   net::CertStatus cert_status;
     48   int security_bits;
     49   int connection_status;
     50   // A combination of the ContentStatusFlags above.
     51   int content_status;
     52   SignedCertificateTimestampIDStatusList signed_certificate_timestamp_ids;
     53 };
     54 
     55 }  // namespace content
     56 
     57 #endif  // CONTENT_PUBLIC_COMMON_SSL_STATUS_H_
     58