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

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: Incorporated comments. 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..eb7e330fe4b044d0b305bd99234f4792b6e53a76 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 stale_load_button,
mmenke 2014/04/11 19:42:32 nit: Maybe show_stale_load_button?
Randy Smith (Not in Mondays) 2014/04/14 22:02:13 Done.
const std::string& locale,
const std::string& accept_languages,
scoped_ptr<ErrorPageParams> params,
@@ -650,7 +650,7 @@ void LocalizedError::GetStrings(int error_code,
reload_button->SetString("msg",
l10n_util::GetStringUTF16(IDS_ERRORPAGES_BUTTON_RELOAD));
reload_button->SetString("reloadUrl", failed_url.spec());
mmenke 2014/04/11 19:42:32 This string is no longer used.
Randy Smith (Not in Mondays) 2014/04/14 22:02:13 Right. Got rid of the subdirectory and just assig
- 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 (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