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

Unified Diff: chrome/browser/ssl/ssl_blocking_page.cc

Issue 437113002: Delete the old SSL interstitial and Finch trial (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Removing IDS_FLAGS_SSL_INTERSTITIAL strings Created 6 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ssl/ssl_blocking_page.h ('k') | chrome/common/chrome_switches.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ssl/ssl_blocking_page.cc
diff --git a/chrome/browser/ssl/ssl_blocking_page.cc b/chrome/browser/ssl/ssl_blocking_page.cc
index 458a166768046d226b04431f58575424208c414c..faafc8a037ad68272a97ab5b7eb206b576af9a29 100644
--- a/chrome/browser/ssl/ssl_blocking_page.cc
+++ b/chrome/browser/ssl/ssl_blocking_page.cc
@@ -72,41 +72,6 @@ using content::NavigationEntry;
namespace {
-// Constants for the M37 Finch trial.
-const char kInterstitialTrialName[] = "SSLInterstitialVersion";
-const char kCondV1[] = "V1";
-const char kCondV1LayoutV2Text[] = "V1LayoutV2Text";
-const char kCondV2[] = "V2"; // Also the default.
-const char kCondV2Guard[] = "V2WithGuard";
-const char kCondV2Yellow[] = "V2Yellow";
-
-const char* GetTrialCondition() {
- CommandLine* cli = CommandLine::ForCurrentProcess();
- if (cli->HasSwitch(switches::kSSLInterstitialV1))
- return kCondV1;
- if (cli->HasSwitch(switches::kSSLInterstitialV2))
- return kCondV2;
- if (cli->HasSwitch(switches::kSSLInterstitialV1WithV2Text))
- return kCondV1LayoutV2Text;
- if (cli->HasSwitch(switches::kSSLInterstitialV2Guard))
- return kCondV2Guard;
- if (cli->HasSwitch(switches::kSSLInterstitialV2Yellow))
- return kCondV2Yellow;
-
- std::string name(base::FieldTrialList::FindFullName(kInterstitialTrialName));
- if (name == kCondV1)
- return kCondV1;
- if (name == kCondV2)
- return kCondV2;
- if (name == kCondV1LayoutV2Text)
- return kCondV1LayoutV2Text;
- if (name == kCondV2Guard)
- return kCondV2Guard;
- if (name == kCondV2Yellow)
- return kCondV2Yellow;
- return kCondV2;
-}
-
// Events for UMA. Do not reorder or change!
enum SSLBlockingPageEvent {
SHOW_ALL,
@@ -324,8 +289,7 @@ SSLBlockingPage::SSLBlockingPage(
captive_portal_detection_enabled_(false),
captive_portal_probe_completed_(false),
captive_portal_no_response_(false),
- captive_portal_detected_(false),
- trial_condition_(GetTrialCondition()) {
+ captive_portal_detected_(false) {
Profile* profile = Profile::FromBrowserContext(
web_contents->GetBrowserContext());
// For UMA stats.
@@ -385,187 +349,11 @@ SSLBlockingPage::~SSLBlockingPage() {
}
std::string SSLBlockingPage::GetHTMLContents() {
- if (trial_condition_ == kCondV1 || trial_condition_ == kCondV1LayoutV2Text)
- return GetHTMLContentsV1();
- return GetHTMLContentsV2();
-}
-
-std::string SSLBlockingPage::GetHTMLContentsV1() {
- base::DictionaryValue strings;
- int resource_id;
- if (overridable_ && !strict_enforcement_) {
- // Let's build the overridable error page.
- SSLErrorInfo error_info =
- SSLErrorInfo::CreateError(
- SSLErrorInfo::NetErrorToErrorType(cert_error_),
- ssl_info_.cert.get(),
- request_url_);
- resource_id = IDR_SSL_ROAD_BLOCK_HTML;
- strings.SetString("textdirection", base::i18n::IsRTL() ? "rtl" : "ltr");
- strings.SetString("errorType", "overridable");
- if (trial_condition_ == kCondV1LayoutV2Text) {
- base::string16 url(ASCIIToUTF16(request_url_.host()));
- strings.SetString(
- "headLine", l10n_util::GetStringUTF16(IDS_SSL_V2_HEADING));
- strings.SetString(
- "description",
- l10n_util::GetStringFUTF16(IDS_SSL_V2_PRIMARY_PARAGRAPH, url));
- strings.SetString(
- "moreInfoTitle",
- l10n_util::GetStringUTF16(IDS_SSL_V2_OPEN_DETAILS_BUTTON));
- strings.SetString("moreInfo1", error_info.details());
- strings.SetString("moreInfo2", base::string16());
- strings.SetString("moreInfo3", base::string16());
- strings.SetString("moreInfo4", base::string16());
- strings.SetString("moreInfo5", base::string16());
- strings.SetString(
- "exit",
- l10n_util::GetStringUTF16(IDS_SSL_OVERRIDABLE_SAFETY_BUTTON));
- strings.SetString(
- "title", l10n_util::GetStringUTF16(IDS_SSL_V2_TITLE));
- strings.SetString(
- "proceed",
- l10n_util::GetStringUTF16(IDS_SSL_OVERRIDABLE_PROCEED_LINK_TEXT));
- strings.SetString("reasonForNotProceeding", base::string16());
- } else {
- strings.SetString("headLine", error_info.title());
- strings.SetString("description", error_info.details());
- strings.SetString("moreInfoTitle",
- l10n_util::GetStringUTF16(IDS_CERT_ERROR_EXTRA_INFO_TITLE));
- SetExtraInfo(&strings, error_info.extra_information());
-
- strings.SetString(
- "exit", l10n_util::GetStringUTF16(IDS_SSL_OVERRIDABLE_PAGE_EXIT));
- strings.SetString(
- "title", l10n_util::GetStringUTF16(IDS_SSL_OVERRIDABLE_PAGE_TITLE));
- strings.SetString(
- "proceed",
- l10n_util::GetStringUTF16(IDS_SSL_OVERRIDABLE_PAGE_PROCEED));
- strings.SetString("reasonForNotProceeding",
- l10n_util::GetStringUTF16(
- IDS_SSL_OVERRIDABLE_PAGE_SHOULD_NOT_PROCEED));
- }
- } else {
- // Let's build the blocking error page.
- resource_id = IDR_SSL_BLOCKING_HTML;
-
- // Strings that are not dependent on the URL.
- strings.SetString(
- "title", l10n_util::GetStringUTF16(IDS_SSL_BLOCKING_PAGE_TITLE));
- strings.SetString(
- "reloadMsg", l10n_util::GetStringUTF16(IDS_ERRORPAGES_BUTTON_RELOAD));
- strings.SetString(
- "more", l10n_util::GetStringUTF16(IDS_ERRORPAGES_BUTTON_MORE));
- strings.SetString(
- "less", l10n_util::GetStringUTF16(IDS_ERRORPAGES_BUTTON_LESS));
- strings.SetString(
- "moreTitle",
- l10n_util::GetStringUTF16(IDS_SSL_BLOCKING_PAGE_MORE_TITLE));
- strings.SetString(
- "techTitle",
- l10n_util::GetStringUTF16(IDS_SSL_BLOCKING_PAGE_TECH_TITLE));
-
- // Strings that are dependent on the URL.
- base::string16 url(ASCIIToUTF16(request_url_.host()));
- bool rtl = base::i18n::IsRTL();
- strings.SetString("textDirection", rtl ? "rtl" : "ltr");
- if (rtl)
- base::i18n::WrapStringWithLTRFormatting(&url);
- strings.SetString(
- "headline", l10n_util::GetStringFUTF16(IDS_SSL_BLOCKING_PAGE_HEADLINE,
- url.c_str()));
- strings.SetString(
- "message", l10n_util::GetStringFUTF16(IDS_SSL_BLOCKING_PAGE_BODY_TEXT,
- url.c_str()));
- strings.SetString(
- "moreMessage",
- l10n_util::GetStringFUTF16(IDS_SSL_BLOCKING_PAGE_MORE_TEXT,
- url.c_str()));
- strings.SetString("reloadUrl", request_url_.spec());
-
- // Strings that are dependent on the error type.
- SSLErrorInfo::ErrorType type =
- SSLErrorInfo::NetErrorToErrorType(cert_error_);
- base::string16 errorType;
- if (type == SSLErrorInfo::CERT_REVOKED) {
- errorType = base::string16(ASCIIToUTF16("Key revocation"));
- strings.SetString(
- "failure",
- l10n_util::GetStringUTF16(IDS_SSL_BLOCKING_PAGE_REVOKED));
- } else if (type == SSLErrorInfo::CERT_INVALID) {
- errorType = base::string16(ASCIIToUTF16("Malformed certificate"));
- strings.SetString(
- "failure",
- l10n_util::GetStringUTF16(IDS_SSL_BLOCKING_PAGE_FORMATTED));
- } else if (type == SSLErrorInfo::CERT_PINNED_KEY_MISSING) {
- errorType = base::string16(ASCIIToUTF16("Certificate pinning failure"));
- strings.SetString(
- "failure",
- l10n_util::GetStringFUTF16(IDS_SSL_BLOCKING_PAGE_PINNING,
- url.c_str()));
- } else if (type == SSLErrorInfo::CERT_WEAK_KEY_DH) {
- errorType = base::string16(ASCIIToUTF16("Weak DH public key"));
- strings.SetString(
- "failure",
- l10n_util::GetStringFUTF16(IDS_SSL_BLOCKING_PAGE_WEAK_DH,
- url.c_str()));
- } else {
- // HSTS failure.
- errorType = base::string16(ASCIIToUTF16("HSTS failure"));
- strings.SetString(
- "failure",
- l10n_util::GetStringFUTF16(IDS_SSL_BLOCKING_PAGE_HSTS, url.c_str()));
- }
- if (rtl)
- base::i18n::WrapStringWithLTRFormatting(&errorType);
- strings.SetString(
- "errorType", l10n_util::GetStringFUTF16(IDS_SSL_BLOCKING_PAGE_ERROR,
- errorType.c_str()));
-
- // Strings that display the invalid cert.
- base::string16 subject(
- ASCIIToUTF16(ssl_info_.cert->subject().GetDisplayName()));
- base::string16 issuer(
- ASCIIToUTF16(ssl_info_.cert->issuer().GetDisplayName()));
- std::string hashes;
- for (std::vector<net::HashValue>::const_iterator it =
- ssl_info_.public_key_hashes.begin();
- it != ssl_info_.public_key_hashes.end();
- ++it) {
- base::StringAppendF(&hashes, "%s ", it->ToString().c_str());
- }
- base::string16 fingerprint(ASCIIToUTF16(hashes));
- if (rtl) {
- // These are always going to be LTR.
- base::i18n::WrapStringWithLTRFormatting(&subject);
- base::i18n::WrapStringWithLTRFormatting(&issuer);
- base::i18n::WrapStringWithLTRFormatting(&fingerprint);
- }
- strings.SetString(
- "subject", l10n_util::GetStringFUTF16(IDS_SSL_BLOCKING_PAGE_SUBJECT,
- subject.c_str()));
- strings.SetString(
- "issuer", l10n_util::GetStringFUTF16(IDS_SSL_BLOCKING_PAGE_ISSUER,
- issuer.c_str()));
- strings.SetString(
- "fingerprint",
- l10n_util::GetStringFUTF16(IDS_SSL_BLOCKING_PAGE_HASHES,
- fingerprint.c_str()));
- }
-
- base::StringPiece html(
- ResourceBundle::GetSharedInstance().GetRawDataResource(
- resource_id));
- return webui::GetI18nTemplateHtml(html, &strings);
-}
-
-std::string SSLBlockingPage::GetHTMLContentsV2() {
base::DictionaryValue load_time_data;
base::string16 url(ASCIIToUTF16(request_url_.host()));
if (base::i18n::IsRTL())
base::i18n::WrapStringWithLTRFormatting(&url);
webui::SetFontAndTextDirection(&load_time_data);
- load_time_data.SetString("trialCondition", trial_condition_);
// Shared values for both the overridable and non-overridable versions.
load_time_data.SetBoolean("ssl", true);
« no previous file with comments | « chrome/browser/ssl/ssl_blocking_page.h ('k') | chrome/common/chrome_switches.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698