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

Unified Diff: chrome/common/localized_error.cc

Issue 545973003: Update network error template to new design (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Revert details link back to a button Created 6 years, 3 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
Index: chrome/common/localized_error.cc
diff --git a/chrome/common/localized_error.cc b/chrome/common/localized_error.cc
index 9419243208565bedc6bcd33bc4e97735d6e69a50..3a630c5835fe91fbfc4e19fdba843c30b199e4b7 100644
--- a/chrome/common/localized_error.cc
+++ b/chrome/common/localized_error.cc
@@ -510,6 +510,7 @@ void LocalizedError::GetStrings(int error_code,
base::DictionaryValue* error_strings) {
bool rtl = LocaleIsRTL();
error_strings->SetString("textdirection", rtl ? "rtl" : "ltr");
+ webui::SetFontAndTextDirection(error_strings);
// Grab the strings and settings that depend on the error type. Init
// options with default values.
@@ -556,8 +557,16 @@ void LocalizedError::GetStrings(int error_code,
error_strings->SetString("iconClass", icon_class);
base::DictionaryValue* summary = new base::DictionaryValue;
- summary->SetString("msg",
- l10n_util::GetStringUTF16(options.summary_resource_id));
+
+ // For offline show a summary message underneath the heading.
+ if (error_code == net::ERR_INTERNET_DISCONNECTED) {
+ error_strings->SetString("primaryParagraph",
+ l10n_util::GetStringUTF16(options.summary_resource_id));
+ } else {
+ // Set summary message in the details.
+ summary->SetString("msg",
+ l10n_util::GetStringUTF16(options.summary_resource_id));
+ }
summary->SetString("failedUrl", failed_url_string);
summary->SetString("hostName", net::IDNToUnicode(failed_url.host(),
accept_languages));
@@ -611,12 +620,10 @@ void LocalizedError::GetStrings(int error_code,
IDS_ERRORPAGES_SUMMARY_INTERNET_DISCONNECTED_PLATFORM_VISTA;
}
#endif // defined(OS_WIN)
- // Lead with the general error description, and suffix with the platform
- // dependent portion of the summary section.
+ // Platform dependent portion of the summary section.
summary->SetString("msg",
l10n_util::GetStringFUTF16(
IDS_ERRORPAGES_SUMMARY_INTERNET_DISCONNECTED_INSTRUCTIONS_TEMPLATE,
- l10n_util::GetStringUTF16(options.summary_resource_id),
l10n_util::GetStringUTF16(platform_string_id)));
}
#endif // defined(OS_MACOSX) || defined(OS_WIN)
« no previous file with comments | « chrome/app/google_chrome_strings.grd ('k') | chrome/renderer/resources/default_100_percent/common/error_network_generic.png » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698