| 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 |
| 11 #include "base/callback.h" | 11 #include "base/callback.h" |
| 12 #include "base/strings/string16.h" | 12 #include "base/strings/string16.h" |
| 13 #include "base/task/cancelable_task_tracker.h" | 13 #include "base/task/cancelable_task_tracker.h" |
| 14 #include "base/time/time.h" | 14 #include "base/time/time.h" |
| 15 #include "chrome/browser/interstitials/security_interstitial_metrics_helper.h" |
| 15 #include "chrome/browser/interstitials/security_interstitial_page.h" | 16 #include "chrome/browser/interstitials/security_interstitial_page.h" |
| 16 #include "chrome/browser/interstitials/security_interstitial_uma_helper.h" | |
| 17 #include "net/ssl/ssl_info.h" | 17 #include "net/ssl/ssl_info.h" |
| 18 #include "url/gurl.h" | 18 #include "url/gurl.h" |
| 19 | 19 |
| 20 #if defined(ENABLE_EXTENSIONS) | 20 #if defined(ENABLE_EXTENSIONS) |
| 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; |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 | 88 |
| 89 // SecurityInterstitialPage implementation: | 89 // SecurityInterstitialPage implementation: |
| 90 bool ShouldCreateNewNavigation() const override; | 90 bool ShouldCreateNewNavigation() const override; |
| 91 void PopulateInterstitialStrings( | 91 void PopulateInterstitialStrings( |
| 92 base::DictionaryValue* load_time_data) override; | 92 base::DictionaryValue* load_time_data) override; |
| 93 | 93 |
| 94 private: | 94 private: |
| 95 void NotifyDenyCertificate(); | 95 void NotifyDenyCertificate(); |
| 96 void NotifyAllowCertificate(); | 96 void NotifyAllowCertificate(); |
| 97 | 97 |
| 98 std::string GetHistogramPrefix() const; | 98 std::string GetUmaHistogramPrefix() const; |
| 99 std::string GetSamplingEventName() const; | 99 std::string GetSamplingEventName() const; |
| 100 | 100 |
| 101 base::Callback<void(bool)> callback_; | 101 base::Callback<void(bool)> callback_; |
| 102 | 102 |
| 103 const int cert_error_; | 103 const int cert_error_; |
| 104 const net::SSLInfo ssl_info_; | 104 const net::SSLInfo ssl_info_; |
| 105 // There are two ways for the user to override an interstitial: | 105 // There are two ways for the user to override an interstitial: |
| 106 // | 106 // |
| 107 // overridable_) By clicking on "Advanced" and then "Proceed". | 107 // overridable_) By clicking on "Advanced" and then "Proceed". |
| 108 // - This corresponds to "the user can override using the UI". | 108 // - This corresponds to "the user can override using the UI". |
| 109 // danger_overridable_) By typing the word "danger". | 109 // danger_overridable_) By typing the word "danger". |
| 110 // - This is an undocumented workaround. | 110 // - This is an undocumented workaround. |
| 111 // - This can be set to "false" dynamically to prevent the behaviour. | 111 // - This can be set to "false" dynamically to prevent the behaviour. |
| 112 const bool overridable_; | 112 const bool overridable_; |
| 113 bool danger_overridable_; | 113 bool danger_overridable_; |
| 114 // Has the site requested strict enforcement of certificate errors? | 114 // Has the site requested strict enforcement of certificate errors? |
| 115 const bool strict_enforcement_; | 115 const bool strict_enforcement_; |
| 116 // Did the user previously allow a bad certificate but the decision has now | 116 // Did the user previously allow a bad certificate but the decision has now |
| 117 // expired? | 117 // expired? |
| 118 const bool expired_but_previously_allowed_; | 118 const bool expired_but_previously_allowed_; |
| 119 scoped_ptr<SSLErrorClassification> ssl_error_classification_; | 119 scoped_ptr<SSLErrorClassification> ssl_error_classification_; |
| 120 scoped_ptr<SecurityInterstitialUmaHelper> uma_helper_; | 120 scoped_ptr<SecurityInterstitialMetricsHelper> metrics_helper_; |
| 121 | 121 |
| 122 // Which type of Safe Browsing interstitial this is. | 122 // Which type of interstitial this is. |
| 123 enum SSLInterstitialReason { | 123 enum SSLInterstitialReason { |
| 124 SSL_REASON_SSL, | 124 SSL_REASON_SSL, |
| 125 SSL_REASON_BAD_CLOCK | 125 SSL_REASON_BAD_CLOCK |
| 126 } interstitial_reason_; | 126 } interstitial_reason_; |
| 127 | 127 |
| 128 DISALLOW_COPY_AND_ASSIGN(SSLBlockingPage); | 128 DISALLOW_COPY_AND_ASSIGN(SSLBlockingPage); |
| 129 }; | 129 }; |
| 130 | 130 |
| 131 #endif // CHROME_BROWSER_SSL_SSL_BLOCKING_PAGE_H_ | 131 #endif // CHROME_BROWSER_SSL_SSL_BLOCKING_PAGE_H_ |
| OLD | NEW |