Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(151)

Side by Side Diff: chrome/browser/ssl/chrome_ssl_host_state_decisions.h

Issue 369703002: Remember user decisions on invalid certificates behind a flag (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: More changes from felt Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(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 enum CreateDictionaryEntriesDisposition {
51 CreateDictionaryEntries,
52 DoNotCreateDictionaryEntries
53 };
54 enum RememberSSLExceptionDecisionsDisposition {
55 ForgetSSLExceptionDecisionsAtSessionEnd,
56 RememberSSLExceptionDecisionsForDelta
57 };
58
59 void ChangeCertPolicy(const GURL& url,
60 net::X509Certificate* cert,
61 net::CertStatus error,
62 net::CertPolicy::Judgment judgment);
63 base::DictionaryValue* GetValidCertDecisionsDict(
64 base::DictionaryValue* dict,
65 CreateDictionaryEntriesDisposition create_entries);
66
67 scoped_ptr<base::Clock> clock_;
68 RememberSSLExceptionDecisionsDisposition shouldRememberSSLDecisions_;
69 base::TimeDelta defaultSSLCertDecisionExpirationDelta_;
70 Profile* profile_;
71
72 friend class ForgetInstantlySSLHostStateDecisionsTest;
73 friend class RememberSSLHostStateDecisionsTest;
74 FRIEND_TEST_ALL_PREFIXES(ForgetInstantlySSLHostStateDecisionsTest,
75 MakeAndForgetException);
76 FRIEND_TEST_ALL_PREFIXES(RememberSSLHostStateDecisionsTest, AfterRestart);
77
78 DISALLOW_COPY_AND_ASSIGN(ChromeSSLHostStateDecisions);
79 };
80
81 #endif // CHROME_BROWSER_SSL_CHROME_SSL_HOST_STATE_DECISIONS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698