Index: components/security_state/security_state_model_delegate.h |
diff --git a/components/security_state/security_state_model_delegate.h b/components/security_state/security_state_model_delegate.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..e47d2f87900969522baa85238f6ad9328b397d63 |
--- /dev/null |
+++ b/components/security_state/security_state_model_delegate.h |
@@ -0,0 +1,55 @@ |
+// Copyright 2015 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef COMPONENTS_SECURITY_STATE_SECURITY_STATE_MODEL_DELEGATE_H_ |
+#define COMPONENTS_SECURITY_STATE_SECURITY_STATE_MODEL_DELEGATE_H_ |
+ |
+#include "base/macros.h" |
+ |
+class GURL; |
+ |
+namespace security_state { |
+ |
+// An interface that SecurityStateModel uses to get information about |
+// the request or page that it is describing. |
+class SecurityStateModelDelegate { |
+ public: |
+ SecurityStateModelDelegate() {} |
+ virtual ~SecurityStateModelDelegate() {} |
+ |
+ // Returns true if visible security state has changed since the last |
+ // call (e.g. the visible URL of the page has changed, or mixed |
+ // content has run). |
+ virtual bool VisibleSecurityStateChanged() = 0; |
+ |
+ // Retrieves the certificate used to load the page or request. |
+ virtual bool RetrieveCert(scoped_refptr<net::X509Certificate>* cert) = 0; |
+ |
+ // Returns the initial security level of the page or request, before |
+ // any SecurityStateModel policies have been applied. |
+ virtual SecurityLevel GetInitialSecurityLevel() = 0; |
+ |
+ // Returns the security level used to describe nonsecure pages/requests. |
+ virtual SecurityLevel GetSecurityLevelForNonSecure(const GURL& url) = 0; |
+ |
+ // Returns true if the page or request is known to be loaded with a |
+ // MITM certificate. |
+ virtual bool UsedKnownMITMCertificate() = 0; |
+ |
+ // The following methods return information about the page/request |
+ // that the SecurityStateModel describes. |
+ virtual int GetCertId() = 0; |
+ virtual net::CertStatus GetCertStatus() = 0; |
+ virtual int GetConnectionStatus() = 0; |
+ virtual int GetSecurityBits() = 0; |
+ virtual const GURL& GetURL() = 0; |
+ virtual bool RanMixedContent() = 0; |
+ virtual bool DisplayedMixedContent() = 0; |
+ virtual void GetSCTVerifyStatuses( |
+ std::vector<net::ct::SCTVerifyStatus>* sct_verify_statuses) = 0; |
+}; |
+ |
+} // namespace security_state |
+ |
+#endif // COMPONENTS_SECURITY_STATE_SECURITY_STATE_MODEL_DELEGATE_H_ |