Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(136)

Side by Side Diff: chrome/browser/ssl/ssl_blocking_page.cc

Issue 319303003: Polish the new SSL interstitial (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Changes for review Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
Dan Beam 2014/06/07 03:03:15 can't you just do: loadTimeData.SetDouble("font
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(
436 "primaryParagraph", 434 "primaryParagraph",
437 l10n_util::GetStringFUTF16(IDS_SSL_V2_PRIMARY_PARAGRAPH, url)); 435 l10n_util::GetStringFUTF16(IDS_SSL_V2_PRIMARY_PARAGRAPH, url));
438 loadTimeData.SetString( 436 loadTimeData.SetString(
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698