From c6f80d9f2a876e36f611860acd369d84fed1ffb0 Mon Sep 17 00:00:00 2001 From: fqj Date: Mon, 12 Oct 2015 10:16:49 -0700 Subject: Fix the issue that dinosaur is not disabled on DNS_PROBE_FINISHED_NO_INTERNET Dinosaur Easter Egg is not disabled if device is offline for DNS_PROBE_FINISHED_NO_INTERNET, rather than ERR_INTERNET_DISCONNECTED. On DNS_PROBE_FINISHED_NO_INTERNET, an error page for DNS_PROBE_POSSIBLE is generated. And DNS_PROBE_FINISHED_NO_INTERNET error page is updated later by updateForDNSProbe which only updates the HTML but not the loadTimeData. This commit adds disabledEasterEgg in loadTimeData for all error pages. BUG=541588 Review URL: https://codereview.chromium.org/1393083004 Cr-Commit-Position: refs/heads/master@{#353541} --- chrome/common/localized_error.cc | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/chrome/common/localized_error.cc b/chrome/common/localized_error.cc index 6fde4f5..24628b0 100644 --- a/chrome/common/localized_error.cc +++ b/chrome/common/localized_error.cc @@ -584,20 +584,21 @@ void LocalizedError::GetStrings(int error_code, error_code == error_page::DNS_PROBE_FINISHED_NO_INTERNET) { error_strings->SetString("primaryParagraph", l10n_util::GetStringUTF16(options.summary_resource_id)); - - base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); - - // Check if easter egg should be disabled. - if (command_line->HasSwitch(switches::kDisableDinosaurEasterEgg)) { - // The prescence of this string disables the easter egg. Acts as a flag. - error_strings->SetString("disabledEasterEgg", - l10n_util::GetStringUTF16(IDS_ERRORPAGE_FUN_DISABLED)); - } } else { // Set summary message in the details. summary->SetString("msg", l10n_util::GetStringUTF16(options.summary_resource_id)); } + + base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); + + // Check if easter egg should be disabled. + if (command_line->HasSwitch(switches::kDisableDinosaurEasterEgg)) { + // The presence of this string disables the easter egg. Acts as a flag. + error_strings->SetString("disabledEasterEgg", + l10n_util::GetStringUTF16(IDS_ERRORPAGE_FUN_DISABLED)); + } + summary->SetString("failedUrl", failed_url_string); summary->SetString("hostName", url_formatter::IDNToUnicode(failed_url.host(), accept_languages)); @@ -715,7 +716,6 @@ void LocalizedError::GetStrings(int error_code, if (!use_default_suggestions) return; - base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); const std::string& show_saved_copy_value = command_line->GetSwitchValueASCII(switches::kShowSavedCopy); bool show_saved_copy_primary = (show_saved_copy_value == -- cgit v1.1