| OLD | NEW |
| (Empty) | |
| 1 // Copyright (c) 2006-2009 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 CHROME_BROWSER_SSL_SSL_HOST_STATE_H_ |
| 6 #define CHROME_BROWSER_SSL_SSL_HOST_STATE_H_ |
| 7 |
| 8 #include <string> |
| 9 #include <map> |
| 10 #include <set> |
| 11 |
| 12 #include "base/basictypes.h" |
| 13 #include "base/non_thread_safe.h" |
| 14 #include "googleurl/src/gurl.h" |
| 15 #include "net/base/x509_certificate.h" |
| 16 |
| 17 // SSLHostState |
| 18 // |
| 19 // The SSLHostState encapulates the host-specific state for SSL errors. For |
| 20 // example, SSLHostState rememebers whether the user has whitelisted a |
| 21 // particular broken cert for use with particular host. We separate this state |
| 22 // from the SSLManager because this state is shared across many navigation |
| 23 // controllers. |
| 24 |
| 25 class SSLHostState : public NonThreadSafe { |
| 26 public: |
| 27 SSLHostState(); |
| 28 ~SSLHostState(); |
| 29 |
| 30 // Records that |cert| is permitted to be used for |host| in the future. |
| 31 void DenyCertForHost(net::X509Certificate* cert, const std::string& host); |
| 32 |
| 33 // Records that |cert| is not permitted to be used for |host| in the future. |
| 34 void AllowCertForHost(net::X509Certificate* cert, const std::string& host); |
| 35 |
| 36 // Queries whether |cert| is allowed or denied for |host|. |
| 37 net::X509Certificate::Policy::Judgment QueryPolicy( |
| 38 net::X509Certificate* cert, const std::string& host); |
| 39 |
| 40 // Allow mixed/unsafe content to be visible (non filtered) for the specified |
| 41 // URL. |
| 42 // Note that the current implementation allows on a host name basis. |
| 43 void AllowShowInsecureContentForURL(const GURL& url); |
| 44 |
| 45 // Returns whether the specified URL is allowed to show insecure (mixed or |
| 46 // unsafe) content. |
| 47 bool CanShowInsecureContent(const GURL& url); |
| 48 |
| 49 private: |
| 50 // Certificate policies for each host. |
| 51 std::map<std::string, net::X509Certificate::Policy> cert_policy_for_host_; |
| 52 |
| 53 // Domains for which it is OK to show insecure content. |
| 54 std::set<std::string> can_show_insecure_content_for_host_; |
| 55 |
| 56 DISALLOW_COPY_AND_ASSIGN(SSLHostState); |
| 57 }; |
| 58 |
| 59 #endif // CHROME_BROWSER_SSL_SSL_HOST_STATE_H_ |
| OLD | NEW |