OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2014 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_CHROME_SSL_HOST_STATE_DECISIONS_H_ |
| 6 #define CHROME_BROWSER_SSL_CHROME_SSL_HOST_STATE_DECISIONS_H_ |
| 7 |
| 8 #include "base/time/clock.h" |
| 9 #include "content/public/browser/ssl_host_state_decisions.h" |
| 10 |
| 11 class GURL; |
| 12 class Profile; |
| 13 |
| 14 namespace base { |
| 15 |
| 16 class DictionaryValue; |
| 17 |
| 18 } // namespace base |
| 19 |
| 20 class ChromeSSLHostStateDecisions : public content::SSLHostStateDecisions { |
| 21 public: |
| 22 explicit ChromeSSLHostStateDecisions(Profile* profile); |
| 23 |
| 24 // SSLHostStateDecisions: |
| 25 virtual void DenyCert(const GURL& url, |
| 26 net::X509Certificate* cert, |
| 27 net::CertStatus error) OVERRIDE; |
| 28 virtual void AllowCert(const GURL& url, |
| 29 net::X509Certificate* cert, |
| 30 net::CertStatus error) OVERRIDE; |
| 31 virtual void Clear() OVERRIDE; |
| 32 virtual net::CertPolicy::Judgment QueryPolicy(const GURL& url, |
| 33 net::X509Certificate* cert, |
| 34 net::CertStatus error) OVERRIDE; |
| 35 virtual void RevokeAllowAndDenyPreferences(const GURL& url) OVERRIDE; |
| 36 virtual bool HasAllowedOrDeniedCert(const GURL& url) OVERRIDE; |
| 37 |
| 38 // Called on the UI thread when the profile is about to be destroyed. |
| 39 void ShutdownOnUIThread() {} |
| 40 |
| 41 protected: |
| 42 virtual ~ChromeSSLHostStateDecisions(); |
| 43 |
| 44 // SetClock takes ownership of the passed in clock. |
| 45 void SetClock(scoped_ptr<base::Clock> clock) { |
| 46 clock_.reset(clock.release()); |
| 47 } |
| 48 |
| 49 private: |
| 50 friend class RememberSSLHostStateDecisionsTest; |
| 51 FRIEND_TEST_ALL_PREFIXES(RememberSSLHostStateDecisionsTest, AfterRestart); |
| 52 |
| 53 void ChangeCertPolicy(const GURL& url, |
| 54 net::X509Certificate* cert, |
| 55 net::CertStatus error, |
| 56 net::CertPolicy::Judgment judgment); |
| 57 base::DictionaryValue* GetValidCertDecisionsDict(base::DictionaryValue* dict, |
| 58 bool create_entries); |
| 59 |
| 60 scoped_ptr<base::Clock> clock_; |
| 61 const base::TimeDelta defaultSSLCertDecisionExpirationDelta_; |
| 62 Profile* profile_; |
| 63 |
| 64 DISALLOW_COPY_AND_ASSIGN(ChromeSSLHostStateDecisions); |
| 65 }; |
| 66 |
| 67 #endif // CHROME_BROWSER_SSL_CHROME_SSL_HOST_STATE_DECISIONS_H_ |
OLD | NEW |