| 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 #include "chrome/browser/ssl/ssl_blocking_page.h" | 5 #include "chrome/browser/ssl/ssl_blocking_page.h" |
| 6 | 6 |
| 7 #include "base/build_time.h" | 7 #include "base/build_time.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/i18n/rtl.h" | 9 #include "base/i18n/rtl.h" |
| 10 #include "base/i18n/time_formatting.h" | 10 #include "base/i18n/time_formatting.h" |
| (...skipping 493 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 504 load_time_data.SetString( | 504 load_time_data.SetString( |
| 505 "primaryParagraph", | 505 "primaryParagraph", |
| 506 l10n_util::GetStringFUTF16(IDS_SSL_V2_PRIMARY_PARAGRAPH, url)); | 506 l10n_util::GetStringFUTF16(IDS_SSL_V2_PRIMARY_PARAGRAPH, url)); |
| 507 } | 507 } |
| 508 load_time_data.SetString( | 508 load_time_data.SetString( |
| 509 "openDetails", | 509 "openDetails", |
| 510 l10n_util::GetStringUTF16(IDS_SSL_V2_OPEN_DETAILS_BUTTON)); | 510 l10n_util::GetStringUTF16(IDS_SSL_V2_OPEN_DETAILS_BUTTON)); |
| 511 load_time_data.SetString( | 511 load_time_data.SetString( |
| 512 "closeDetails", | 512 "closeDetails", |
| 513 l10n_util::GetStringUTF16(IDS_SSL_V2_CLOSE_DETAILS_BUTTON)); | 513 l10n_util::GetStringUTF16(IDS_SSL_V2_CLOSE_DETAILS_BUTTON)); |
| 514 load_time_data.SetString("errorCode", net::ErrorToString(cert_error_)); |
| 514 | 515 |
| 515 if (overridable_ && !strict_enforcement_) { // Overridable. | 516 if (overridable_ && !strict_enforcement_) { // Overridable. |
| 516 SSLErrorInfo error_info = | 517 SSLErrorInfo error_info = |
| 517 SSLErrorInfo::CreateError( | 518 SSLErrorInfo::CreateError( |
| 518 SSLErrorInfo::NetErrorToErrorType(cert_error_), | 519 SSLErrorInfo::NetErrorToErrorType(cert_error_), |
| 519 ssl_info_.cert.get(), | 520 ssl_info_.cert.get(), |
| 520 request_url_); | 521 request_url_); |
| 521 load_time_data.SetString( | 522 load_time_data.SetString( |
| 522 "explanationParagraph", error_info.details()); | 523 "explanationParagraph", error_info.details()); |
| 523 load_time_data.SetString( | 524 load_time_data.SetString( |
| (...skipping 26 matching lines...) Expand all Loading... |
| 550 break; | 551 break; |
| 551 case SSLErrorInfo::CERT_INVALID: | 552 case SSLErrorInfo::CERT_INVALID: |
| 552 help_string = IDS_SSL_NONOVERRIDABLE_INVALID; | 553 help_string = IDS_SSL_NONOVERRIDABLE_INVALID; |
| 553 break; | 554 break; |
| 554 default: | 555 default: |
| 555 if (strict_enforcement_) | 556 if (strict_enforcement_) |
| 556 help_string = IDS_SSL_NONOVERRIDABLE_HSTS; | 557 help_string = IDS_SSL_NONOVERRIDABLE_HSTS; |
| 557 } | 558 } |
| 558 load_time_data.SetString( | 559 load_time_data.SetString( |
| 559 "finalParagraph", l10n_util::GetStringFUTF16(help_string, url)); | 560 "finalParagraph", l10n_util::GetStringFUTF16(help_string, url)); |
| 560 load_time_data.SetString("errorCode", net::ErrorToString(cert_error_)); | |
| 561 } | 561 } |
| 562 | 562 |
| 563 base::StringPiece html( | 563 base::StringPiece html( |
| 564 ResourceBundle::GetSharedInstance().GetRawDataResource( | 564 ResourceBundle::GetSharedInstance().GetRawDataResource( |
| 565 IRD_SSL_INTERSTITIAL_V2_HTML)); | 565 IRD_SSL_INTERSTITIAL_V2_HTML)); |
| 566 webui::UseVersion2 version; | 566 webui::UseVersion2 version; |
| 567 return webui::GetI18nTemplateHtml(html, &load_time_data); | 567 return webui::GetI18nTemplateHtml(html, &load_time_data); |
| 568 } | 568 } |
| 569 | 569 |
| 570 void SSLBlockingPage::OverrideEntry(NavigationEntry* entry) { | 570 void SSLBlockingPage::OverrideEntry(NavigationEntry* entry) { |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 721 // sure we don't clear the captive portal flag, since the interstitial was | 721 // sure we don't clear the captive portal flag, since the interstitial was |
| 722 // potentially caused by the captive portal. | 722 // potentially caused by the captive portal. |
| 723 captive_portal_detected_ = captive_portal_detected_ || | 723 captive_portal_detected_ = captive_portal_detected_ || |
| 724 (results->result == captive_portal::RESULT_BEHIND_CAPTIVE_PORTAL); | 724 (results->result == captive_portal::RESULT_BEHIND_CAPTIVE_PORTAL); |
| 725 // Also keep track of non-HTTP portals and error cases. | 725 // Also keep track of non-HTTP portals and error cases. |
| 726 captive_portal_no_response_ = captive_portal_no_response_ || | 726 captive_portal_no_response_ = captive_portal_no_response_ || |
| 727 (results->result == captive_portal::RESULT_NO_RESPONSE); | 727 (results->result == captive_portal::RESULT_NO_RESPONSE); |
| 728 } | 728 } |
| 729 #endif | 729 #endif |
| 730 } | 730 } |
| OLD | NEW |