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

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: Fix after rebase 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
« no previous file with comments | « chrome/common/localized_error.h ('k') | chrome/common/render_messages.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/localized_error.cc
diff --git a/chrome/common/localized_error.cc b/chrome/common/localized_error.cc
index 8a6455ab480f4b79360cbf61252641bd65cf316c..30fed8b1ea6b310ef9395da6a1ad01f23bb58fc9 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) {
+ 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));
+ 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.
« no previous file with comments | « chrome/common/localized_error.h ('k') | chrome/common/render_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698