Index: chrome/browser/ssl/chrome_security_state_model_delegate.h |
diff --git a/chrome/browser/ssl/chrome_security_state_model_delegate.h b/chrome/browser/ssl/chrome_security_state_model_delegate.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..1d7c7f7d7dfc513b4d39f8b349cd680462957559 |
--- /dev/null |
+++ b/chrome/browser/ssl/chrome_security_state_model_delegate.h |
@@ -0,0 +1,60 @@ |
+// 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 CHROME_BROWSER_SSL_CHROME_SECURITY_STATE_MODEL_DELEGATE_H_ |
+#define CHROME_BROWSER_SSL_CHROME_SECURITY_STATE_MODEL_DELEGATE_H_ |
+ |
+#include "base/macros.h" |
+#include "components/security_state/security_state_model.h" |
+#include "components/security_state/security_state_model_delegate.h" |
+#include "content/public/browser/web_contents_user_data.h" |
+#include "content/public/common/security_style.h" |
+#include "content/public/common/ssl_status.h" |
+#include "net/cert/cert_status_flags.h" |
+#include "net/cert/sct_status_flags.h" |
+#include "net/cert/x509_certificate.h" |
+ |
+class Profile; |
+ |
+// Implements security_state::SecurityStateModelDelegate using a |
+// content::SSLStatus from a particular WebContents. |
+class ChromeSecurityStateModelDelegate |
+ : public content::WebContentsUserData<ChromeSecurityStateModelDelegate>, |
+ public security_state::SecurityStateModelDelegate { |
+ public: |
+ ~ChromeSecurityStateModelDelegate() override; |
+ |
+ const security_state::SecurityInfo& GetSecurityInfo() const; |
+ |
+ // SecurityStateModelDelegate overrides |
+ bool VisibleSecurityStateChanged() override; |
+ bool RetrieveCert(scoped_refptr<net::X509Certificate>* cert) override; |
+ security_state::SecurityLevel GetInitialSecurityLevel() override; |
+ security_state::SecurityLevel GetSecurityLevelForNonSecure( |
+ const GURL& url) override; |
+ bool UsedKnownMITMCertificate() override; |
+ int GetCertId() override; |
+ net::CertStatus GetCertStatus() override; |
+ int GetConnectionStatus() override; |
+ int GetSecurityBits() override; |
+ const GURL& GetURL() override; |
+ bool RanMixedContent() override; |
+ bool DisplayedMixedContent() override; |
+ void GetSCTVerifyStatuses( |
+ std::vector<net::ct::SCTVerifyStatus>* sct_verify_statuses) override; |
+ |
+ private: |
+ explicit ChromeSecurityStateModelDelegate(content::WebContents* web_contents); |
+ friend class content::WebContentsUserData<ChromeSecurityStateModelDelegate>; |
+ |
+ content::WebContents* web_contents_; |
+ scoped_ptr<security_state::SecurityStateModel> security_state_model_; |
+ content::SSLStatus visible_ssl_status_; |
+ GURL visible_url_; |
+ GURL empty_url_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(ChromeSecurityStateModelDelegate); |
+}; |
+ |
+#endif // CHROME_BROWSER_SSL_CHROME_SECURITY_STATE_MODEL_DELEGATE_H_ |