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

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

Issue 2321503002: (Re-)introduce AncestorThrottle to handle 'X-Frame-Options'. (Closed)
Patch Set: Rebase after a month... Created 4 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 unified diff | Download patch
« no previous file with comments | « chrome/renderer/chrome_content_renderer_client.cc ('k') | content/browser/BUILD.gn » ('j') | 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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 struct LocalizedErrorMap { 75 struct LocalizedErrorMap {
76 int error_code; 76 int error_code;
77 unsigned int heading_resource_id; 77 unsigned int heading_resource_id;
78 // Detailed summary used when the error is in the main frame and shown on 78 // Detailed summary used when the error is in the main frame and shown on
79 // mouse over when the error is in a frame. 79 // mouse over when the error is in a frame.
80 unsigned int summary_resource_id; 80 unsigned int summary_resource_id;
81 int suggestions; // Bitmap of SUGGEST_* values. 81 int suggestions; // Bitmap of SUGGEST_* values.
82 int buttons; // Which buttons if any to show. 82 int buttons; // Which buttons if any to show.
83 }; 83 };
84 84
85 // clang-format off
85 const LocalizedErrorMap net_error_options[] = { 86 const LocalizedErrorMap net_error_options[] = {
86 {net::ERR_TIMED_OUT, 87 {net::ERR_TIMED_OUT,
87 IDS_ERRORPAGES_HEADING_NOT_AVAILABLE, 88 IDS_ERRORPAGES_HEADING_NOT_AVAILABLE,
88 IDS_ERRORPAGES_SUMMARY_TIMED_OUT, 89 IDS_ERRORPAGES_SUMMARY_TIMED_OUT,
89 SUGGEST_CHECK_CONNECTION | SUGGEST_FIREWALL_CONFIG | SUGGEST_PROXY_CONFIG | 90 SUGGEST_CHECK_CONNECTION | SUGGEST_FIREWALL_CONFIG | SUGGEST_PROXY_CONFIG |
90 SUGGEST_DIAGNOSE_TOOL, 91 SUGGEST_DIAGNOSE_TOOL,
91 SHOW_BUTTON_RELOAD, 92 SHOW_BUTTON_RELOAD,
92 }, 93 },
93 {net::ERR_CONNECTION_TIMED_OUT, 94 {net::ERR_CONNECTION_TIMED_OUT,
94 IDS_ERRORPAGES_HEADING_NOT_AVAILABLE, 95 IDS_ERRORPAGES_HEADING_NOT_AVAILABLE,
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
298 IDS_ERRORPAGES_SUMMARY_SSL_VERSION_OR_CIPHER_MISMATCH, 299 IDS_ERRORPAGES_SUMMARY_SSL_VERSION_OR_CIPHER_MISMATCH,
299 SUGGEST_UNSUPPORTED_CIPHER, 300 SUGGEST_UNSUPPORTED_CIPHER,
300 SHOW_NO_BUTTONS, 301 SHOW_NO_BUTTONS,
301 }, 302 },
302 {net::ERR_SSL_SERVER_CERT_BAD_FORMAT, 303 {net::ERR_SSL_SERVER_CERT_BAD_FORMAT,
303 IDS_ERRORPAGES_HEADING_INSECURE_CONNECTION, 304 IDS_ERRORPAGES_HEADING_INSECURE_CONNECTION,
304 IDS_ERRORPAGES_SUMMARY_SSL_SECURITY_ERROR, 305 IDS_ERRORPAGES_SUMMARY_SSL_SECURITY_ERROR,
305 SUGGEST_NONE, 306 SUGGEST_NONE,
306 SHOW_NO_BUTTONS, 307 SHOW_NO_BUTTONS,
307 }, 308 },
309 {net::ERR_BLOCKED_BY_RESPONSE,
310 IDS_ERRORPAGES_HEADING_BLOCKED,
311 IDS_ERRORPAGES_SUMMARY_CONNECTION_REFUSED,
312 SUGGEST_NONE,
313 SHOW_NO_BUTTONS
314 },
308 }; 315 };
316 // clang-format on
309 317
310 // Special error page to be used in the case of navigating back to a page 318 // Special error page to be used in the case of navigating back to a page
311 // generated by a POST. LocalizedError::HasStrings expects this net error code 319 // generated by a POST. LocalizedError::HasStrings expects this net error code
312 // to also appear in the array above. 320 // to also appear in the array above.
313 const LocalizedErrorMap repost_error = { 321 const LocalizedErrorMap repost_error = {
314 net::ERR_CACHE_MISS, 322 net::ERR_CACHE_MISS,
315 IDS_HTTP_POST_WARNING_TITLE, 323 IDS_HTTP_POST_WARNING_TITLE,
316 IDS_ERRORPAGES_HTTP_POST_WARNING, 324 IDS_ERRORPAGES_HTTP_POST_WARNING,
317 SUGGEST_REPOST_RELOAD, 325 SUGGEST_REPOST_RELOAD,
318 SHOW_NO_BUTTONS, 326 SHOW_NO_BUTTONS,
(...skipping 692 matching lines...) Expand 10 before | Expand all | Expand 10 after
1011 1019
1012 bool LocalizedError::HasStrings(const std::string& error_domain, 1020 bool LocalizedError::HasStrings(const std::string& error_domain,
1013 int error_code) { 1021 int error_code) {
1014 // Whether or not the there are strings for an error does not depend on 1022 // Whether or not the there are strings for an error does not depend on
1015 // whether or not the page was be generated by a POST, so just claim it was 1023 // whether or not the page was be generated by a POST, so just claim it was
1016 // not. 1024 // not.
1017 return LookupErrorMap(error_domain, error_code, /*is_post=*/false) != nullptr; 1025 return LookupErrorMap(error_domain, error_code, /*is_post=*/false) != nullptr;
1018 } 1026 }
1019 1027
1020 } // namespace error_page 1028 } // namespace error_page
OLDNEW
« no previous file with comments | « chrome/renderer/chrome_content_renderer_client.cc ('k') | content/browser/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698