| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 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 CHROME_BROWSER_SSL_SECURITY_STATE_MODEL_CLIENT_H_ | 5 #ifndef COMPONENTS_SECURITY_STATE_SECURITY_STATE_MODEL_CLIENT_H_ |
| 6 #define CHROME_BROWSER_SSL_SECURITY_STATE_MODEL_CLIENT_H_ | 6 #define COMPONENTS_SECURITY_STATE_SECURITY_STATE_MODEL_CLIENT_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
| 10 #include "chrome/browser/ssl/security_state_model.h" | 10 #include "components/security_state/security_state_model.h" |
| 11 #include "net/cert/cert_status_flags.h" | 11 #include "net/cert/cert_status_flags.h" |
| 12 | 12 |
| 13 namespace net { | 13 namespace net { |
| 14 class X509Certificate; | 14 class X509Certificate; |
| 15 } // namespace net | 15 } // namespace net |
| 16 | 16 |
| 17 namespace security_state { |
| 18 |
| 17 // Provides embedder-specific information that a SecurityStateModel | 19 // Provides embedder-specific information that a SecurityStateModel |
| 18 // needs to determine the page's security status. | 20 // needs to determine the page's security status. |
| 19 class SecurityStateModelClient { | 21 class SecurityStateModelClient { |
| 20 public: | 22 public: |
| 21 SecurityStateModelClient() {} | 23 SecurityStateModelClient() {} |
| 22 virtual ~SecurityStateModelClient() {} | 24 virtual ~SecurityStateModelClient() {} |
| 23 | 25 |
| 24 // Retrieves the visible security state that is relevant to the | 26 // Retrieves the visible security state that is relevant to the |
| 25 // SecurityStateModel. | 27 // SecurityStateModel. |
| 26 virtual void GetVisibleSecurityState( | 28 virtual void GetVisibleSecurityState( |
| 27 SecurityStateModel::VisibleSecurityState* state) = 0; | 29 SecurityStateModel::VisibleSecurityState* state) = 0; |
| 28 | 30 |
| 29 // Returns the certificate used to load the page or request. | 31 // Returns the certificate used to load the page or request. |
| 30 virtual bool RetrieveCert(scoped_refptr<net::X509Certificate>* cert) = 0; | 32 virtual bool RetrieveCert(scoped_refptr<net::X509Certificate>* cert) = 0; |
| 31 | 33 |
| 32 // Returns true if the page or request is known to be loaded with a | 34 // Returns true if the page or request is known to be loaded with a |
| 33 // certificate installed by the system administrator. | 35 // certificate installed by the system administrator. |
| 34 virtual bool UsedPolicyInstalledCertificate() = 0; | 36 virtual bool UsedPolicyInstalledCertificate() = 0; |
| 35 | 37 |
| 36 // Returns true if the given |url|'s origin should be considered secure. | 38 // Returns true if the given |url|'s origin should be considered secure. |
| 37 virtual bool IsOriginSecure(const GURL& url) = 0; | 39 virtual bool IsOriginSecure(const GURL& url) = 0; |
| 38 | 40 |
| 39 private: | 41 private: |
| 40 DISALLOW_COPY_AND_ASSIGN(SecurityStateModelClient); | 42 DISALLOW_COPY_AND_ASSIGN(SecurityStateModelClient); |
| 41 }; | 43 }; |
| 42 | 44 |
| 43 #endif // CHROME_BROWSER_SSL_SECURITY_STATE_MODEL_CLIENT_H_ | 45 } // namespace security_state |
| 46 |
| 47 #endif // COMPONENTS_SECURITY_STATE_SECURITY_STATE_MODEL_CLIENT_H_ |
| OLD | NEW |