Chromium Code Reviews| 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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 72 | 72 |
| 73 enum SHOW_BUTTONS { | 73 enum SHOW_BUTTONS { |
| 74 SHOW_NO_BUTTONS = 0, | 74 SHOW_NO_BUTTONS = 0, |
| 75 SHOW_BUTTON_RELOAD = 1, | 75 SHOW_BUTTON_RELOAD = 1, |
| 76 }; | 76 }; |
| 77 | 77 |
| 78 struct LocalizedErrorMap { | 78 struct LocalizedErrorMap { |
| 79 int error_code; | 79 int error_code; |
| 80 unsigned int title_resource_id; | 80 unsigned int title_resource_id; |
| 81 unsigned int heading_resource_id; | 81 unsigned int heading_resource_id; |
| 82 // Detailed summary used when the error is in the main frame. | 82 // Detailed summary used when the error is in the main frame and shown on |
| 83 // mouse over when the error is in a frame. | |
| 83 unsigned int summary_resource_id; | 84 unsigned int summary_resource_id; |
| 84 // Short one sentence description shown on mouse over when the error is in | |
| 85 // a frame. | |
| 86 unsigned int details_resource_id; | |
| 87 int suggestions; // Bitmap of SUGGEST_* values. | 85 int suggestions; // Bitmap of SUGGEST_* values. |
| 88 int buttons; // Which buttons if any to show. | 86 int buttons; // Which buttons if any to show. |
| 89 }; | 87 }; |
| 90 | 88 |
| 91 const LocalizedErrorMap net_error_options[] = { | 89 const LocalizedErrorMap net_error_options[] = { |
| 92 {net::ERR_TIMED_OUT, | 90 {net::ERR_TIMED_OUT, |
| 93 IDS_ERRORPAGES_TITLE_NOT_AVAILABLE, | 91 IDS_ERRORPAGES_TITLE_NOT_AVAILABLE, |
| 94 IDS_ERRORPAGES_HEADING_NOT_AVAILABLE, | 92 IDS_ERRORPAGES_HEADING_NOT_AVAILABLE, |
| 95 IDS_ERRORPAGES_SUMMARY_TIMED_OUT, | 93 IDS_ERRORPAGES_SUMMARY_TIMED_OUT, |
| 96 IDS_ERRORPAGES_DETAILS_TIMED_OUT, | |
| 97 SUGGEST_CHECK_CONNECTION | SUGGEST_FIREWALL_CONFIG | SUGGEST_PROXY_CONFIG | | 94 SUGGEST_CHECK_CONNECTION | SUGGEST_FIREWALL_CONFIG | SUGGEST_PROXY_CONFIG | |
| 98 SUGGEST_DIAGNOSE_TOOL, | 95 SUGGEST_DIAGNOSE_TOOL, |
| 99 SHOW_BUTTON_RELOAD, | 96 SHOW_BUTTON_RELOAD, |
| 100 }, | 97 }, |
| 101 {net::ERR_CONNECTION_TIMED_OUT, | 98 {net::ERR_CONNECTION_TIMED_OUT, |
| 102 IDS_ERRORPAGES_TITLE_NOT_AVAILABLE, | 99 IDS_ERRORPAGES_TITLE_NOT_AVAILABLE, |
| 103 IDS_ERRORPAGES_HEADING_NOT_AVAILABLE, | 100 IDS_ERRORPAGES_HEADING_NOT_AVAILABLE, |
| 104 IDS_ERRORPAGES_SUMMARY_TIMED_OUT, | 101 IDS_ERRORPAGES_SUMMARY_TIMED_OUT, |
| 105 IDS_ERRORPAGES_DETAILS_TIMED_OUT, | |
| 106 SUGGEST_CHECK_CONNECTION | SUGGEST_FIREWALL_CONFIG | SUGGEST_PROXY_CONFIG | | 102 SUGGEST_CHECK_CONNECTION | SUGGEST_FIREWALL_CONFIG | SUGGEST_PROXY_CONFIG | |
| 107 SUGGEST_DIAGNOSE_TOOL, | 103 SUGGEST_DIAGNOSE_TOOL, |
| 108 SHOW_BUTTON_RELOAD, | 104 SHOW_BUTTON_RELOAD, |
| 109 }, | 105 }, |
| 110 {net::ERR_CONNECTION_CLOSED, | 106 {net::ERR_CONNECTION_CLOSED, |
| 111 IDS_ERRORPAGES_TITLE_NOT_AVAILABLE, | 107 IDS_ERRORPAGES_TITLE_NOT_AVAILABLE, |
| 112 IDS_ERRORPAGES_HEADING_NOT_AVAILABLE, | 108 IDS_ERRORPAGES_HEADING_NOT_AVAILABLE, |
| 113 IDS_ERRORPAGES_SUMMARY_CONNECTION_CLOSED, | 109 IDS_ERRORPAGES_SUMMARY_CONNECTION_CLOSED, |
| 114 IDS_ERRORPAGES_DETAILS_CONNECTION_CLOSED, | |
| 115 SUGGEST_CHECK_CONNECTION | SUGGEST_FIREWALL_CONFIG | SUGGEST_PROXY_CONFIG | | 110 SUGGEST_CHECK_CONNECTION | SUGGEST_FIREWALL_CONFIG | SUGGEST_PROXY_CONFIG | |
| 116 SUGGEST_DIAGNOSE_TOOL, | 111 SUGGEST_DIAGNOSE_TOOL, |
| 117 SHOW_BUTTON_RELOAD, | 112 SHOW_BUTTON_RELOAD, |
| 118 }, | 113 }, |
| 119 {net::ERR_CONNECTION_RESET, | 114 {net::ERR_CONNECTION_RESET, |
| 120 IDS_ERRORPAGES_TITLE_NOT_AVAILABLE, | 115 IDS_ERRORPAGES_TITLE_NOT_AVAILABLE, |
| 121 IDS_ERRORPAGES_HEADING_NOT_AVAILABLE, | 116 IDS_ERRORPAGES_HEADING_NOT_AVAILABLE, |
| 122 IDS_ERRORPAGES_SUMMARY_CONNECTION_RESET, | 117 IDS_ERRORPAGES_SUMMARY_CONNECTION_RESET, |
| 123 IDS_ERRORPAGES_DETAILS_CONNECTION_RESET, | |
| 124 SUGGEST_CHECK_CONNECTION | SUGGEST_FIREWALL_CONFIG | SUGGEST_PROXY_CONFIG | | 118 SUGGEST_CHECK_CONNECTION | SUGGEST_FIREWALL_CONFIG | SUGGEST_PROXY_CONFIG | |
| 125 SUGGEST_DIAGNOSE_TOOL, | 119 SUGGEST_DIAGNOSE_TOOL, |
| 126 SHOW_BUTTON_RELOAD, | 120 SHOW_BUTTON_RELOAD, |
| 127 }, | 121 }, |
| 128 {net::ERR_CONNECTION_REFUSED, | 122 {net::ERR_CONNECTION_REFUSED, |
| 129 IDS_ERRORPAGES_TITLE_NOT_AVAILABLE, | 123 IDS_ERRORPAGES_TITLE_NOT_AVAILABLE, |
| 130 IDS_ERRORPAGES_HEADING_NOT_AVAILABLE, | 124 IDS_ERRORPAGES_HEADING_NOT_AVAILABLE, |
| 131 IDS_ERRORPAGES_SUMMARY_CONNECTION_REFUSED, | 125 IDS_ERRORPAGES_SUMMARY_CONNECTION_REFUSED, |
| 132 IDS_ERRORPAGES_DETAILS_CONNECTION_REFUSED, | |
| 133 SUGGEST_CHECK_CONNECTION | SUGGEST_FIREWALL_CONFIG | SUGGEST_PROXY_CONFIG, | 126 SUGGEST_CHECK_CONNECTION | SUGGEST_FIREWALL_CONFIG | SUGGEST_PROXY_CONFIG, |
| 134 SHOW_BUTTON_RELOAD, | 127 SHOW_BUTTON_RELOAD, |
| 135 }, | 128 }, |
| 136 {net::ERR_CONNECTION_FAILED, | 129 {net::ERR_CONNECTION_FAILED, |
| 137 IDS_ERRORPAGES_TITLE_NOT_AVAILABLE, | 130 IDS_ERRORPAGES_TITLE_NOT_AVAILABLE, |
| 138 IDS_ERRORPAGES_HEADING_NOT_AVAILABLE, | 131 IDS_ERRORPAGES_HEADING_NOT_AVAILABLE, |
| 139 IDS_ERRORPAGES_SUMMARY_CONNECTION_FAILED, | 132 IDS_ERRORPAGES_SUMMARY_CONNECTION_FAILED, |
| 140 IDS_ERRORPAGES_DETAILS_CONNECTION_FAILED, | |
| 141 SUGGEST_DIAGNOSE_TOOL, | 133 SUGGEST_DIAGNOSE_TOOL, |
| 142 SHOW_BUTTON_RELOAD, | 134 SHOW_BUTTON_RELOAD, |
| 143 }, | 135 }, |
| 144 {net::ERR_NAME_NOT_RESOLVED, | 136 {net::ERR_NAME_NOT_RESOLVED, |
| 145 IDS_ERRORPAGES_TITLE_NOT_AVAILABLE, | 137 IDS_ERRORPAGES_TITLE_NOT_AVAILABLE, |
| 146 IDS_ERRORPAGES_HEADING_NOT_AVAILABLE, | 138 IDS_ERRORPAGES_HEADING_NOT_AVAILABLE, |
| 147 IDS_ERRORPAGES_SUMMARY_NAME_NOT_RESOLVED, | 139 IDS_ERRORPAGES_SUMMARY_NAME_NOT_RESOLVED, |
| 148 IDS_ERRORPAGES_DETAILS_NAME_NOT_RESOLVED, | |
| 149 SUGGEST_CHECK_CONNECTION | SUGGEST_DNS_CONFIG | SUGGEST_FIREWALL_CONFIG | | 140 SUGGEST_CHECK_CONNECTION | SUGGEST_DNS_CONFIG | SUGGEST_FIREWALL_CONFIG | |
| 150 SUGGEST_PROXY_CONFIG | SUGGEST_DIAGNOSE_TOOL, | 141 SUGGEST_PROXY_CONFIG | SUGGEST_DIAGNOSE_TOOL, |
| 151 SHOW_BUTTON_RELOAD, | 142 SHOW_BUTTON_RELOAD, |
| 152 }, | 143 }, |
| 153 {net::ERR_ICANN_NAME_COLLISION, | 144 {net::ERR_ICANN_NAME_COLLISION, |
| 154 IDS_ERRORPAGES_TITLE_NOT_AVAILABLE, | 145 IDS_ERRORPAGES_TITLE_NOT_AVAILABLE, |
| 155 IDS_ERRORPAGES_HEADING_NOT_AVAILABLE, | 146 IDS_ERRORPAGES_HEADING_NOT_AVAILABLE, |
| 156 IDS_ERRORPAGES_SUMMARY_ICANN_NAME_COLLISION, | 147 IDS_ERRORPAGES_SUMMARY_ICANN_NAME_COLLISION, |
| 157 IDS_ERRORPAGES_DETAILS_ICANN_NAME_COLLISION, | |
| 158 SUGGEST_NONE, | 148 SUGGEST_NONE, |
| 159 SHOW_NO_BUTTONS, | 149 SHOW_NO_BUTTONS, |
| 160 }, | 150 }, |
| 161 {net::ERR_ADDRESS_UNREACHABLE, | 151 {net::ERR_ADDRESS_UNREACHABLE, |
| 162 IDS_ERRORPAGES_TITLE_NOT_AVAILABLE, | 152 IDS_ERRORPAGES_TITLE_NOT_AVAILABLE, |
| 163 IDS_ERRORPAGES_HEADING_NOT_AVAILABLE, | 153 IDS_ERRORPAGES_HEADING_NOT_AVAILABLE, |
| 164 IDS_ERRORPAGES_SUMMARY_ADDRESS_UNREACHABLE, | 154 IDS_ERRORPAGES_SUMMARY_ADDRESS_UNREACHABLE, |
| 165 IDS_ERRORPAGES_DETAILS_ADDRESS_UNREACHABLE, | |
| 166 SUGGEST_DIAGNOSE_TOOL, | 155 SUGGEST_DIAGNOSE_TOOL, |
| 167 SHOW_BUTTON_RELOAD, | 156 SHOW_BUTTON_RELOAD, |
| 168 }, | 157 }, |
| 169 {net::ERR_NETWORK_ACCESS_DENIED, | 158 {net::ERR_NETWORK_ACCESS_DENIED, |
| 170 IDS_ERRORPAGES_TITLE_NOT_AVAILABLE, | 159 IDS_ERRORPAGES_TITLE_NOT_AVAILABLE, |
| 171 IDS_ERRORPAGES_HEADING_NETWORK_ACCESS_DENIED, | 160 IDS_ERRORPAGES_HEADING_NETWORK_ACCESS_DENIED, |
| 172 IDS_ERRORPAGES_SUMMARY_NETWORK_ACCESS_DENIED, | 161 IDS_ERRORPAGES_SUMMARY_NETWORK_ACCESS_DENIED, |
| 173 IDS_ERRORPAGES_DETAILS_NETWORK_ACCESS_DENIED, | |
| 174 SUGGEST_CHECK_CONNECTION | SUGGEST_FIREWALL_CONFIG | | 162 SUGGEST_CHECK_CONNECTION | SUGGEST_FIREWALL_CONFIG | |
| 175 SUGGEST_ANTIVIRUS_CONFIG | SUGGEST_DIAGNOSE_TOOL, | 163 SUGGEST_ANTIVIRUS_CONFIG | SUGGEST_DIAGNOSE_TOOL, |
| 176 SHOW_NO_BUTTONS, | 164 SHOW_NO_BUTTONS, |
| 177 }, | 165 }, |
| 178 {net::ERR_PROXY_CONNECTION_FAILED, | 166 {net::ERR_PROXY_CONNECTION_FAILED, |
| 179 IDS_ERRORPAGES_TITLE_NOT_AVAILABLE, | 167 IDS_ERRORPAGES_TITLE_NOT_AVAILABLE, |
| 180 IDS_ERRORPAGES_HEADING_INTERNET_DISCONNECTED, | 168 IDS_ERRORPAGES_HEADING_INTERNET_DISCONNECTED, |
| 181 IDS_ERRORPAGES_SUMMARY_PROXY_CONNECTION_FAILED, | 169 IDS_ERRORPAGES_SUMMARY_PROXY_CONNECTION_FAILED, |
| 182 IDS_ERRORPAGES_DETAILS_PROXY_CONNECTION_FAILED, | |
| 183 SUGGEST_PROXY_CONFIG | SUGGEST_CONTACT_ADMINISTRATOR | SUGGEST_DIAGNOSE_TOOL, | 170 SUGGEST_PROXY_CONFIG | SUGGEST_CONTACT_ADMINISTRATOR | SUGGEST_DIAGNOSE_TOOL, |
| 184 SHOW_NO_BUTTONS, | 171 SHOW_NO_BUTTONS, |
| 185 }, | 172 }, |
| 186 {net::ERR_INTERNET_DISCONNECTED, | 173 {net::ERR_INTERNET_DISCONNECTED, |
| 187 IDS_ERRORPAGES_TITLE_NOT_AVAILABLE, | 174 IDS_ERRORPAGES_TITLE_NOT_AVAILABLE, |
| 188 IDS_ERRORPAGES_HEADING_INTERNET_DISCONNECTED, | 175 IDS_ERRORPAGES_HEADING_INTERNET_DISCONNECTED, |
| 189 kEmptyMessageResourceID, | 176 kEmptyMessageResourceID, |
| 190 IDS_ERRORPAGES_DETAILS_INTERNET_DISCONNECTED, | |
| 191 SUGGEST_OFFLINE_CHECKS | SUGGEST_DIAGNOSE_TOOL, | 177 SUGGEST_OFFLINE_CHECKS | SUGGEST_DIAGNOSE_TOOL, |
| 192 SHOW_NO_BUTTONS, | 178 SHOW_NO_BUTTONS, |
| 193 }, | 179 }, |
| 194 {net::ERR_FILE_NOT_FOUND, | 180 {net::ERR_FILE_NOT_FOUND, |
| 195 IDS_ERRORPAGES_TITLE_LOAD_FAILED, | 181 IDS_ERRORPAGES_TITLE_LOAD_FAILED, |
| 196 IDS_ERRORPAGES_HEADING_FILE_NOT_FOUND, | 182 IDS_ERRORPAGES_HEADING_FILE_NOT_FOUND, |
| 197 IDS_ERRORPAGES_SUMMARY_FILE_NOT_FOUND, | 183 IDS_ERRORPAGES_SUMMARY_FILE_NOT_FOUND, |
| 198 IDS_ERRORPAGES_DETAILS_FILE_NOT_FOUND, | |
| 199 SUGGEST_NONE, | 184 SUGGEST_NONE, |
| 200 SHOW_NO_BUTTONS, | 185 SHOW_NO_BUTTONS, |
| 201 }, | 186 }, |
| 202 {net::ERR_CACHE_MISS, | 187 {net::ERR_CACHE_MISS, |
| 203 IDS_ERRORPAGES_TITLE_LOAD_FAILED, | 188 IDS_ERRORPAGES_TITLE_LOAD_FAILED, |
| 204 IDS_ERRORPAGES_HEADING_CACHE_READ_FAILURE, | 189 IDS_ERRORPAGES_HEADING_CACHE_READ_FAILURE, |
| 205 IDS_ERRORPAGES_SUMMARY_CACHE_READ_FAILURE, | 190 IDS_ERRORPAGES_SUMMARY_CACHE_READ_FAILURE, |
| 206 IDS_ERRORPAGES_DETAILS_CACHE_READ_FAILURE, | |
| 207 SUGGEST_NONE, | 191 SUGGEST_NONE, |
| 208 SHOW_BUTTON_RELOAD, | 192 SHOW_BUTTON_RELOAD, |
| 209 }, | 193 }, |
| 210 {net::ERR_CACHE_READ_FAILURE, | 194 {net::ERR_CACHE_READ_FAILURE, |
| 211 IDS_ERRORPAGES_TITLE_LOAD_FAILED, | 195 IDS_ERRORPAGES_TITLE_LOAD_FAILED, |
| 212 IDS_ERRORPAGES_HEADING_CACHE_READ_FAILURE, | 196 IDS_ERRORPAGES_HEADING_CACHE_READ_FAILURE, |
| 213 IDS_ERRORPAGES_SUMMARY_CACHE_READ_FAILURE, | 197 IDS_ERRORPAGES_SUMMARY_CACHE_READ_FAILURE, |
| 214 IDS_ERRORPAGES_DETAILS_CACHE_READ_FAILURE, | |
| 215 SUGGEST_NONE, | 198 SUGGEST_NONE, |
| 216 SHOW_BUTTON_RELOAD, | 199 SHOW_BUTTON_RELOAD, |
| 217 }, | 200 }, |
| 218 {net::ERR_NETWORK_IO_SUSPENDED, | 201 {net::ERR_NETWORK_IO_SUSPENDED, |
| 219 IDS_ERRORPAGES_TITLE_LOAD_FAILED, | 202 IDS_ERRORPAGES_TITLE_LOAD_FAILED, |
| 220 IDS_ERRORPAGES_HEADING_CONNECTION_INTERRUPTED, | 203 IDS_ERRORPAGES_HEADING_CONNECTION_INTERRUPTED, |
| 221 IDS_ERRORPAGES_SUMMARY_NETWORK_IO_SUSPENDED, | 204 IDS_ERRORPAGES_SUMMARY_NETWORK_IO_SUSPENDED, |
| 222 IDS_ERRORPAGES_DETAILS_NETWORK_IO_SUSPENDED, | |
| 223 SUGGEST_NONE, | 205 SUGGEST_NONE, |
| 224 SHOW_BUTTON_RELOAD, | 206 SHOW_BUTTON_RELOAD, |
| 225 }, | 207 }, |
| 226 {net::ERR_TOO_MANY_REDIRECTS, | 208 {net::ERR_TOO_MANY_REDIRECTS, |
| 227 IDS_ERRORPAGES_TITLE_LOAD_FAILED, | 209 IDS_ERRORPAGES_TITLE_LOAD_FAILED, |
| 228 IDS_ERRORPAGES_HEADING_PAGE_NOT_WORKING, | 210 IDS_ERRORPAGES_HEADING_PAGE_NOT_WORKING, |
| 229 IDS_ERRORPAGES_SUMMARY_TOO_MANY_REDIRECTS, | 211 IDS_ERRORPAGES_SUMMARY_TOO_MANY_REDIRECTS, |
| 230 IDS_ERRORPAGES_DETAILS_TOO_MANY_REDIRECTS, | |
| 231 SUGGEST_LEARNMORE, | 212 SUGGEST_LEARNMORE, |
| 232 SHOW_BUTTON_RELOAD, | 213 SHOW_BUTTON_RELOAD, |
| 233 }, | 214 }, |
| 234 {net::ERR_EMPTY_RESPONSE, | 215 {net::ERR_EMPTY_RESPONSE, |
| 235 IDS_ERRORPAGES_TITLE_LOAD_FAILED, | 216 IDS_ERRORPAGES_TITLE_LOAD_FAILED, |
| 236 IDS_ERRORPAGES_HEADING_PAGE_NOT_WORKING, | 217 IDS_ERRORPAGES_HEADING_PAGE_NOT_WORKING, |
| 237 IDS_ERRORPAGES_SUMMARY_EMPTY_RESPONSE, | 218 IDS_ERRORPAGES_SUMMARY_EMPTY_RESPONSE, |
| 238 IDS_ERRORPAGES_DETAILS_EMPTY_RESPONSE, | |
| 239 SUGGEST_NONE, | 219 SUGGEST_NONE, |
| 240 SHOW_BUTTON_RELOAD, | 220 SHOW_BUTTON_RELOAD, |
| 241 }, | 221 }, |
| 242 {net::ERR_RESPONSE_HEADERS_MULTIPLE_CONTENT_LENGTH, | 222 {net::ERR_RESPONSE_HEADERS_MULTIPLE_CONTENT_LENGTH, |
| 243 IDS_ERRORPAGES_TITLE_LOAD_FAILED, | 223 IDS_ERRORPAGES_TITLE_LOAD_FAILED, |
| 244 IDS_ERRORPAGES_HEADING_PAGE_NOT_WORKING, | 224 IDS_ERRORPAGES_HEADING_PAGE_NOT_WORKING, |
| 245 IDS_ERRORPAGES_SUMMARY_INVALID_RESPONSE, | 225 IDS_ERRORPAGES_SUMMARY_INVALID_RESPONSE, |
| 246 IDS_ERRORPAGES_DETAILS_RESPONSE_HEADERS_MULTIPLE_CONTENT_LENGTH, | |
| 247 SUGGEST_NONE, | 226 SUGGEST_NONE, |
| 248 SHOW_BUTTON_RELOAD, | 227 SHOW_BUTTON_RELOAD, |
| 249 }, | 228 }, |
| 250 {net::ERR_RESPONSE_HEADERS_MULTIPLE_CONTENT_DISPOSITION, | 229 {net::ERR_RESPONSE_HEADERS_MULTIPLE_CONTENT_DISPOSITION, |
| 251 IDS_ERRORPAGES_TITLE_LOAD_FAILED, | 230 IDS_ERRORPAGES_TITLE_LOAD_FAILED, |
| 252 IDS_ERRORPAGES_HEADING_PAGE_NOT_WORKING, | 231 IDS_ERRORPAGES_HEADING_PAGE_NOT_WORKING, |
| 253 IDS_ERRORPAGES_SUMMARY_INVALID_RESPONSE, | 232 IDS_ERRORPAGES_SUMMARY_INVALID_RESPONSE, |
| 254 IDS_ERRORPAGES_DETAILS_RESPONSE_HEADERS_MULTIPLE_CONTENT_DISPOSITION, | |
| 255 SUGGEST_NONE, | 233 SUGGEST_NONE, |
| 256 SHOW_BUTTON_RELOAD, | 234 SHOW_BUTTON_RELOAD, |
| 257 }, | 235 }, |
| 258 {net::ERR_RESPONSE_HEADERS_MULTIPLE_LOCATION, | 236 {net::ERR_RESPONSE_HEADERS_MULTIPLE_LOCATION, |
| 259 IDS_ERRORPAGES_TITLE_LOAD_FAILED, | 237 IDS_ERRORPAGES_TITLE_LOAD_FAILED, |
| 260 IDS_ERRORPAGES_HEADING_PAGE_NOT_WORKING, | 238 IDS_ERRORPAGES_HEADING_PAGE_NOT_WORKING, |
| 261 IDS_ERRORPAGES_SUMMARY_INVALID_RESPONSE, | 239 IDS_ERRORPAGES_SUMMARY_INVALID_RESPONSE, |
| 262 IDS_ERRORPAGES_DETAILS_RESPONSE_HEADERS_MULTIPLE_LOCATION, | |
| 263 SUGGEST_NONE, | 240 SUGGEST_NONE, |
| 264 SHOW_BUTTON_RELOAD, | 241 SHOW_BUTTON_RELOAD, |
| 265 }, | 242 }, |
| 266 {net::ERR_CONTENT_LENGTH_MISMATCH, | 243 {net::ERR_CONTENT_LENGTH_MISMATCH, |
| 267 IDS_ERRORPAGES_TITLE_NOT_AVAILABLE, | 244 IDS_ERRORPAGES_TITLE_NOT_AVAILABLE, |
| 268 IDS_ERRORPAGES_HEADING_PAGE_NOT_WORKING, | 245 IDS_ERRORPAGES_HEADING_PAGE_NOT_WORKING, |
| 269 IDS_ERRORPAGES_SUMMARY_CONNECTION_CLOSED, | 246 IDS_ERRORPAGES_SUMMARY_CONNECTION_CLOSED, |
| 270 IDS_ERRORPAGES_DETAILS_CONNECTION_CLOSED, | |
| 271 SUGGEST_NONE, | 247 SUGGEST_NONE, |
| 272 SHOW_BUTTON_RELOAD, | 248 SHOW_BUTTON_RELOAD, |
| 273 }, | 249 }, |
| 274 {net::ERR_INCOMPLETE_CHUNKED_ENCODING, | 250 {net::ERR_INCOMPLETE_CHUNKED_ENCODING, |
| 275 IDS_ERRORPAGES_TITLE_NOT_AVAILABLE, | 251 IDS_ERRORPAGES_TITLE_NOT_AVAILABLE, |
| 276 IDS_ERRORPAGES_HEADING_PAGE_NOT_WORKING, | 252 IDS_ERRORPAGES_HEADING_PAGE_NOT_WORKING, |
| 277 IDS_ERRORPAGES_SUMMARY_CONNECTION_CLOSED, | 253 IDS_ERRORPAGES_SUMMARY_CONNECTION_CLOSED, |
| 278 IDS_ERRORPAGES_DETAILS_CONNECTION_CLOSED, | |
| 279 SUGGEST_NONE, | 254 SUGGEST_NONE, |
| 280 SHOW_BUTTON_RELOAD, | 255 SHOW_BUTTON_RELOAD, |
| 281 }, | 256 }, |
| 282 {net::ERR_SSL_PROTOCOL_ERROR, | 257 {net::ERR_SSL_PROTOCOL_ERROR, |
| 283 IDS_ERRORPAGES_TITLE_LOAD_FAILED, | 258 IDS_ERRORPAGES_TITLE_LOAD_FAILED, |
| 284 IDS_ERRORPAGES_HEADING_INSECURE_CONNECTION, | 259 IDS_ERRORPAGES_HEADING_INSECURE_CONNECTION, |
| 285 IDS_ERRORPAGES_SUMMARY_INVALID_RESPONSE, | 260 IDS_ERRORPAGES_SUMMARY_INVALID_RESPONSE, |
| 286 IDS_ERRORPAGES_DETAILS_SSL_PROTOCOL_ERROR, | |
| 287 SUGGEST_DIAGNOSE_TOOL, | 261 SUGGEST_DIAGNOSE_TOOL, |
| 288 SHOW_BUTTON_RELOAD, | 262 SHOW_BUTTON_RELOAD, |
| 289 }, | 263 }, |
| 290 {net::ERR_BAD_SSL_CLIENT_AUTH_CERT, | 264 {net::ERR_BAD_SSL_CLIENT_AUTH_CERT, |
| 291 IDS_ERRORPAGES_TITLE_LOAD_FAILED, | 265 IDS_ERRORPAGES_TITLE_LOAD_FAILED, |
| 292 IDS_ERRORPAGES_HEADING_INSECURE_CONNECTION, | 266 IDS_ERRORPAGES_HEADING_INSECURE_CONNECTION, |
| 293 IDS_ERRORPAGES_SUMMARY_BAD_SSL_CLIENT_AUTH_CERT, | 267 IDS_ERRORPAGES_SUMMARY_BAD_SSL_CLIENT_AUTH_CERT, |
| 294 IDS_ERRORPAGES_DETAILS_BAD_SSL_CLIENT_AUTH_CERT, | |
| 295 SUGGEST_CONTACT_ADMINISTRATOR, | 268 SUGGEST_CONTACT_ADMINISTRATOR, |
| 296 SHOW_NO_BUTTONS, | 269 SHOW_NO_BUTTONS, |
| 297 }, | 270 }, |
| 298 {net::ERR_SSL_WEAK_SERVER_EPHEMERAL_DH_KEY, | 271 {net::ERR_SSL_WEAK_SERVER_EPHEMERAL_DH_KEY, |
| 299 IDS_ERRORPAGES_TITLE_LOAD_FAILED, | 272 IDS_ERRORPAGES_TITLE_LOAD_FAILED, |
| 300 IDS_ERRORPAGES_HEADING_INSECURE_CONNECTION, | 273 IDS_ERRORPAGES_HEADING_INSECURE_CONNECTION, |
| 301 IDS_ERRORPAGES_SUMMARY_SSL_SECURITY_ERROR, | 274 IDS_ERRORPAGES_SUMMARY_SSL_SECURITY_ERROR, |
| 302 IDS_ERRORPAGES_DETAILS_SSL_PROTOCOL_ERROR, | |
| 303 SUGGEST_LEARNMORE, | 275 SUGGEST_LEARNMORE, |
| 304 SHOW_NO_BUTTONS, | 276 SHOW_NO_BUTTONS, |
| 305 }, | 277 }, |
| 306 {net::ERR_SSL_PINNED_KEY_NOT_IN_CERT_CHAIN, | 278 {net::ERR_SSL_PINNED_KEY_NOT_IN_CERT_CHAIN, |
| 307 IDS_ERRORPAGES_TITLE_LOAD_FAILED, | 279 IDS_ERRORPAGES_TITLE_LOAD_FAILED, |
| 308 IDS_ERRORPAGES_HEADING_INSECURE_CONNECTION, | 280 IDS_ERRORPAGES_HEADING_INSECURE_CONNECTION, |
| 309 IDS_CERT_ERROR_SUMMARY_PINNING_FAILURE_DETAILS, | 281 IDS_CERT_ERROR_SUMMARY_PINNING_FAILURE_DETAILS, |
| 310 IDS_CERT_ERROR_SUMMARY_PINNING_FAILURE_DESCRIPTION, | |
| 311 SUGGEST_NONE, | 282 SUGGEST_NONE, |
| 312 SHOW_NO_BUTTONS, | 283 SHOW_NO_BUTTONS, |
| 313 }, | 284 }, |
| 314 {net::ERR_TEMPORARILY_THROTTLED, | 285 {net::ERR_TEMPORARILY_THROTTLED, |
| 315 IDS_ERRORPAGES_TITLE_ACCESS_DENIED, | 286 IDS_ERRORPAGES_TITLE_ACCESS_DENIED, |
| 316 IDS_ERRORPAGES_HEADING_NOT_AVAILABLE, | 287 IDS_ERRORPAGES_HEADING_NOT_AVAILABLE, |
| 317 IDS_ERRORPAGES_SUMMARY_NOT_AVAILABLE, | 288 IDS_ERRORPAGES_SUMMARY_NOT_AVAILABLE, |
| 318 IDS_ERRORPAGES_DETAILS_TEMPORARILY_THROTTLED, | |
| 319 SUGGEST_DISABLE_EXTENSION, | 289 SUGGEST_DISABLE_EXTENSION, |
| 320 SHOW_NO_BUTTONS, | 290 SHOW_NO_BUTTONS, |
| 321 }, | 291 }, |
| 322 {net::ERR_BLOCKED_BY_CLIENT, | 292 {net::ERR_BLOCKED_BY_CLIENT, |
| 323 IDS_ERRORPAGES_TITLE_BLOCKED, | 293 IDS_ERRORPAGES_TITLE_BLOCKED, |
| 324 IDS_ERRORPAGES_HEADING_BLOCKED, | 294 IDS_ERRORPAGES_HEADING_BLOCKED, |
| 325 IDS_ERRORPAGES_SUMMARY_BLOCKED_BY_EXTENSION, | 295 IDS_ERRORPAGES_SUMMARY_BLOCKED_BY_EXTENSION, |
| 326 IDS_ERRORPAGES_DETAILS_BLOCKED_BY_EXTENSION, | |
| 327 SUGGEST_DISABLE_EXTENSION, | 296 SUGGEST_DISABLE_EXTENSION, |
| 328 SHOW_BUTTON_RELOAD, | 297 SHOW_BUTTON_RELOAD, |
| 329 }, | 298 }, |
| 330 {net::ERR_NETWORK_CHANGED, | 299 {net::ERR_NETWORK_CHANGED, |
| 331 IDS_ERRORPAGES_TITLE_LOAD_FAILED, | 300 IDS_ERRORPAGES_TITLE_LOAD_FAILED, |
| 332 IDS_ERRORPAGES_HEADING_CONNECTION_INTERRUPTED, | 301 IDS_ERRORPAGES_HEADING_CONNECTION_INTERRUPTED, |
| 333 IDS_ERRORPAGES_SUMMARY_NETWORK_CHANGED, | 302 IDS_ERRORPAGES_SUMMARY_NETWORK_CHANGED, |
| 334 IDS_ERRORPAGES_DETAILS_NETWORK_CHANGED, | |
| 335 SUGGEST_NONE, | 303 SUGGEST_NONE, |
| 336 SHOW_BUTTON_RELOAD, | 304 SHOW_BUTTON_RELOAD, |
| 337 }, | 305 }, |
| 338 {net::ERR_BLOCKED_BY_ADMINISTRATOR, | 306 {net::ERR_BLOCKED_BY_ADMINISTRATOR, |
| 339 IDS_ERRORPAGES_TITLE_BLOCKED, | 307 IDS_ERRORPAGES_TITLE_BLOCKED, |
| 340 IDS_ERRORPAGES_HEADING_BLOCKED, | 308 IDS_ERRORPAGES_HEADING_BLOCKED, |
| 341 IDS_ERRORPAGES_SUMMARY_BLOCKED_BY_ADMINISTRATOR, | 309 IDS_ERRORPAGES_SUMMARY_BLOCKED_BY_ADMINISTRATOR, |
| 342 IDS_ERRORPAGES_DETAILS_BLOCKED_BY_ADMINISTRATOR, | |
| 343 SUGGEST_CONTACT_ADMINISTRATOR, | 310 SUGGEST_CONTACT_ADMINISTRATOR, |
| 344 SHOW_NO_BUTTONS, | 311 SHOW_NO_BUTTONS, |
| 345 }, | 312 }, |
| 346 {net::ERR_BLOCKED_ENROLLMENT_CHECK_PENDING, | 313 {net::ERR_BLOCKED_ENROLLMENT_CHECK_PENDING, |
| 347 IDS_ERRORPAGES_TITLE_BLOCKED, | 314 IDS_ERRORPAGES_TITLE_BLOCKED, |
| 348 IDS_ERRORPAGES_HEADING_INTERNET_DISCONNECTED, | 315 IDS_ERRORPAGES_HEADING_INTERNET_DISCONNECTED, |
| 349 IDS_ERRORPAGES_SUMMARY_BLOCKED_ENROLLMENT_CHECK_PENDING, | 316 IDS_ERRORPAGES_SUMMARY_BLOCKED_ENROLLMENT_CHECK_PENDING, |
| 350 IDS_ERRORPAGES_DETAILS_BLOCKED_ENROLLMENT_CHECK_PENDING, | |
| 351 SUGGEST_COMPLETE_SETUP, | 317 SUGGEST_COMPLETE_SETUP, |
| 352 SHOW_NO_BUTTONS, | 318 SHOW_NO_BUTTONS, |
| 353 }, | 319 }, |
| 354 {net::ERR_SSL_FALLBACK_BEYOND_MINIMUM_VERSION, | 320 {net::ERR_SSL_FALLBACK_BEYOND_MINIMUM_VERSION, |
| 355 IDS_ERRORPAGES_TITLE_LOAD_FAILED, | 321 IDS_ERRORPAGES_TITLE_LOAD_FAILED, |
| 356 IDS_ERRORPAGES_HEADING_INSECURE_CONNECTION, | 322 IDS_ERRORPAGES_HEADING_INSECURE_CONNECTION, |
| 357 IDS_ERRORPAGES_SUMMARY_INVALID_RESPONSE, | 323 IDS_ERRORPAGES_SUMMARY_INVALID_RESPONSE, |
| 358 IDS_ERRORPAGES_DETAILS_SSL_FALLBACK_BEYOND_MINIMUM_VERSION, | |
| 359 SUGGEST_NONE, | 324 SUGGEST_NONE, |
| 360 SHOW_NO_BUTTONS, | 325 SHOW_NO_BUTTONS, |
| 361 }, | 326 }, |
| 362 {net::ERR_SSL_VERSION_OR_CIPHER_MISMATCH, | 327 {net::ERR_SSL_VERSION_OR_CIPHER_MISMATCH, |
| 363 IDS_ERRORPAGES_TITLE_LOAD_FAILED, | 328 IDS_ERRORPAGES_TITLE_LOAD_FAILED, |
| 364 IDS_ERRORPAGES_HEADING_INSECURE_CONNECTION, | 329 IDS_ERRORPAGES_HEADING_INSECURE_CONNECTION, |
| 365 IDS_ERRORPAGES_SUMMARY_SSL_VERSION_OR_CIPHER_MISMATCH, | 330 IDS_ERRORPAGES_SUMMARY_SSL_VERSION_OR_CIPHER_MISMATCH, |
| 366 IDS_ERRORPAGES_DETAILS_SSL_VERSION_OR_CIPHER_MISMATCH, | |
| 367 SUGGEST_UNSUPPORTED_CIPHER, | 331 SUGGEST_UNSUPPORTED_CIPHER, |
| 368 SHOW_NO_BUTTONS, | 332 SHOW_NO_BUTTONS, |
| 369 }, | 333 }, |
| 370 {net::ERR_TEMPORARY_BACKOFF, | 334 {net::ERR_TEMPORARY_BACKOFF, |
| 371 IDS_ERRORPAGES_TITLE_ACCESS_DENIED, | 335 IDS_ERRORPAGES_TITLE_ACCESS_DENIED, |
| 372 IDS_ERRORPAGES_HEADING_ACCESS_DENIED, | 336 IDS_ERRORPAGES_HEADING_ACCESS_DENIED, |
| 373 IDS_ERRORPAGES_SUMMARY_TEMPORARY_BACKOFF, | 337 IDS_ERRORPAGES_SUMMARY_TEMPORARY_BACKOFF, |
| 374 IDS_ERRORPAGES_DETAILS_TEMPORARY_BACKOFF, | |
| 375 SUGGEST_NONE, | 338 SUGGEST_NONE, |
| 376 SHOW_NO_BUTTONS, | 339 SHOW_NO_BUTTONS, |
| 377 }, | 340 }, |
| 378 {net::ERR_SSL_SERVER_CERT_BAD_FORMAT, | 341 {net::ERR_SSL_SERVER_CERT_BAD_FORMAT, |
| 379 IDS_ERRORPAGES_TITLE_LOAD_FAILED, | 342 IDS_ERRORPAGES_TITLE_LOAD_FAILED, |
| 380 IDS_ERRORPAGES_HEADING_INSECURE_CONNECTION, | 343 IDS_ERRORPAGES_HEADING_INSECURE_CONNECTION, |
| 381 IDS_ERRORPAGES_SUMMARY_SSL_SECURITY_ERROR, | 344 IDS_ERRORPAGES_SUMMARY_SSL_SECURITY_ERROR, |
| 382 IDS_ERRORPAGES_DETAILS_SSL_PROTOCOL_ERROR, | |
| 383 SUGGEST_NONE, | 345 SUGGEST_NONE, |
| 384 SHOW_NO_BUTTONS, | 346 SHOW_NO_BUTTONS, |
| 385 }, | 347 }, |
| 386 }; | 348 }; |
| 387 | 349 |
| 388 // Special error page to be used in the case of navigating back to a page | 350 // Special error page to be used in the case of navigating back to a page |
| 389 // generated by a POST. LocalizedError::HasStrings expects this net error code | 351 // generated by a POST. LocalizedError::HasStrings expects this net error code |
| 390 // to also appear in the array above. | 352 // to also appear in the array above. |
| 391 const LocalizedErrorMap repost_error = { | 353 const LocalizedErrorMap repost_error = { |
| 392 net::ERR_CACHE_MISS, | 354 net::ERR_CACHE_MISS, |
| 393 IDS_ERRORPAGES_TITLE_NOT_AVAILABLE, | 355 IDS_ERRORPAGES_TITLE_NOT_AVAILABLE, |
| 394 IDS_HTTP_POST_WARNING_TITLE, | 356 IDS_HTTP_POST_WARNING_TITLE, |
| 395 IDS_ERRORPAGES_HTTP_POST_WARNING, | 357 IDS_ERRORPAGES_HTTP_POST_WARNING, |
| 396 IDS_ERRORPAGES_DETAILS_CACHE_READ_FAILURE, | |
| 397 SUGGEST_REPOST_RELOAD, | 358 SUGGEST_REPOST_RELOAD, |
| 398 SHOW_NO_BUTTONS, | 359 SHOW_NO_BUTTONS, |
| 399 }; | 360 }; |
| 400 | 361 |
| 401 const LocalizedErrorMap http_error_options[] = { | 362 const LocalizedErrorMap http_error_options[] = { |
| 402 {403, | 363 {403, |
| 403 IDS_ERRORPAGES_TITLE_ACCESS_DENIED, | 364 IDS_ERRORPAGES_TITLE_ACCESS_DENIED, |
| 404 IDS_ERRORPAGES_HEADING_ACCESS_DENIED, | 365 IDS_ERRORPAGES_HEADING_ACCESS_DENIED, |
| 405 IDS_ERRORPAGES_SUMMARY_FORBIDDEN, | 366 IDS_ERRORPAGES_SUMMARY_FORBIDDEN, |
| 406 IDS_ERRORPAGES_DETAILS_FORBIDDEN, | |
| 407 SUGGEST_NONE, | 367 SUGGEST_NONE, |
| 408 SHOW_BUTTON_RELOAD, | 368 SHOW_BUTTON_RELOAD, |
| 409 }, | 369 }, |
| 410 {410, | 370 {410, |
| 411 IDS_ERRORPAGES_TITLE_NOT_FOUND, | 371 IDS_ERRORPAGES_TITLE_NOT_FOUND, |
| 412 IDS_ERRORPAGES_HEADING_NOT_FOUND, | 372 IDS_ERRORPAGES_HEADING_NOT_FOUND, |
| 413 IDS_ERRORPAGES_SUMMARY_GONE, | 373 IDS_ERRORPAGES_SUMMARY_GONE, |
| 414 IDS_ERRORPAGES_DETAILS_GONE, | |
| 415 SUGGEST_NONE, | 374 SUGGEST_NONE, |
| 416 SHOW_NO_BUTTONS, | 375 SHOW_NO_BUTTONS, |
| 417 }, | 376 }, |
| 418 | 377 |
| 419 {500, | 378 {500, |
| 420 IDS_ERRORPAGES_TITLE_LOAD_FAILED, | 379 IDS_ERRORPAGES_TITLE_LOAD_FAILED, |
| 421 IDS_ERRORPAGES_HEADING_PAGE_NOT_WORKING, | 380 IDS_ERRORPAGES_HEADING_PAGE_NOT_WORKING, |
| 422 IDS_ERRORPAGES_SUMMARY_WEBSITE_CANNOT_HANDLE_REQUEST, | 381 IDS_ERRORPAGES_SUMMARY_WEBSITE_CANNOT_HANDLE_REQUEST, |
| 423 IDS_ERRORPAGES_DETAILS_INTERNAL_SERVER_ERROR, | |
| 424 SUGGEST_NONE, | 382 SUGGEST_NONE, |
| 425 SHOW_BUTTON_RELOAD, | 383 SHOW_BUTTON_RELOAD, |
| 426 }, | 384 }, |
| 427 {501, | 385 {501, |
| 428 IDS_ERRORPAGES_TITLE_LOAD_FAILED, | 386 IDS_ERRORPAGES_TITLE_LOAD_FAILED, |
| 429 IDS_ERRORPAGES_HEADING_PAGE_NOT_WORKING, | 387 IDS_ERRORPAGES_HEADING_PAGE_NOT_WORKING, |
| 430 IDS_ERRORPAGES_SUMMARY_WEBSITE_CANNOT_HANDLE_REQUEST, | 388 IDS_ERRORPAGES_SUMMARY_WEBSITE_CANNOT_HANDLE_REQUEST, |
| 431 IDS_ERRORPAGES_DETAILS_NOT_IMPLEMENTED, | |
| 432 SUGGEST_NONE, | 389 SUGGEST_NONE, |
| 433 SHOW_NO_BUTTONS, | 390 SHOW_NO_BUTTONS, |
| 434 }, | 391 }, |
| 435 {502, | 392 {502, |
| 436 IDS_ERRORPAGES_TITLE_LOAD_FAILED, | 393 IDS_ERRORPAGES_TITLE_LOAD_FAILED, |
| 437 IDS_ERRORPAGES_HEADING_PAGE_NOT_WORKING, | 394 IDS_ERRORPAGES_HEADING_PAGE_NOT_WORKING, |
| 438 IDS_ERRORPAGES_SUMMARY_WEBSITE_CANNOT_HANDLE_REQUEST, | 395 IDS_ERRORPAGES_SUMMARY_WEBSITE_CANNOT_HANDLE_REQUEST, |
| 439 IDS_ERRORPAGES_DETAILS_BAD_GATEWAY, | |
| 440 SUGGEST_NONE, | 396 SUGGEST_NONE, |
| 441 SHOW_BUTTON_RELOAD, | 397 SHOW_BUTTON_RELOAD, |
| 442 }, | 398 }, |
| 443 {503, | 399 {503, |
| 444 IDS_ERRORPAGES_TITLE_LOAD_FAILED, | 400 IDS_ERRORPAGES_TITLE_LOAD_FAILED, |
| 445 IDS_ERRORPAGES_HEADING_PAGE_NOT_WORKING, | 401 IDS_ERRORPAGES_HEADING_PAGE_NOT_WORKING, |
| 446 IDS_ERRORPAGES_SUMMARY_WEBSITE_CANNOT_HANDLE_REQUEST, | 402 IDS_ERRORPAGES_SUMMARY_WEBSITE_CANNOT_HANDLE_REQUEST, |
| 447 IDS_ERRORPAGES_DETAILS_SERVICE_UNAVAILABLE, | |
| 448 SUGGEST_NONE, | 403 SUGGEST_NONE, |
| 449 SHOW_BUTTON_RELOAD, | 404 SHOW_BUTTON_RELOAD, |
| 450 }, | 405 }, |
| 451 {504, | 406 {504, |
| 452 IDS_ERRORPAGES_TITLE_LOAD_FAILED, | 407 IDS_ERRORPAGES_TITLE_LOAD_FAILED, |
| 453 IDS_ERRORPAGES_HEADING_PAGE_NOT_WORKING, | 408 IDS_ERRORPAGES_HEADING_PAGE_NOT_WORKING, |
| 454 IDS_ERRORPAGES_SUMMARY_GATEWAY_TIMEOUT, | 409 IDS_ERRORPAGES_SUMMARY_GATEWAY_TIMEOUT, |
| 455 IDS_ERRORPAGES_DETAILS_GATEWAY_TIMEOUT, | |
| 456 SUGGEST_NONE, | 410 SUGGEST_NONE, |
| 457 SHOW_BUTTON_RELOAD, | 411 SHOW_BUTTON_RELOAD, |
| 458 }, | 412 }, |
| 459 }; | 413 }; |
| 460 | 414 |
| 461 const LocalizedErrorMap dns_probe_error_options[] = { | 415 const LocalizedErrorMap dns_probe_error_options[] = { |
| 462 {error_page::DNS_PROBE_POSSIBLE, | 416 {error_page::DNS_PROBE_POSSIBLE, |
| 463 IDS_ERRORPAGES_TITLE_NOT_AVAILABLE, | 417 IDS_ERRORPAGES_TITLE_NOT_AVAILABLE, |
| 464 IDS_ERRORPAGES_HEADING_NOT_AVAILABLE, | 418 IDS_ERRORPAGES_HEADING_NOT_AVAILABLE, |
| 465 IDS_ERRORPAGES_SUMMARY_DNS_PROBE_RUNNING, | 419 IDS_ERRORPAGES_SUMMARY_DNS_PROBE_RUNNING, |
| 466 IDS_ERRORPAGES_DETAILS_DNS_PROBE_RUNNING, | |
| 467 SUGGEST_DIAGNOSE_TOOL, | 420 SUGGEST_DIAGNOSE_TOOL, |
| 468 SHOW_BUTTON_RELOAD, | 421 SHOW_BUTTON_RELOAD, |
| 469 }, | 422 }, |
| 470 | 423 |
| 471 // DNS_PROBE_NOT_RUN is not here; NetErrorHelper will restore the original | 424 // DNS_PROBE_NOT_RUN is not here; NetErrorHelper will restore the original |
| 472 // error, which might be one of several DNS-related errors. | 425 // error, which might be one of several DNS-related errors. |
| 473 | 426 |
| 474 {error_page::DNS_PROBE_STARTED, | 427 {error_page::DNS_PROBE_STARTED, |
| 475 IDS_ERRORPAGES_TITLE_NOT_AVAILABLE, | 428 IDS_ERRORPAGES_TITLE_NOT_AVAILABLE, |
| 476 IDS_ERRORPAGES_HEADING_NOT_AVAILABLE, | 429 IDS_ERRORPAGES_HEADING_NOT_AVAILABLE, |
| 477 IDS_ERRORPAGES_SUMMARY_DNS_PROBE_RUNNING, | 430 IDS_ERRORPAGES_SUMMARY_DNS_PROBE_RUNNING, |
| 478 IDS_ERRORPAGES_DETAILS_DNS_PROBE_RUNNING, | |
| 479 // Include SUGGEST_RELOAD so the More button doesn't jump when we update. | 431 // Include SUGGEST_RELOAD so the More button doesn't jump when we update. |
| 480 SUGGEST_DIAGNOSE_TOOL, | 432 SUGGEST_DIAGNOSE_TOOL, |
| 481 SHOW_BUTTON_RELOAD, | 433 SHOW_BUTTON_RELOAD, |
| 482 }, | 434 }, |
| 483 | 435 |
| 484 // DNS_PROBE_FINISHED_UNKNOWN is not here; NetErrorHelper will restore the | 436 // DNS_PROBE_FINISHED_UNKNOWN is not here; NetErrorHelper will restore the |
| 485 // original error, which might be one of several DNS-related errors. | 437 // original error, which might be one of several DNS-related errors. |
| 486 | 438 |
| 487 {error_page::DNS_PROBE_FINISHED_NO_INTERNET, | 439 {error_page::DNS_PROBE_FINISHED_NO_INTERNET, |
| 488 IDS_ERRORPAGES_TITLE_NOT_AVAILABLE, | 440 IDS_ERRORPAGES_TITLE_NOT_AVAILABLE, |
| 489 IDS_ERRORPAGES_HEADING_INTERNET_DISCONNECTED, | 441 IDS_ERRORPAGES_HEADING_INTERNET_DISCONNECTED, |
| 490 kEmptyMessageResourceID, | 442 kEmptyMessageResourceID, |
| 491 IDS_ERRORPAGES_DETAILS_INTERNET_DISCONNECTED, | |
| 492 SUGGEST_OFFLINE_CHECKS | SUGGEST_DIAGNOSE_TOOL, | 443 SUGGEST_OFFLINE_CHECKS | SUGGEST_DIAGNOSE_TOOL, |
| 493 SHOW_NO_BUTTONS, | 444 SHOW_NO_BUTTONS, |
| 494 }, | 445 }, |
| 495 {error_page::DNS_PROBE_FINISHED_BAD_CONFIG, | 446 {error_page::DNS_PROBE_FINISHED_BAD_CONFIG, |
| 496 IDS_ERRORPAGES_TITLE_NOT_AVAILABLE, | 447 IDS_ERRORPAGES_TITLE_NOT_AVAILABLE, |
| 497 IDS_ERRORPAGES_HEADING_NOT_AVAILABLE, | 448 IDS_ERRORPAGES_HEADING_NOT_AVAILABLE, |
| 498 IDS_ERRORPAGES_SUMMARY_NAME_NOT_RESOLVED, | 449 IDS_ERRORPAGES_SUMMARY_NAME_NOT_RESOLVED, |
| 499 IDS_ERRORPAGES_DETAILS_NAME_NOT_RESOLVED, | |
| 500 SUGGEST_DNS_CONFIG | SUGGEST_FIREWALL_CONFIG | SUGGEST_PROXY_CONFIG | | 450 SUGGEST_DNS_CONFIG | SUGGEST_FIREWALL_CONFIG | SUGGEST_PROXY_CONFIG | |
| 501 SUGGEST_DIAGNOSE_TOOL, | 451 SUGGEST_DIAGNOSE_TOOL, |
| 502 SHOW_BUTTON_RELOAD, | 452 SHOW_BUTTON_RELOAD, |
| 503 }, | 453 }, |
| 504 {error_page::DNS_PROBE_FINISHED_NXDOMAIN, | 454 {error_page::DNS_PROBE_FINISHED_NXDOMAIN, |
| 505 IDS_ERRORPAGES_TITLE_NOT_AVAILABLE, | 455 IDS_ERRORPAGES_TITLE_NOT_AVAILABLE, |
| 506 IDS_ERRORPAGES_HEADING_NOT_AVAILABLE, | 456 IDS_ERRORPAGES_HEADING_NOT_AVAILABLE, |
| 507 IDS_ERRORPAGES_SUMMARY_NAME_NOT_RESOLVED, | 457 IDS_ERRORPAGES_SUMMARY_NAME_NOT_RESOLVED, |
| 508 IDS_ERRORPAGES_DETAILS_NAME_NOT_RESOLVED, | |
| 509 SUGGEST_DIAGNOSE_TOOL, | 458 SUGGEST_DIAGNOSE_TOOL, |
| 510 SHOW_BUTTON_RELOAD, | 459 SHOW_BUTTON_RELOAD, |
| 511 }, | 460 }, |
| 512 }; | 461 }; |
| 513 | 462 |
| 514 const LocalizedErrorMap* FindErrorMapInArray(const LocalizedErrorMap* maps, | 463 const LocalizedErrorMap* FindErrorMapInArray(const LocalizedErrorMap* maps, |
| 515 size_t num_maps, | 464 size_t num_maps, |
| 516 int error_code) { | 465 int error_code) { |
| 517 for (size_t i = 0; i < num_maps; ++i) { | 466 for (size_t i = 0; i < num_maps; ++i) { |
| 518 if (maps[i].error_code == error_code) | 467 if (maps[i].error_code == error_code) |
| (...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 923 base::DictionaryValue* error_strings) { | 872 base::DictionaryValue* error_strings) { |
| 924 webui::SetLoadTimeDataDefaults(locale, error_strings); | 873 webui::SetLoadTimeDataDefaults(locale, error_strings); |
| 925 | 874 |
| 926 // Grab the strings and settings that depend on the error type. Init | 875 // Grab the strings and settings that depend on the error type. Init |
| 927 // options with default values. | 876 // options with default values. |
| 928 LocalizedErrorMap options = { | 877 LocalizedErrorMap options = { |
| 929 0, | 878 0, |
| 930 IDS_ERRORPAGES_TITLE_NOT_AVAILABLE, | 879 IDS_ERRORPAGES_TITLE_NOT_AVAILABLE, |
| 931 IDS_ERRORPAGES_HEADING_NOT_AVAILABLE, | 880 IDS_ERRORPAGES_HEADING_NOT_AVAILABLE, |
| 932 IDS_ERRORPAGES_SUMMARY_NOT_AVAILABLE, | 881 IDS_ERRORPAGES_SUMMARY_NOT_AVAILABLE, |
| 933 kEmptyMessageResourceID, | |
| 934 SUGGEST_NONE, | 882 SUGGEST_NONE, |
| 935 SHOW_NO_BUTTONS, | 883 SHOW_NO_BUTTONS, |
| 936 }; | 884 }; |
| 937 | 885 |
| 938 const LocalizedErrorMap* error_map = LookupErrorMap(error_domain, error_code, | 886 const LocalizedErrorMap* error_map = LookupErrorMap(error_domain, error_code, |
| 939 is_post); | 887 is_post); |
| 940 if (error_map) | 888 if (error_map) |
| 941 options = *error_map; | 889 options = *error_map; |
| 942 | 890 |
| 943 // If we got "access denied" but the url was a file URL, then we say it was a | 891 // If we got "access denied" but the url was a file URL, then we say it was a |
| 944 // file instead of just using the "not available" default message. Just adding | 892 // file instead of just using the "not available" default message. Just adding |
| 945 // ERR_ACCESS_DENIED to the map isn't sufficient, since that message may be | 893 // ERR_ACCESS_DENIED to the map isn't sufficient, since that message may be |
| 946 // generated by some OSs when the operation doesn't involve a file URL. | 894 // generated by some OSs when the operation doesn't involve a file URL. |
| 947 if (error_domain == net::kErrorDomain && | 895 if (error_domain == net::kErrorDomain && |
| 948 error_code == net::ERR_ACCESS_DENIED && | 896 error_code == net::ERR_ACCESS_DENIED && |
| 949 failed_url.scheme() == "file") { | 897 failed_url.scheme() == "file") { |
| 950 options.title_resource_id = IDS_ERRORPAGES_TITLE_ACCESS_DENIED; | 898 options.title_resource_id = IDS_ERRORPAGES_TITLE_ACCESS_DENIED; |
| 951 options.heading_resource_id = IDS_ERRORPAGES_HEADING_FILE_ACCESS_DENIED; | 899 options.heading_resource_id = IDS_ERRORPAGES_HEADING_FILE_ACCESS_DENIED; |
| 952 options.summary_resource_id = IDS_ERRORPAGES_SUMMARY_FILE_ACCESS_DENIED; | 900 options.summary_resource_id = IDS_ERRORPAGES_SUMMARY_FILE_ACCESS_DENIED; |
| 953 options.details_resource_id = IDS_ERRORPAGES_DETAILS_FILE_ACCESS_DENIED; | |
| 954 options.suggestions = SUGGEST_NONE; | 901 options.suggestions = SUGGEST_NONE; |
| 955 options.buttons = SHOW_BUTTON_RELOAD; | 902 options.buttons = SHOW_BUTTON_RELOAD; |
| 956 } | 903 } |
| 957 | 904 |
| 958 base::string16 failed_url_string(url_formatter::FormatUrl( | 905 base::string16 failed_url_string(url_formatter::FormatUrl( |
| 959 failed_url, url_formatter::kFormatUrlOmitNothing, | 906 failed_url, url_formatter::kFormatUrlOmitNothing, |
| 960 net::UnescapeRule::NORMAL, nullptr, nullptr, nullptr)); | 907 net::UnescapeRule::NORMAL, nullptr, nullptr, nullptr)); |
| 961 // URLs are always LTR. | 908 // URLs are always LTR. |
| 962 if (base::i18n::IsRTL()) | 909 if (base::i18n::IsRTL()) |
| 963 base::i18n::WrapStringWithLTRFormatting(&failed_url_string); | 910 base::i18n::WrapStringWithLTRFormatting(&failed_url_string); |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1000 summary->SetString("failedUrl", failed_url_string); | 947 summary->SetString("failedUrl", failed_url_string); |
| 1001 summary->SetString("hostName", host_name); | 948 summary->SetString("hostName", host_name); |
| 1002 | 949 |
| 1003 error_strings->SetString( | 950 error_strings->SetString( |
| 1004 "details", l10n_util::GetStringUTF16(IDS_ERRORPAGE_NET_BUTTON_DETAILS)); | 951 "details", l10n_util::GetStringUTF16(IDS_ERRORPAGE_NET_BUTTON_DETAILS)); |
| 1005 error_strings->SetString( | 952 error_strings->SetString( |
| 1006 "hideDetails", l10n_util::GetStringUTF16( | 953 "hideDetails", l10n_util::GetStringUTF16( |
| 1007 IDS_ERRORPAGE_NET_BUTTON_HIDE_DETAILS)); | 954 IDS_ERRORPAGE_NET_BUTTON_HIDE_DETAILS)); |
| 1008 error_strings->Set("summary", summary); | 955 error_strings->Set("summary", summary); |
| 1009 | 956 |
| 1010 error_strings->SetString( | |
| 1011 "errorDetails", | |
| 1012 options.details_resource_id != kEmptyMessageResourceID | |
| 1013 ? l10n_util::GetStringUTF16(options.details_resource_id) | |
| 1014 : base::string16()); | |
| 1015 | |
| 1016 base::string16 error_string; | 957 base::string16 error_string; |
| 1017 if (error_domain == net::kErrorDomain) { | 958 if (error_domain == net::kErrorDomain) { |
| 1018 // Non-internationalized error string, for debugging Chrome itself. | 959 // Non-internationalized error string, for debugging Chrome itself. |
| 1019 error_string = base::ASCIIToUTF16(net::ErrorToShortString(error_code)); | 960 error_string = base::ASCIIToUTF16(net::ErrorToShortString(error_code)); |
| 1020 } else if (error_domain == error_page::kDnsProbeErrorDomain) { | 961 } else if (error_domain == error_page::kDnsProbeErrorDomain) { |
| 1021 std::string ascii_error_string = | 962 std::string ascii_error_string = |
| 1022 error_page::DnsProbeStatusToString(error_code); | 963 error_page::DnsProbeStatusToString(error_code); |
| 1023 error_string = base::ASCIIToUTF16(ascii_error_string); | 964 error_string = base::ASCIIToUTF16(ascii_error_string); |
| 1024 } else { | 965 } else { |
| 1025 DCHECK_EQ(LocalizedError::kHttpErrorDomain, error_domain); | 966 DCHECK_EQ(LocalizedError::kHttpErrorDomain, error_domain); |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1116 error_strings->Set("showSavedCopyButton", show_saved_copy_button); | 1057 error_strings->Set("showSavedCopyButton", show_saved_copy_button); |
| 1117 } | 1058 } |
| 1118 } | 1059 } |
| 1119 | 1060 |
| 1120 base::string16 LocalizedError::GetErrorDetails(const std::string& error_domain, | 1061 base::string16 LocalizedError::GetErrorDetails(const std::string& error_domain, |
| 1121 int error_code, | 1062 int error_code, |
| 1122 bool is_post) { | 1063 bool is_post) { |
| 1123 const LocalizedErrorMap* error_map = | 1064 const LocalizedErrorMap* error_map = |
| 1124 LookupErrorMap(error_domain, error_code, is_post); | 1065 LookupErrorMap(error_domain, error_code, is_post); |
| 1125 if (error_map) | 1066 if (error_map) |
| 1126 return l10n_util::GetStringUTF16(error_map->details_resource_id); | 1067 return l10n_util::GetStringUTF16(error_map->summary_resource_id); |
|
edwardjung
2016/06/23 18:52:04
Do you know where this error string is being used?
| |
| 1127 else | 1068 else |
| 1128 return l10n_util::GetStringUTF16(IDS_ERRORPAGES_DETAILS_UNKNOWN); | 1069 return l10n_util::GetStringUTF16(IDS_ERRORPAGES_DETAILS_UNKNOWN); |
| 1129 } | 1070 } |
| 1130 | 1071 |
| 1131 bool LocalizedError::HasStrings(const std::string& error_domain, | 1072 bool LocalizedError::HasStrings(const std::string& error_domain, |
| 1132 int error_code) { | 1073 int error_code) { |
| 1133 // Whether or not the there are strings for an error does not depend on | 1074 // Whether or not the there are strings for an error does not depend on |
| 1134 // whether or not the page was be generated by a POST, so just claim it was | 1075 // whether or not the page was be generated by a POST, so just claim it was |
| 1135 // not. | 1076 // not. |
| 1136 return LookupErrorMap(error_domain, error_code, /*is_post=*/false) != nullptr; | 1077 return LookupErrorMap(error_domain, error_code, /*is_post=*/false) != nullptr; |
| 1137 } | 1078 } |
| 1138 | 1079 |
| 1139 } // namespace error_page | 1080 } // namespace error_page |
| OLD | NEW |