| 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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 // Indicates whether or not the site the user is trying to connect to has | 50 // Indicates whether or not the site the user is trying to connect to has |
| 51 // requested strict enforcement of certificate validation (e.g. with HTTP | 51 // requested strict enforcement of certificate validation (e.g. with HTTP |
| 52 // Strict-Transport-Security). | 52 // Strict-Transport-Security). |
| 53 STRICT_ENFORCEMENT = 1 << 1, | 53 STRICT_ENFORCEMENT = 1 << 1, |
| 54 // Indicates whether a user decision had been previously made but the | 54 // Indicates whether a user decision had been previously made but the |
| 55 // decision has expired. | 55 // decision has expired. |
| 56 EXPIRED_BUT_PREVIOUSLY_ALLOWED = 1 << 2 | 56 EXPIRED_BUT_PREVIOUSLY_ALLOWED = 1 << 2 |
| 57 }; | 57 }; |
| 58 | 58 |
| 59 // Interstitial type, used in tests. | 59 // Interstitial type, used in tests. |
| 60 static const void* kTypeForTesting; | 60 static InterstitialPageDelegate::TypeID kTypeForTesting; |
| 61 | 61 |
| 62 ~SSLBlockingPage() override; | 62 ~SSLBlockingPage() override; |
| 63 | 63 |
| 64 // Creates an SSL blocking page. If the blocking page isn't shown, the caller | 64 // Creates an SSL blocking page. If the blocking page isn't shown, the caller |
| 65 // is responsible for cleaning up the blocking page, otherwise the | 65 // is responsible for cleaning up the blocking page, otherwise the |
| 66 // interstitial takes ownership when shown. |options_mask| must be a bitwise | 66 // interstitial takes ownership when shown. |options_mask| must be a bitwise |
| 67 // mask of SSLBlockingPageOptionsMask values. | 67 // mask of SSLBlockingPageOptionsMask values. |
| 68 SSLBlockingPage(content::WebContents* web_contents, | 68 SSLBlockingPage(content::WebContents* web_contents, |
| 69 int cert_error, | 69 int cert_error, |
| 70 const net::SSLInfo& ssl_info, | 70 const net::SSLInfo& ssl_info, |
| 71 const GURL& request_url, | 71 const GURL& request_url, |
| 72 int options_mask, | 72 int options_mask, |
| 73 const base::Time& time_triggered, | 73 const base::Time& time_triggered, |
| 74 const base::Callback<void(bool)>& callback); | 74 const base::Callback<void(bool)>& callback); |
| 75 | 75 |
| 76 // SecurityInterstitialPage method: | 76 // InterstitialPageDelegate method: |
| 77 const void* GetTypeForTesting() const override; | 77 InterstitialPageDelegate::TypeID GetTypeForTesting() const override; |
| 78 | 78 |
| 79 // Returns true if |options_mask| refers to an overridable SSL error. | 79 // Returns true if |options_mask| refers to an overridable SSL error. |
| 80 static bool IsOptionsOverridable(int options_mask); | 80 static bool IsOptionsOverridable(int options_mask); |
| 81 | 81 |
| 82 protected: | 82 protected: |
| 83 // InterstitialPageDelegate implementation. | 83 // InterstitialPageDelegate implementation. |
| 84 void CommandReceived(const std::string& command) override; | 84 void CommandReceived(const std::string& command) override; |
| 85 void OverrideEntry(content::NavigationEntry* entry) override; | 85 void OverrideEntry(content::NavigationEntry* entry) override; |
| 86 void OverrideRendererPrefs(content::RendererPreferences* prefs) override; | 86 void OverrideRendererPrefs(content::RendererPreferences* prefs) override; |
| 87 void OnProceed() override; | 87 void OnProceed() override; |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 // Which type of interstitial this is. | 126 // Which type of interstitial this is. |
| 127 enum SSLInterstitialReason { | 127 enum SSLInterstitialReason { |
| 128 SSL_REASON_SSL, | 128 SSL_REASON_SSL, |
| 129 SSL_REASON_BAD_CLOCK | 129 SSL_REASON_BAD_CLOCK |
| 130 } interstitial_reason_; | 130 } interstitial_reason_; |
| 131 | 131 |
| 132 DISALLOW_COPY_AND_ASSIGN(SSLBlockingPage); | 132 DISALLOW_COPY_AND_ASSIGN(SSLBlockingPage); |
| 133 }; | 133 }; |
| 134 | 134 |
| 135 #endif // CHROME_BROWSER_SSL_SSL_BLOCKING_PAGE_H_ | 135 #endif // CHROME_BROWSER_SSL_SSL_BLOCKING_PAGE_H_ |
| OLD | NEW |