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/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/i18n/rtl.h" | 8 #include "base/i18n/rtl.h" |
9 #include "base/metrics/field_trial.h" | 9 #include "base/metrics/field_trial.h" |
10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
(...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
413 | 413 |
414 base::StringPiece html( | 414 base::StringPiece html( |
415 ResourceBundle::GetSharedInstance().GetRawDataResource( | 415 ResourceBundle::GetSharedInstance().GetRawDataResource( |
416 resource_id)); | 416 resource_id)); |
417 return webui::GetI18nTemplateHtml(html, &strings); | 417 return webui::GetI18nTemplateHtml(html, &strings); |
418 } | 418 } |
419 | 419 |
420 std::string SSLBlockingPage::GetHTMLContentsV2() { | 420 std::string SSLBlockingPage::GetHTMLContentsV2() { |
421 base::DictionaryValue loadTimeData; | 421 base::DictionaryValue loadTimeData; |
422 base::string16 url(ASCIIToUTF16(request_url_.host())); | 422 base::string16 url(ASCIIToUTF16(request_url_.host())); |
423 bool rtl = base::i18n::IsRTL(); | 423 if (base::i18n::IsRTL()) |
424 loadTimeData.SetString("textDirection", rtl ? "rtl" : "ltr"); | |
425 if (rtl) | |
426 base::i18n::WrapStringWithLTRFormatting(&url); | 424 base::i18n::WrapStringWithLTRFormatting(&url); |
427 webui::SetFontAndTextDirection(&loadTimeData); | 425 webui::SetFontAndTextDirection(&loadTimeData); |
428 | 426 |
429 // Shared values for both the overridable and non-overridable versions. | 427 // Shared values for both the overridable and non-overridable versions. |
430 loadTimeData.SetBoolean("overridable", overridable_ && !strict_enforcement_); | 428 loadTimeData.SetBoolean("overridable", overridable_ && !strict_enforcement_); |
431 loadTimeData.SetString( | 429 loadTimeData.SetString( |
432 "tabTitle", l10n_util::GetStringUTF16(IDS_SSL_V2_TITLE)); | 430 "tabTitle", l10n_util::GetStringUTF16(IDS_SSL_V2_TITLE)); |
433 loadTimeData.SetString( | 431 loadTimeData.SetString( |
434 "heading", l10n_util::GetStringUTF16(IDS_SSL_V2_HEADING)); | 432 "heading", l10n_util::GetStringUTF16(IDS_SSL_V2_HEADING)); |
435 loadTimeData.SetString( | 433 loadTimeData.SetString( |
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
652 // sure we don't clear the captive portal flag, since the interstitial was | 650 // sure we don't clear the captive portal flag, since the interstitial was |
653 // potentially caused by the captive portal. | 651 // potentially caused by the captive portal. |
654 captive_portal_detected_ = captive_portal_detected_ || | 652 captive_portal_detected_ = captive_portal_detected_ || |
655 (results->result == captive_portal::RESULT_BEHIND_CAPTIVE_PORTAL); | 653 (results->result == captive_portal::RESULT_BEHIND_CAPTIVE_PORTAL); |
656 // Also keep track of non-HTTP portals and error cases. | 654 // Also keep track of non-HTTP portals and error cases. |
657 captive_portal_no_response_ = captive_portal_no_response_ || | 655 captive_portal_no_response_ = captive_portal_no_response_ || |
658 (results->result == captive_portal::RESULT_NO_RESPONSE); | 656 (results->result == captive_portal::RESULT_NO_RESPONSE); |
659 } | 657 } |
660 #endif | 658 #endif |
661 } | 659 } |
OLD | NEW |