| OLD | NEW |
| 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 Loading... |
| 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 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 304 IDS_ERRORPAGES_SUMMARY_SSL_VERSION_OR_CIPHER_MISMATCH, | 305 IDS_ERRORPAGES_SUMMARY_SSL_VERSION_OR_CIPHER_MISMATCH, |
| 305 SUGGEST_UNSUPPORTED_CIPHER, | 306 SUGGEST_UNSUPPORTED_CIPHER, |
| 306 SHOW_NO_BUTTONS, | 307 SHOW_NO_BUTTONS, |
| 307 }, | 308 }, |
| 308 {net::ERR_SSL_SERVER_CERT_BAD_FORMAT, | 309 {net::ERR_SSL_SERVER_CERT_BAD_FORMAT, |
| 309 IDS_ERRORPAGES_HEADING_INSECURE_CONNECTION, | 310 IDS_ERRORPAGES_HEADING_INSECURE_CONNECTION, |
| 310 IDS_ERRORPAGES_SUMMARY_SSL_SECURITY_ERROR, | 311 IDS_ERRORPAGES_SUMMARY_SSL_SECURITY_ERROR, |
| 311 SUGGEST_NONE, | 312 SUGGEST_NONE, |
| 312 SHOW_NO_BUTTONS, | 313 SHOW_NO_BUTTONS, |
| 313 }, | 314 }, |
| 315 {net::ERR_BLOCKED_BY_RESPONSE, |
| 316 IDS_ERRORPAGES_HEADING_BLOCKED, |
| 317 IDS_ERRORPAGES_SUMMARY_CONNECTION_REFUSED, |
| 318 SUGGEST_NONE, |
| 319 SHOW_NO_BUTTONS |
| 320 }, |
| 314 }; | 321 }; |
| 322 // clang-format on |
| 315 | 323 |
| 316 // Special error page to be used in the case of navigating back to a page | 324 // Special error page to be used in the case of navigating back to a page |
| 317 // generated by a POST. LocalizedError::HasStrings expects this net error code | 325 // generated by a POST. LocalizedError::HasStrings expects this net error code |
| 318 // to also appear in the array above. | 326 // to also appear in the array above. |
| 319 const LocalizedErrorMap repost_error = { | 327 const LocalizedErrorMap repost_error = { |
| 320 net::ERR_CACHE_MISS, | 328 net::ERR_CACHE_MISS, |
| 321 IDS_HTTP_POST_WARNING_TITLE, | 329 IDS_HTTP_POST_WARNING_TITLE, |
| 322 IDS_ERRORPAGES_HTTP_POST_WARNING, | 330 IDS_ERRORPAGES_HTTP_POST_WARNING, |
| 323 SUGGEST_REPOST_RELOAD, | 331 SUGGEST_REPOST_RELOAD, |
| 324 SHOW_NO_BUTTONS, | 332 SHOW_NO_BUTTONS, |
| (...skipping 693 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1018 | 1026 |
| 1019 bool LocalizedError::HasStrings(const std::string& error_domain, | 1027 bool LocalizedError::HasStrings(const std::string& error_domain, |
| 1020 int error_code) { | 1028 int error_code) { |
| 1021 // Whether or not the there are strings for an error does not depend on | 1029 // Whether or not the there are strings for an error does not depend on |
| 1022 // whether or not the page was be generated by a POST, so just claim it was | 1030 // whether or not the page was be generated by a POST, so just claim it was |
| 1023 // not. | 1031 // not. |
| 1024 return LookupErrorMap(error_domain, error_code, /*is_post=*/false) != nullptr; | 1032 return LookupErrorMap(error_domain, error_code, /*is_post=*/false) != nullptr; |
| 1025 } | 1033 } |
| 1026 | 1034 |
| 1027 } // namespace error_page | 1035 } // namespace error_page |
| OLD | NEW |