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

Unified Diff: chrome/common/localized_error.cc

Issue 1410343007: Add "SHOW ALL SAVED PAGES" button to offline error page (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Patch Created 5 years, 1 month 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 8a6455ab480f4b79360cbf61252641bd65cf316c..fad6b0dc67ed786bb20eaa86c5d883ae38d30a58 100644
--- a/chrome/common/localized_error.cc
+++ b/chrome/common/localized_error.cc
@@ -554,6 +554,7 @@ void LocalizedError::GetStrings(int error_code,
bool is_post,
bool stale_copy_in_cache,
bool can_show_network_diagnostics_dialog,
+ bool has_offline_pages,
const std::string& locale,
const std::string& accept_languages,
scoped_ptr<error_page::ErrorPageParams> params,
@@ -766,6 +767,19 @@ void LocalizedError::GetStrings(int error_code,
error_strings->Set("showSavedCopyButton", show_saved_copy_button);
}
+#if defined(OS_ANDROID)
+ if (has_offline_pages) {
mmenke 2015/11/05 16:18:12 One other question: Should we do this for all err
edwardjung 2015/11/05 17:08:01 My feeling is that this should be restricted to th
jianli 2015/11/06 00:04:40 Yes, we only want to offer "Show all saved pages"
+ base::DictionaryValue* show_saved_pages_button = new base::DictionaryValue;
+ show_saved_pages_button->SetString(
+ "msg", l10n_util::GetStringUTF16(
+ IDS_ERRORPAGES_BUTTON_SHOW_SAVED_PAGES));
+ show_saved_pages_button->SetString(
+ "title",
+ l10n_util::GetStringUTF16(IDS_ERRORPAGES_BUTTON_SHOW_SAVED_PAGES_HELP));
+ error_strings->Set("showSavedPagesButton", show_saved_pages_button);
+ }
+#endif
+
#if defined(OS_CHROMEOS)
// ChromeOS has its own diagnostics extension, which doesn't rely on a
// browser-initiated dialog.

Powered by Google App Engine
This is Rietveld 408576698