| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #include "chrome/browser/ssl/bad_clock_blocking_page.h" | 5 #include "chrome/browser/ssl/bad_clock_blocking_page.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/callback_helpers.h" | 9 #include "base/callback_helpers.h" |
| 10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 return BadClockBlockingPage::kTypeForTesting; | 99 return BadClockBlockingPage::kTypeForTesting; |
| 100 } | 100 } |
| 101 | 101 |
| 102 void BadClockBlockingPage::PopulateInterstitialStrings( | 102 void BadClockBlockingPage::PopulateInterstitialStrings( |
| 103 base::DictionaryValue* load_time_data) { | 103 base::DictionaryValue* load_time_data) { |
| 104 bad_clock_ui_->PopulateStringsForHTML(load_time_data); | 104 bad_clock_ui_->PopulateStringsForHTML(load_time_data); |
| 105 cert_report_helper_->PopulateExtendedReportingOption(load_time_data); | 105 cert_report_helper_->PopulateExtendedReportingOption(load_time_data); |
| 106 } | 106 } |
| 107 | 107 |
| 108 void BadClockBlockingPage::OverrideEntry(NavigationEntry* entry) { | 108 void BadClockBlockingPage::OverrideEntry(NavigationEntry* entry) { |
| 109 entry->GetSSL() = content::SSLStatus( | 109 entry->GetSSL() = content::SSLStatus(ssl_info_.cert, ssl_info_); |
| 110 content::SECURITY_STYLE_AUTHENTICATION_BROKEN, ssl_info_.cert, ssl_info_); | |
| 111 } | 110 } |
| 112 | 111 |
| 113 void BadClockBlockingPage::SetSSLCertReporterForTesting( | 112 void BadClockBlockingPage::SetSSLCertReporterForTesting( |
| 114 std::unique_ptr<SSLCertReporter> ssl_cert_reporter) { | 113 std::unique_ptr<SSLCertReporter> ssl_cert_reporter) { |
| 115 cert_report_helper_->SetSSLCertReporterForTesting( | 114 cert_report_helper_->SetSSLCertReporterForTesting( |
| 116 std::move(ssl_cert_reporter)); | 115 std::move(ssl_cert_reporter)); |
| 117 } | 116 } |
| 118 | 117 |
| 119 // This handles the commands sent from the interstitial JavaScript. | 118 // This handles the commands sent from the interstitial JavaScript. |
| 120 void BadClockBlockingPage::CommandReceived(const std::string& command) { | 119 void BadClockBlockingPage::CommandReceived(const std::string& command) { |
| (...skipping 28 matching lines...) Expand all Loading... |
| 149 void BadClockBlockingPage::NotifyDenyCertificate() { | 148 void BadClockBlockingPage::NotifyDenyCertificate() { |
| 150 // It's possible that callback_ may not exist if the user clicks "Proceed" | 149 // It's possible that callback_ may not exist if the user clicks "Proceed" |
| 151 // followed by pressing the back button before the interstitial is hidden. | 150 // followed by pressing the back button before the interstitial is hidden. |
| 152 // In that case the certificate will still be treated as allowed. | 151 // In that case the certificate will still be treated as allowed. |
| 153 if (callback_.is_null()) | 152 if (callback_.is_null()) |
| 154 return; | 153 return; |
| 155 | 154 |
| 156 base::ResetAndReturn(&callback_) | 155 base::ResetAndReturn(&callback_) |
| 157 .Run(content::CERTIFICATE_REQUEST_RESULT_TYPE_CANCEL); | 156 .Run(content::CERTIFICATE_REQUEST_RESULT_TYPE_CANCEL); |
| 158 } | 157 } |
| OLD | NEW |