| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/ssl_error_handler.h" | 5 #include "chrome/browser/ssl/ssl_error_handler.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/callback_helpers.h" | 10 #include "base/callback_helpers.h" |
| (...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 330 #else | 330 #else |
| 331 NOTREACHED(); | 331 NOTREACHED(); |
| 332 #endif | 332 #endif |
| 333 } | 333 } |
| 334 | 334 |
| 335 void SSLErrorHandler::ShowSSLInterstitial() { | 335 void SSLErrorHandler::ShowSSLInterstitial() { |
| 336 // Show SSL blocking page. The interstitial owns the blocking page. | 336 // Show SSL blocking page. The interstitial owns the blocking page. |
| 337 RecordUMA(IsErrorOverridable() ? SHOW_SSL_INTERSTITIAL_OVERRIDABLE | 337 RecordUMA(IsErrorOverridable() ? SHOW_SSL_INTERSTITIAL_OVERRIDABLE |
| 338 : SHOW_SSL_INTERSTITIAL_NONOVERRIDABLE); | 338 : SHOW_SSL_INTERSTITIAL_NONOVERRIDABLE); |
| 339 | 339 |
| 340 (new SSLBlockingPage(web_contents_, cert_error_, ssl_info_, request_url_, | 340 (SSLBlockingPage::Create(web_contents_, cert_error_, ssl_info_, request_url_, |
| 341 options_mask_, base::Time::NowFromSystemTime(), | 341 options_mask_, base::Time::NowFromSystemTime(), |
| 342 std::move(ssl_cert_reporter_), callback_)) | 342 std::move(ssl_cert_reporter_), callback_)) |
| 343 ->Show(); | 343 ->Show(); |
| 344 // Once an interstitial is displayed, no need to keep the handler around. | 344 // Once an interstitial is displayed, no need to keep the handler around. |
| 345 // This is the equivalent of "delete this". | 345 // This is the equivalent of "delete this". |
| 346 web_contents_->RemoveUserData(UserDataKey()); | 346 web_contents_->RemoveUserData(UserDataKey()); |
| 347 } | 347 } |
| 348 | 348 |
| 349 void SSLErrorHandler::ShowBadClockInterstitial( | 349 void SSLErrorHandler::ShowBadClockInterstitial( |
| 350 const base::Time& now, | 350 const base::Time& now, |
| 351 ssl_errors::ClockState clock_state) { | 351 ssl_errors::ClockState clock_state) { |
| 352 RecordUMA(SHOW_BAD_CLOCK); | 352 RecordUMA(SHOW_BAD_CLOCK); |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 413 base::ResetAndReturn(&callback_) | 413 base::ResetAndReturn(&callback_) |
| 414 .Run(content::CERTIFICATE_REQUEST_RESULT_TYPE_DENY); | 414 .Run(content::CERTIFICATE_REQUEST_RESULT_TYPE_DENY); |
| 415 } | 415 } |
| 416 if (common_name_mismatch_handler_) { | 416 if (common_name_mismatch_handler_) { |
| 417 common_name_mismatch_handler_->Cancel(); | 417 common_name_mismatch_handler_->Cancel(); |
| 418 common_name_mismatch_handler_.reset(); | 418 common_name_mismatch_handler_.reset(); |
| 419 } | 419 } |
| 420 // Deletes |this| and also destroys the timer. | 420 // Deletes |this| and also destroys the timer. |
| 421 web_contents_->RemoveUserData(UserDataKey()); | 421 web_contents_->RemoveUserData(UserDataKey()); |
| 422 } | 422 } |
| OLD | NEW |