| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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 CONTENT_BROWSER_SSL_SSL_POLICY_H_ | 5 #ifndef CONTENT_BROWSER_SSL_SSL_POLICY_H_ |
| 6 #define CONTENT_BROWSER_SSL_SSL_POLICY_H_ | 6 #define CONTENT_BROWSER_SSL_SSL_POLICY_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| 11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
| 12 #include "content/public/common/resource_type.h" | 12 #include "content/public/common/resource_type.h" |
| 13 #include "content/public/common/security_style.h" | 13 #include "content/public/common/security_style.h" |
| 14 #include "net/cert/cert_status_flags.h" | 14 #include "net/cert/cert_status_flags.h" |
| 15 | 15 |
| 16 class GURL; | 16 class GURL; |
| 17 | 17 |
| 18 namespace content { | 18 namespace content { |
| 19 class NavigationEntryImpl; | 19 class NavigationEntryImpl; |
| 20 class SSLCertErrorHandler; | 20 class SSLCertErrorHandler; |
| 21 class SSLPolicyBackend; | 21 class SSLPolicyBackend; |
| 22 class SSLRequestInfo; | |
| 23 class WebContents; | 22 class WebContents; |
| 24 | 23 |
| 25 // SSLPolicy | 24 // SSLPolicy |
| 26 // | 25 // |
| 27 // This class is responsible for making the security decisions that concern the | 26 // This class is responsible for making the security decisions that concern the |
| 28 // SSL trust indicators. It relies on the SSLPolicyBackend to actually enact | 27 // SSL trust indicators. It relies on the SSLPolicyBackend to actually enact |
| 29 // the decisions it reaches. | 28 // the decisions it reaches. |
| 30 // | 29 // |
| 31 class SSLPolicy { | 30 class SSLPolicy { |
| 32 public: | 31 public: |
| 33 explicit SSLPolicy(SSLPolicyBackend* backend); | 32 explicit SSLPolicy(SSLPolicyBackend* backend); |
| 34 | 33 |
| 35 // An error occurred with the certificate in an SSL connection. | 34 // An error occurred with the certificate in an SSL connection. |
| 36 void OnCertError(SSLCertErrorHandler* handler); | 35 void OnCertError(SSLCertErrorHandler* handler); |
| 37 | 36 |
| 38 void DidRunInsecureContent(NavigationEntryImpl* entry, | 37 void DidRunInsecureContent(NavigationEntryImpl* entry, |
| 39 const GURL& security_origin); | 38 const GURL& security_origin); |
| 40 | 39 |
| 41 // We have started a resource request with the given info. | 40 // We have started a resource request for |url| with the given |cert_id| and |
| 42 void OnRequestStarted(SSLRequestInfo* info); | 41 // |cert_status|. |
| 42 void OnRequestStarted(const GURL& url, |
| 43 int cert_id, |
| 44 net::CertStatus cert_status); |
| 43 | 45 |
| 44 // Update the SSL information in |entry| to match the current state. | 46 // Update the SSL information in |entry| to match the current state. |
| 45 // |web_contents| is the WebContents associated with this entry. | 47 // |web_contents| is the WebContents associated with this entry. |
| 46 void UpdateEntry(NavigationEntryImpl* entry, WebContents* web_contents); | 48 void UpdateEntry(NavigationEntryImpl* entry, WebContents* web_contents); |
| 47 | 49 |
| 48 SSLPolicyBackend* backend() const { return backend_; } | 50 SSLPolicyBackend* backend() const { return backend_; } |
| 49 | 51 |
| 50 // Returns a security style describing an individual resource. Does | 52 // Returns a security style describing an individual resource. Does |
| 51 // not take into account any of the page- or host-level state such as | 53 // not take into account any of the page- or host-level state such as |
| 52 // mixed content or whether the host has run insecure content. | 54 // mixed content or whether the host has run insecure content. |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 | 88 |
| 87 // The backend we use to enact our decisions. | 89 // The backend we use to enact our decisions. |
| 88 SSLPolicyBackend* backend_; | 90 SSLPolicyBackend* backend_; |
| 89 | 91 |
| 90 DISALLOW_COPY_AND_ASSIGN(SSLPolicy); | 92 DISALLOW_COPY_AND_ASSIGN(SSLPolicy); |
| 91 }; | 93 }; |
| 92 | 94 |
| 93 } // namespace content | 95 } // namespace content |
| 94 | 96 |
| 95 #endif // CONTENT_BROWSER_SSL_SSL_POLICY_H_ | 97 #endif // CONTENT_BROWSER_SSL_SSL_POLICY_H_ |
| OLD | NEW |