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

Unified Diff: chrome/common/localized_error.cc

Issue 207553008: Surface button for loading stale cache copy on net error page. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix incorrect spelling of iOS. Created 6 years, 8 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 dc5e844c9a61d263efeedd0ba99022abf818ecd1..4164d1e5fd196345df6cd2d78a3d4dd1f11bbb57 100644
--- a/chrome/common/localized_error.cc
+++ b/chrome/common/localized_error.cc
@@ -493,7 +493,7 @@ void LocalizedError::GetStrings(int error_code,
const std::string& error_domain,
const GURL& failed_url,
bool is_post,
- bool stale_copy_in_cache,
+ bool show_stale_load_button,
const std::string& locale,
const std::string& accept_languages,
scoped_ptr<ErrorPageParams> params,
@@ -641,10 +641,10 @@ void LocalizedError::GetStrings(int error_code,
if (params->suggest_reload) {
if (!is_post) {
base::DictionaryValue* reload_button = new base::DictionaryValue;
- reload_button->SetString("msg",
- l10n_util::GetStringUTF16(IDS_ERRORPAGES_BUTTON_RELOAD));
+ reload_button->SetString(
+ "msg", l10n_util::GetStringUTF16(IDS_ERRORPAGES_BUTTON_RELOAD));
reload_button->SetString("reloadUrl", failed_url.spec());
- error_strings->Set("reload", reload_button);
+ error_strings->Set("reloadButton", reload_button);
} else {
// If the page was created by a post, it can't be reloaded in the same
// way, so just add a suggestion instead.
@@ -667,7 +667,15 @@ void LocalizedError::GetStrings(int error_code,
if (!use_default_suggestions)
return;
- error_strings->SetBoolean("staleCopyInCache", stale_copy_in_cache);
+ if (show_stale_load_button) {
+ base::DictionaryValue* stale_load_button = new base::DictionaryValue;
+ stale_load_button->SetString(
+ "msg", l10n_util::GetStringUTF16(IDS_ERRORPAGES_BUTTON_LOAD_STALE));
+ stale_load_button->SetString(
+ "title",
+ l10n_util::GetStringUTF16(IDS_ERRORPAGES_BUTTON_LOAD_STALE_HELP));
+ error_strings->Set("staleLoadButton", stale_load_button);
+ }
#if defined(OS_CHROMEOS)
error_strings->SetString(

Powered by Google App Engine
This is Rietveld 408576698