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 557 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
568 load_time_data.SetString("trialCondition", trial_condition_); | 568 load_time_data.SetString("trialCondition", trial_condition_); |
569 | 569 |
570 // Shared values for both the overridable and non-overridable versions. | 570 // Shared values for both the overridable and non-overridable versions. |
571 load_time_data.SetBoolean("ssl", true); | 571 load_time_data.SetBoolean("ssl", true); |
572 load_time_data.SetBoolean( | 572 load_time_data.SetBoolean( |
573 "overridable", overridable_ && !strict_enforcement_); | 573 "overridable", overridable_ && !strict_enforcement_); |
574 load_time_data.SetString( | 574 load_time_data.SetString( |
575 "tabTitle", l10n_util::GetStringUTF16(IDS_SSL_V2_TITLE)); | 575 "tabTitle", l10n_util::GetStringUTF16(IDS_SSL_V2_TITLE)); |
576 load_time_data.SetString( | 576 load_time_data.SetString( |
577 "heading", l10n_util::GetStringUTF16(IDS_SSL_V2_HEADING)); | 577 "heading", l10n_util::GetStringUTF16(IDS_SSL_V2_HEADING)); |
578 if ((SSLErrorClassification::IsUserClockInThePast( | 578 |
579 base::Time::NowFromSystemTime())) | 579 base::Time now = base::Time::NowFromSystemTime(); |
580 if ((SSLErrorClassification::IsUserClockInThePast(now) || | |
581 SSLErrorClassification::IsUserClockInTheFuture(now)) | |
580 && (SSLErrorInfo::NetErrorToErrorType(cert_error_) == | 582 && (SSLErrorInfo::NetErrorToErrorType(cert_error_) == |
581 SSLErrorInfo::CERT_DATE_INVALID)) { | 583 SSLErrorInfo::CERT_DATE_INVALID)) { |
582 load_time_data.SetString("primaryParagraph", | 584 load_time_data.SetString("primaryParagraph", |
583 l10n_util::GetStringFUTF16( | 585 l10n_util::GetStringFUTF16( |
584 IDS_SSL_CLOCK_ERROR, | 586 IDS_SSL_CLOCK_ERROR, |
585 url, | 587 url, |
586 base::TimeFormatShortDate(base::Time::Now()))); | 588 base::TimeFormatShortDate(now))); |
589 if (overridable_ && !strict_enforcement_) { | |
590 load_time_data.SetString( | |
591 "finalParagraph", | |
592 l10n_util::GetStringFUTF16(IDS_SSL_OVERRIDABLE_PROCEED_PARAGRAPH, | |
593 url)); | |
594 load_time_data.SetString( | |
595 "primaryButtonText", | |
596 l10n_util::GetStringUTF16(IDS_SSL_NONOVERRIDABLE_RELOAD_BUTTON)); | |
felt
2014/07/26 01:12:36
should we use the IDS_SSL_OVERRIDABLE_SAFETY_BUTTO
| |
597 } else { | |
598 load_time_data.SetString( | |
599 "primaryButtonText", | |
600 l10n_util::GetStringUTF16(IDS_SSL_OVERRIDABLE_SAFETY_BUTTON)); | |
601 } | |
602 | |
603 base::StringPiece html( | |
604 ResourceBundle::GetSharedInstance().GetRawDataResource( | |
605 IRD_SSL_INTERSTITIAL_V2_HTML)); | |
606 webui::UseVersion2 version; | |
607 return webui::GetI18nTemplateHtml(html, &load_time_data); | |
felt
2014/07/26 01:12:36
this appears to return without setting a number of
felt
2014/07/26 01:13:06
oh wait, the primary paragraph is set... but it lo
palmer
2014/08/07 01:26:15
I changed it; see what you think now.
| |
587 } else { | 608 } else { |
588 load_time_data.SetString( | 609 load_time_data.SetString( |
589 "primaryParagraph", | 610 "primaryParagraph", |
590 l10n_util::GetStringFUTF16(IDS_SSL_V2_PRIMARY_PARAGRAPH, url)); | 611 l10n_util::GetStringFUTF16(IDS_SSL_V2_PRIMARY_PARAGRAPH, url)); |
591 } | 612 } |
592 load_time_data.SetString( | 613 load_time_data.SetString( |
593 "openDetails", | 614 "openDetails", |
594 l10n_util::GetStringUTF16(IDS_SSL_V2_OPEN_DETAILS_BUTTON)); | 615 l10n_util::GetStringUTF16(IDS_SSL_V2_OPEN_DETAILS_BUTTON)); |
595 load_time_data.SetString( | 616 load_time_data.SetString( |
596 "closeDetails", | 617 "closeDetails", |
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
811 // sure we don't clear the captive portal flag, since the interstitial was | 832 // sure we don't clear the captive portal flag, since the interstitial was |
812 // potentially caused by the captive portal. | 833 // potentially caused by the captive portal. |
813 captive_portal_detected_ = captive_portal_detected_ || | 834 captive_portal_detected_ = captive_portal_detected_ || |
814 (results->result == captive_portal::RESULT_BEHIND_CAPTIVE_PORTAL); | 835 (results->result == captive_portal::RESULT_BEHIND_CAPTIVE_PORTAL); |
815 // Also keep track of non-HTTP portals and error cases. | 836 // Also keep track of non-HTTP portals and error cases. |
816 captive_portal_no_response_ = captive_portal_no_response_ || | 837 captive_portal_no_response_ = captive_portal_no_response_ || |
817 (results->result == captive_portal::RESULT_NO_RESPONSE); | 838 (results->result == captive_portal::RESULT_NO_RESPONSE); |
818 } | 839 } |
819 #endif | 840 #endif |
820 } | 841 } |
OLD | NEW |