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

Unified Diff: components/error_page/common/localized_error.cc

Issue 1750113002: Remove "Show saved copy" button from error page (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address feedback Created 4 years, 10 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
« no previous file with comments | « components/error_page/common/localized_error.h ('k') | components/error_page/common/net_error_info.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/error_page/common/localized_error.cc
diff --git a/components/error_page/common/localized_error.cc b/components/error_page/common/localized_error.cc
index ead0a354aeeb9128d4eee2089fc069ac8a1f8447..80dad579b1951d5b89e220d3d0aeed773378a2f1 100644
--- a/components/error_page/common/localized_error.cc
+++ b/components/error_page/common/localized_error.cc
@@ -839,7 +839,7 @@ void LocalizedError::GetStrings(int error_code,
bool is_post,
bool stale_copy_in_cache,
bool can_show_network_diagnostics_dialog,
- OfflinePageStatus offline_page_status,
+ bool has_offline_pages,
const std::string& locale,
const std::string& accept_languages,
scoped_ptr<error_page::ErrorPageParams> params,
@@ -1057,26 +1057,16 @@ void LocalizedError::GetStrings(int error_code,
#if defined(OS_ANDROID)
// Offline button will not be provided when we want to show something in the
// cache.
- if (!show_saved_copy_visible) {
- if (offline_page_status == OfflinePageStatus::HAS_OFFLINE_PAGE) {
- 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);
- error_strings->Set("showOfflineCopyButton", show_offline_copy_button);
- } else if (offline_page_status ==
- OfflinePageStatus::HAS_OTHER_OFFLINE_PAGES) {
- base::DictionaryValue* show_offline_pages_button =
- new base::DictionaryValue;
- base::string16 button_text = l10n_util::GetStringUTF16(
- offline_pages::GetOfflinePageFeatureMode() ==
- offline_pages::FeatureMode::ENABLED_AS_BOOKMARKS
- ? IDS_ERRORPAGES_BUTTON_SHOW_OFFLINE_PAGES_AS_BOOKMARKS
- : IDS_ERRORPAGES_BUTTON_SHOW_OFFLINE_PAGES);
- show_offline_pages_button->SetString("msg", button_text);
- error_strings->Set("showOfflinePagesButton", show_offline_pages_button);
- }
+ if (!show_saved_copy_visible && has_offline_pages) {
+ base::DictionaryValue* show_offline_pages_button =
+ new base::DictionaryValue;
+ base::string16 button_text = l10n_util::GetStringUTF16(
+ offline_pages::GetOfflinePageFeatureMode() ==
+ offline_pages::FeatureMode::ENABLED_AS_BOOKMARKS
+ ? IDS_ERRORPAGES_BUTTON_SHOW_OFFLINE_PAGES_AS_BOOKMARKS
+ : IDS_ERRORPAGES_BUTTON_SHOW_OFFLINE_PAGES);
+ show_offline_pages_button->SetString("msg", button_text);
+ error_strings->Set("showOfflinePagesButton", show_offline_pages_button);
}
#endif // defined(OS_ANDROID)
« no previous file with comments | « components/error_page/common/localized_error.h ('k') | components/error_page/common/net_error_info.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698