summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfqj <fqj@chromium.org>2015-10-12 10:16:49 -0700
committerCommit bot <commit-bot@chromium.org>2015-10-12 17:18:19 +0000
commitc6f80d9f2a876e36f611860acd369d84fed1ffb0 (patch)
treeee1f55168eca22bcb3cce8fc5ede4bdc2916f051
parentca9c30281ab1d6136949ef5278866a84e83c091d (diff)
downloadchromium_src-c6f80d9f2a876e36f611860acd369d84fed1ffb0.zip
chromium_src-c6f80d9f2a876e36f611860acd369d84fed1ffb0.tar.gz
chromium_src-c6f80d9f2a876e36f611860acd369d84fed1ffb0.tar.bz2
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}
-rw-r--r--chrome/common/localized_error.cc20
1 files 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 ==