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

Unified Diff: chrome/common/localized_error.cc

Issue 1442433003: Add "Show saved copy" button in dino page when there's offline copy (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
« 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 30fed8b1ea6b310ef9395da6a1ad01f23bb58fc9..7017787bfc0d4acbac53395a6d8b8d183554b607 100644
--- a/chrome/common/localized_error.cc
+++ b/chrome/common/localized_error.cc
@@ -554,7 +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,
+ OfflinePageStatus offline_page_status,
const std::string& locale,
const std::string& accept_languages,
scoped_ptr<error_page::ErrorPageParams> params,
@@ -768,15 +768,21 @@ void LocalizedError::GetStrings(int error_code,
}
#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);
+ if (offline_page_status == OfflinePageStatus::HAS_PAGE_COPY) {
+ base::DictionaryValue* show_offline_copy_button = new base::DictionaryValue;
+ base::string16 button_text =
+ l10n_util::GetStringUTF16(IDS_ERRORPAGES_BUTTON_SHOW_OFFLINE_COPY);
+ show_offline_copy_button->SetString("msg", button_text);
+ show_offline_copy_button->SetString("title", button_text);
+ error_strings->Set("showOfflineCopyButton", show_offline_copy_button);
mmenke 2015/11/12 19:55:18 What's the difference between an offline copy and
jianli 2015/11/12 21:16:16 If offline pages feature is on, we're going to sho
+ } else if (offline_page_status == OfflinePageStatus::HAS_OTHER_COPIES) {
+ base::DictionaryValue* show_offline_pages_button =
+ new base::DictionaryValue;
+ base::string16 button_text =
+ l10n_util::GetStringUTF16(IDS_ERRORPAGES_BUTTON_SHOW_OFFLINE_PAGES);
+ show_offline_pages_button->SetString("msg", button_text);
+ show_offline_pages_button->SetString("title", button_text);
+ error_strings->Set("showOfflinePagesButton", show_offline_pages_button);
}
#endif
« 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