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

Side by Side Diff: components/error_page/common/localized_error.cc

Issue 2618503003: Do not show DOWNLOAD PAGE LATER button for post error page (Closed)
Patch Set: Created 3 years, 11 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "components/error_page/common/localized_error.h" 5 #include "components/error_page/common/localized_error.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <utility> 9 #include <utility>
10 10
(...skipping 1019 matching lines...) Expand 10 before | Expand all | Expand 10 after
1030 IDS_ERRORPAGES_BUTTON_SHOW_SAVED_COPY)); 1030 IDS_ERRORPAGES_BUTTON_SHOW_SAVED_COPY));
1031 show_saved_copy_button->SetString( 1031 show_saved_copy_button->SetString(
1032 "title", 1032 "title",
1033 l10n_util::GetStringUTF16(IDS_ERRORPAGES_BUTTON_SHOW_SAVED_COPY_HELP)); 1033 l10n_util::GetStringUTF16(IDS_ERRORPAGES_BUTTON_SHOW_SAVED_COPY_HELP));
1034 if (show_saved_copy_primary) 1034 if (show_saved_copy_primary)
1035 show_saved_copy_button->SetString("primary", "true"); 1035 show_saved_copy_button->SetString("primary", "true");
1036 error_strings->Set("showSavedCopyButton", show_saved_copy_button); 1036 error_strings->Set("showSavedCopyButton", show_saved_copy_button);
1037 } 1037 }
1038 1038
1039 #if defined(OS_ANDROID) 1039 #if defined(OS_ANDROID)
1040 if (!reload_visible && !show_saved_copy_visible && !is_incognito && 1040 if (!is_post && !reload_visible && !show_saved_copy_visible &&
1041 failed_url.is_valid() && failed_url.SchemeIsHTTPOrHTTPS() && 1041 !is_incognito && failed_url.is_valid() &&
1042 failed_url.SchemeIsHTTPOrHTTPS() &&
1042 offline_pages::IsOfflinePagesAsyncDownloadEnabled()) { 1043 offline_pages::IsOfflinePagesAsyncDownloadEnabled()) {
1043 std::unique_ptr<base::DictionaryValue> download_button = 1044 std::unique_ptr<base::DictionaryValue> download_button =
1044 base::MakeUnique<base::DictionaryValue>(); 1045 base::MakeUnique<base::DictionaryValue>();
1045 download_button->SetString( 1046 download_button->SetString(
1046 "msg", 1047 "msg",
1047 l10n_util::GetStringUTF16(IDS_ERRORPAGES_BUTTON_DOWNLOAD)); 1048 l10n_util::GetStringUTF16(IDS_ERRORPAGES_BUTTON_DOWNLOAD));
1048 download_button->SetString( 1049 download_button->SetString(
1049 "disabledMsg", 1050 "disabledMsg",
1050 l10n_util::GetStringUTF16(IDS_ERRORPAGES_BUTTON_DOWNLOADING)); 1051 l10n_util::GetStringUTF16(IDS_ERRORPAGES_BUTTON_DOWNLOADING));
1051 error_strings->Set("downloadButton", std::move(download_button)); 1052 error_strings->Set("downloadButton", std::move(download_button));
(...skipping 14 matching lines...) Expand all
1066 1067
1067 bool LocalizedError::HasStrings(const std::string& error_domain, 1068 bool LocalizedError::HasStrings(const std::string& error_domain,
1068 int error_code) { 1069 int error_code) {
1069 // Whether or not the there are strings for an error does not depend on 1070 // Whether or not the there are strings for an error does not depend on
1070 // whether or not the page was be generated by a POST, so just claim it was 1071 // whether or not the page was be generated by a POST, so just claim it was
1071 // not. 1072 // not.
1072 return LookupErrorMap(error_domain, error_code, /*is_post=*/false) != nullptr; 1073 return LookupErrorMap(error_domain, error_code, /*is_post=*/false) != nullptr;
1073 } 1074 }
1074 1075
1075 } // namespace error_page 1076 } // namespace error_page
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698