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

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: Make new functionality work transparently on IOS, which doesn't have gin bindings. 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 cd2de49ae9bfa1229d27952d61350155b08a88d5..4909ecc7f880e4d67498f7e40012c9b0b9343ab6 100644
--- a/chrome/common/localized_error.cc
+++ b/chrome/common/localized_error.cc
@@ -499,7 +499,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,
@@ -647,10 +647,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.
@@ -673,7 +673,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