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 CHROME_BROWSER_SSL_SSL_BLOCKING_PAGE_H_ | 5 #ifndef CHROME_BROWSER_SSL_SSL_BLOCKING_PAGE_H_ |
6 #define CHROME_BROWSER_SSL_SSL_BLOCKING_PAGE_H_ | 6 #define CHROME_BROWSER_SSL_SSL_BLOCKING_PAGE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 12 matching lines...) Expand all Loading... |
23 extern const char kHTTPSErrorReporterFinchGroupShowPossiblySend[]; | 23 extern const char kHTTPSErrorReporterFinchGroupShowPossiblySend[]; |
24 extern const char kHTTPSErrorReporterFinchGroupDontShowDontSend[]; | 24 extern const char kHTTPSErrorReporterFinchGroupDontShowDontSend[]; |
25 extern const char kHTTPSErrorReporterFinchParamName[]; | 25 extern const char kHTTPSErrorReporterFinchParamName[]; |
26 | 26 |
27 #if defined(ENABLE_EXTENSIONS) | 27 #if defined(ENABLE_EXTENSIONS) |
28 namespace extensions { | 28 namespace extensions { |
29 class ExperienceSamplingEvent; | 29 class ExperienceSamplingEvent; |
30 } | 30 } |
31 #endif | 31 #endif |
32 | 32 |
| 33 namespace policy { |
| 34 class PolicyTest_SSLErrorOverridingDisallowed_Test; |
| 35 } |
| 36 |
33 class SSLErrorClassification; | 37 class SSLErrorClassification; |
34 | 38 |
35 // This class is responsible for showing/hiding the interstitial page that is | 39 // This class is responsible for showing/hiding the interstitial page that is |
36 // shown when a certificate error happens. | 40 // shown when a certificate error happens. |
37 // It deletes itself when the interstitial page is closed. | 41 // It deletes itself when the interstitial page is closed. |
38 class SSLBlockingPage : public SecurityInterstitialPage { | 42 class SSLBlockingPage : public SecurityInterstitialPage { |
39 public: | 43 public: |
40 enum SSLBlockingPageOptionsMask { | 44 enum SSLBlockingPageOptionsMask { |
41 // Indicates whether or not the user could (assuming perfect knowledge) | 45 // Indicates whether or not the user could (assuming perfect knowledge) |
42 // successfully override the error and still get the security guarantees | 46 // successfully override the error and still get the security guarantees |
(...skipping 26 matching lines...) Expand all Loading... |
69 scoped_ptr<SSLCertReporter> ssl_cert_reporter, | 73 scoped_ptr<SSLCertReporter> ssl_cert_reporter, |
70 const base::Callback<void(bool)>& callback); | 74 const base::Callback<void(bool)>& callback); |
71 | 75 |
72 // InterstitialPageDelegate method: | 76 // InterstitialPageDelegate method: |
73 InterstitialPageDelegate::TypeID GetTypeForTesting() const override; | 77 InterstitialPageDelegate::TypeID GetTypeForTesting() const override; |
74 | 78 |
75 // Returns true if |options_mask| refers to an overridable SSL error and | 79 // Returns true if |options_mask| refers to an overridable SSL error and |
76 // if SSL error overriding is allowed by policy. | 80 // if SSL error overriding is allowed by policy. |
77 static bool IsOverridable(int options_mask, const Profile* const profile); | 81 static bool IsOverridable(int options_mask, const Profile* const profile); |
78 | 82 |
| 83 static bool DoesPolicyAllowDangerOverride(const Profile* const profile); |
| 84 |
79 void SetSSLCertReporterForTesting( | 85 void SetSSLCertReporterForTesting( |
80 scoped_ptr<SSLCertReporter> ssl_cert_reporter); | 86 scoped_ptr<SSLCertReporter> ssl_cert_reporter); |
81 | 87 |
82 protected: | 88 protected: |
| 89 friend class policy::PolicyTest_SSLErrorOverridingDisallowed_Test; |
| 90 |
83 // InterstitialPageDelegate implementation. | 91 // InterstitialPageDelegate implementation. |
84 void CommandReceived(const std::string& command) override; | 92 void CommandReceived(const std::string& command) override; |
85 void OverrideEntry(content::NavigationEntry* entry) override; | 93 void OverrideEntry(content::NavigationEntry* entry) override; |
86 void OverrideRendererPrefs(content::RendererPreferences* prefs) override; | 94 void OverrideRendererPrefs(content::RendererPreferences* prefs) override; |
87 void OnProceed() override; | 95 void OnProceed() override; |
88 void OnDontProceed() override; | 96 void OnDontProceed() override; |
89 | 97 |
90 // SecurityInterstitialPage implementation: | 98 // SecurityInterstitialPage implementation: |
91 bool ShouldCreateNewNavigation() const override; | 99 bool ShouldCreateNewNavigation() const override; |
92 void PopulateInterstitialStrings( | 100 void PopulateInterstitialStrings( |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 // Which type of interstitial this is. | 150 // Which type of interstitial this is. |
143 enum SSLInterstitialReason { | 151 enum SSLInterstitialReason { |
144 SSL_REASON_SSL, | 152 SSL_REASON_SSL, |
145 SSL_REASON_BAD_CLOCK | 153 SSL_REASON_BAD_CLOCK |
146 } interstitial_reason_; | 154 } interstitial_reason_; |
147 | 155 |
148 DISALLOW_COPY_AND_ASSIGN(SSLBlockingPage); | 156 DISALLOW_COPY_AND_ASSIGN(SSLBlockingPage); |
149 }; | 157 }; |
150 | 158 |
151 #endif // CHROME_BROWSER_SSL_SSL_BLOCKING_PAGE_H_ | 159 #endif // CHROME_BROWSER_SSL_SSL_BLOCKING_PAGE_H_ |
OLD | NEW |