OLD | NEW |
(Empty) | |
| 1 // Copyright 2015 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 COMPONENTS_SECURITY_STATE_SECURITY_STATE_MODEL_DELEGATE_H_ |
| 6 #define COMPONENTS_SECURITY_STATE_SECURITY_STATE_MODEL_DELEGATE_H_ |
| 7 |
| 8 #include "base/macros.h" |
| 9 |
| 10 class GURL; |
| 11 |
| 12 namespace security_state { |
| 13 |
| 14 // An interface that SecurityStateModel uses to get information about |
| 15 // the request or page that it is describing. |
| 16 class SecurityStateModelDelegate { |
| 17 public: |
| 18 SecurityStateModelDelegate() {} |
| 19 virtual ~SecurityStateModelDelegate() {} |
| 20 |
| 21 // Returns true if visible security state has changed since the last |
| 22 // call (e.g. the visible URL of the page has changed, or mixed |
| 23 // content has run). |
| 24 virtual bool VisibleSecurityStateChanged() = 0; |
| 25 |
| 26 // Retrieves the certificate used to load the page or request. |
| 27 virtual bool RetrieveCert(scoped_refptr<net::X509Certificate>* cert) = 0; |
| 28 |
| 29 // Returns the initial security level of the page or request, before |
| 30 // any SecurityStateModel policies have been applied. |
| 31 virtual SecurityLevel GetInitialSecurityLevel() = 0; |
| 32 |
| 33 // Returns the security level used to describe nonsecure pages/requests. |
| 34 virtual SecurityLevel GetSecurityLevelForNonSecure(const GURL& url) = 0; |
| 35 |
| 36 // Returns true if the page or request is known to be loaded with a |
| 37 // MITM certificate. |
| 38 virtual bool UsedKnownMITMCertificate() = 0; |
| 39 |
| 40 // The following methods return information about the page/request |
| 41 // that the SecurityStateModel describes. |
| 42 virtual int GetCertId() = 0; |
| 43 virtual net::CertStatus GetCertStatus() = 0; |
| 44 virtual int GetConnectionStatus() = 0; |
| 45 virtual int GetSecurityBits() = 0; |
| 46 virtual const GURL& GetURL() = 0; |
| 47 virtual bool RanMixedContent() = 0; |
| 48 virtual bool DisplayedMixedContent() = 0; |
| 49 virtual void GetSCTVerifyStatuses( |
| 50 std::vector<net::ct::SCTVerifyStatus>* sct_verify_statuses) = 0; |
| 51 }; |
| 52 |
| 53 } // namespace security_state |
| 54 |
| 55 #endif // COMPONENTS_SECURITY_STATE_SECURITY_STATE_MODEL_DELEGATE_H_ |
OLD | NEW |