| 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 10 matching lines...) Expand all Loading... |
| 21 namespace extensions { | 21 namespace extensions { |
| 22 class ExperienceSamplingEvent; | 22 class ExperienceSamplingEvent; |
| 23 } | 23 } |
| 24 #endif | 24 #endif |
| 25 | 25 |
| 26 class SSLErrorClassification; | 26 class SSLErrorClassification; |
| 27 | 27 |
| 28 // This class is responsible for showing/hiding the interstitial page that is | 28 // This class is responsible for showing/hiding the interstitial page that is |
| 29 // shown when a certificate error happens. | 29 // shown when a certificate error happens. |
| 30 // It deletes itself when the interstitial page is closed. | 30 // It deletes itself when the interstitial page is closed. |
| 31 class SSLBlockingPage : public SecurityInterstitialPage { | 31 class SSLBlockingPage : public SecurityInterstitialPageWithExtendedReporting { |
| 32 public: | 32 public: |
| 33 // These represent the commands sent from the interstitial JavaScript. They | 33 // These represent the commands sent from the interstitial |
| 34 // are defined in chrome/browser/resources/ssl/ssl_errors_common.js. | 34 // JavaScript. They are defined in |
| 35 // DO NOT reorder or change these without also changing the JavaScript! | 35 // chrome/browser/resources/security_warnings/ssl_errors_common.js. |
| 36 // DO NOT reorder or change these without also changing the |
| 37 // JavaScript! |
| 36 enum SSLBlockingPageCommands { | 38 enum SSLBlockingPageCommands { |
| 37 CMD_DONT_PROCEED = 0, | 39 CMD_DONT_PROCEED = 0, |
| 38 CMD_PROCEED = 1, | 40 CMD_PROCEED = 1, |
| 39 CMD_MORE = 2, | 41 CMD_MORE = 2, |
| 40 CMD_RELOAD = 3, | 42 CMD_RELOAD = 3, |
| 41 CMD_HELP = 4, | 43 CMD_HELP = 4, |
| 42 CMD_CLOCK = 5 | 44 CMD_CLOCK = 5, |
| 45 CMD_DO_REPORT = 6, |
| 46 CMD_DONT_REPORT = 7 |
| 43 }; | 47 }; |
| 44 | 48 |
| 45 enum SSLBlockingPageOptionsMask { | 49 enum SSLBlockingPageOptionsMask { |
| 46 // Indicates whether or not the user could (assuming perfect knowledge) | 50 // Indicates whether or not the user could (assuming perfect knowledge) |
| 47 // successfully override the error and still get the security guarantees | 51 // successfully override the error and still get the security guarantees |
| 48 // of TLS. | 52 // of TLS. |
| 49 OVERRIDABLE = 1 << 0, | 53 OVERRIDABLE = 1 << 0, |
| 50 // Indicates whether or not the site the user is trying to connect to has | 54 // 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 | 55 // requested strict enforcement of certificate validation (e.g. with HTTP |
| 52 // Strict-Transport-Security). | 56 // Strict-Transport-Security). |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 void OverrideEntry(content::NavigationEntry* entry) override; | 88 void OverrideEntry(content::NavigationEntry* entry) override; |
| 85 void OverrideRendererPrefs(content::RendererPreferences* prefs) override; | 89 void OverrideRendererPrefs(content::RendererPreferences* prefs) override; |
| 86 void OnProceed() override; | 90 void OnProceed() override; |
| 87 void OnDontProceed() override; | 91 void OnDontProceed() override; |
| 88 | 92 |
| 89 // SecurityInterstitialPage implementation: | 93 // SecurityInterstitialPage implementation: |
| 90 bool ShouldCreateNewNavigation() const override; | 94 bool ShouldCreateNewNavigation() const override; |
| 91 void PopulateInterstitialStrings( | 95 void PopulateInterstitialStrings( |
| 92 base::DictionaryValue* load_time_data) override; | 96 base::DictionaryValue* load_time_data) override; |
| 93 | 97 |
| 98 // SecurityInterstitialPageWithExtendedReporting implementation: |
| 99 void PopulateExtendedReportingOption( |
| 100 base::DictionaryValue* load_time_data) override; |
| 101 |
| 94 private: | 102 private: |
| 95 void NotifyDenyCertificate(); | 103 void NotifyDenyCertificate(); |
| 96 void NotifyAllowCertificate(); | 104 void NotifyAllowCertificate(); |
| 97 | 105 |
| 98 std::string GetUmaHistogramPrefix() const; | 106 std::string GetUmaHistogramPrefix() const; |
| 99 std::string GetSamplingEventName() const; | 107 std::string GetSamplingEventName() const; |
| 100 | 108 |
| 109 void FinishCertCollection(); |
| 110 |
| 101 base::Callback<void(bool)> callback_; | 111 base::Callback<void(bool)> callback_; |
| 102 | 112 |
| 103 const int cert_error_; | 113 const int cert_error_; |
| 104 const net::SSLInfo ssl_info_; | 114 const net::SSLInfo ssl_info_; |
| 105 // There are two ways for the user to override an interstitial: | 115 // There are two ways for the user to override an interstitial: |
| 106 // | 116 // |
| 107 // overridable_) By clicking on "Advanced" and then "Proceed". | 117 // overridable_) By clicking on "Advanced" and then "Proceed". |
| 108 // - This corresponds to "the user can override using the UI". | 118 // - This corresponds to "the user can override using the UI". |
| 109 // danger_overridable_) By typing the word "danger". | 119 // danger_overridable_) By typing the word "danger". |
| 110 // - This is an undocumented workaround. | 120 // - This is an undocumented workaround. |
| (...skipping 11 matching lines...) Expand all Loading... |
| 122 // Which type of interstitial this is. | 132 // Which type of interstitial this is. |
| 123 enum SSLInterstitialReason { | 133 enum SSLInterstitialReason { |
| 124 SSL_REASON_SSL, | 134 SSL_REASON_SSL, |
| 125 SSL_REASON_BAD_CLOCK | 135 SSL_REASON_BAD_CLOCK |
| 126 } interstitial_reason_; | 136 } interstitial_reason_; |
| 127 | 137 |
| 128 DISALLOW_COPY_AND_ASSIGN(SSLBlockingPage); | 138 DISALLOW_COPY_AND_ASSIGN(SSLBlockingPage); |
| 129 }; | 139 }; |
| 130 | 140 |
| 131 #endif // CHROME_BROWSER_SSL_SSL_BLOCKING_PAGE_H_ | 141 #endif // CHROME_BROWSER_SSL_SSL_BLOCKING_PAGE_H_ |
| OLD | NEW |