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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 66 SUGGEST_REPOST_RELOAD = 1 << 12, | 66 SUGGEST_REPOST_RELOAD = 1 << 12, |
| 67 }; | 67 }; |
| 68 | 68 |
| 69 enum SHOW_BUTTONS { | 69 enum SHOW_BUTTONS { |
| 70 SHOW_NO_BUTTONS = 0, | 70 SHOW_NO_BUTTONS = 0, |
| 71 SHOW_BUTTON_RELOAD = 1, | 71 SHOW_BUTTON_RELOAD = 1, |
| 72 }; | 72 }; |
| 73 | 73 |
| 74 struct LocalizedErrorMap { | 74 struct LocalizedErrorMap { |
| 75 int error_code; | 75 int error_code; |
| 76 unsigned int title_resource_id; | |
| 77 unsigned int heading_resource_id; | 76 unsigned int heading_resource_id; |
| 78 // Detailed summary used when the error is in the main frame and shown on | 77 // Detailed summary used when the error is in the main frame and shown on |
| 79 // mouse over when the error is in a frame. | 78 // mouse over when the error is in a frame. |
| 80 unsigned int summary_resource_id; | 79 unsigned int summary_resource_id; |
| 81 int suggestions; // Bitmap of SUGGEST_* values. | 80 int suggestions; // Bitmap of SUGGEST_* values. |
| 82 int buttons; // Which buttons if any to show. | 81 int buttons; // Which buttons if any to show. |
| 83 }; | 82 }; |
| 84 | 83 |
| 85 const LocalizedErrorMap net_error_options[] = { | 84 const LocalizedErrorMap net_error_options[] = { |
| 86 {net::ERR_TIMED_OUT, | 85 {net::ERR_TIMED_OUT, |
| 87 IDS_ERRORPAGES_TITLE_NOT_AVAILABLE, | |
| 88 IDS_ERRORPAGES_HEADING_NOT_AVAILABLE, | 86 IDS_ERRORPAGES_HEADING_NOT_AVAILABLE, |
| 89 IDS_ERRORPAGES_SUMMARY_TIMED_OUT, | 87 IDS_ERRORPAGES_SUMMARY_TIMED_OUT, |
| 90 SUGGEST_CHECK_CONNECTION | SUGGEST_FIREWALL_CONFIG | SUGGEST_PROXY_CONFIG | | 88 SUGGEST_CHECK_CONNECTION | SUGGEST_FIREWALL_CONFIG | SUGGEST_PROXY_CONFIG | |
| 91 SUGGEST_DIAGNOSE_TOOL, | 89 SUGGEST_DIAGNOSE_TOOL, |
| 92 SHOW_BUTTON_RELOAD, | 90 SHOW_BUTTON_RELOAD, |
| 93 }, | 91 }, |
| 94 {net::ERR_CONNECTION_TIMED_OUT, | 92 {net::ERR_CONNECTION_TIMED_OUT, |
| 95 IDS_ERRORPAGES_TITLE_NOT_AVAILABLE, | |
| 96 IDS_ERRORPAGES_HEADING_NOT_AVAILABLE, | 93 IDS_ERRORPAGES_HEADING_NOT_AVAILABLE, |
| 97 IDS_ERRORPAGES_SUMMARY_TIMED_OUT, | 94 IDS_ERRORPAGES_SUMMARY_TIMED_OUT, |
| 98 SUGGEST_CHECK_CONNECTION | SUGGEST_FIREWALL_CONFIG | SUGGEST_PROXY_CONFIG | | 95 SUGGEST_CHECK_CONNECTION | SUGGEST_FIREWALL_CONFIG | SUGGEST_PROXY_CONFIG | |
| 99 SUGGEST_DIAGNOSE_TOOL, | 96 SUGGEST_DIAGNOSE_TOOL, |
| 100 SHOW_BUTTON_RELOAD, | 97 SHOW_BUTTON_RELOAD, |
| 101 }, | 98 }, |
| 102 {net::ERR_CONNECTION_CLOSED, | 99 {net::ERR_CONNECTION_CLOSED, |
| 103 IDS_ERRORPAGES_TITLE_NOT_AVAILABLE, | |
| 104 IDS_ERRORPAGES_HEADING_NOT_AVAILABLE, | 100 IDS_ERRORPAGES_HEADING_NOT_AVAILABLE, |
| 105 IDS_ERRORPAGES_SUMMARY_CONNECTION_CLOSED, | 101 IDS_ERRORPAGES_SUMMARY_CONNECTION_CLOSED, |
| 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_RESET, | 106 {net::ERR_CONNECTION_RESET, |
| 111 IDS_ERRORPAGES_TITLE_NOT_AVAILABLE, | |
| 112 IDS_ERRORPAGES_HEADING_NOT_AVAILABLE, | 107 IDS_ERRORPAGES_HEADING_NOT_AVAILABLE, |
| 113 IDS_ERRORPAGES_SUMMARY_CONNECTION_RESET, | 108 IDS_ERRORPAGES_SUMMARY_CONNECTION_RESET, |
| 114 SUGGEST_CHECK_CONNECTION | SUGGEST_FIREWALL_CONFIG | SUGGEST_PROXY_CONFIG | | 109 SUGGEST_CHECK_CONNECTION | SUGGEST_FIREWALL_CONFIG | SUGGEST_PROXY_CONFIG | |
| 115 SUGGEST_DIAGNOSE_TOOL, | 110 SUGGEST_DIAGNOSE_TOOL, |
| 116 SHOW_BUTTON_RELOAD, | 111 SHOW_BUTTON_RELOAD, |
| 117 }, | 112 }, |
| 118 {net::ERR_CONNECTION_REFUSED, | 113 {net::ERR_CONNECTION_REFUSED, |
| 119 IDS_ERRORPAGES_TITLE_NOT_AVAILABLE, | |
| 120 IDS_ERRORPAGES_HEADING_NOT_AVAILABLE, | 114 IDS_ERRORPAGES_HEADING_NOT_AVAILABLE, |
| 121 IDS_ERRORPAGES_SUMMARY_CONNECTION_REFUSED, | 115 IDS_ERRORPAGES_SUMMARY_CONNECTION_REFUSED, |
| 122 SUGGEST_CHECK_CONNECTION | SUGGEST_FIREWALL_CONFIG | SUGGEST_PROXY_CONFIG, | 116 SUGGEST_CHECK_CONNECTION | SUGGEST_FIREWALL_CONFIG | SUGGEST_PROXY_CONFIG, |
| 123 SHOW_BUTTON_RELOAD, | 117 SHOW_BUTTON_RELOAD, |
| 124 }, | 118 }, |
| 125 {net::ERR_CONNECTION_FAILED, | 119 {net::ERR_CONNECTION_FAILED, |
| 126 IDS_ERRORPAGES_TITLE_NOT_AVAILABLE, | |
| 127 IDS_ERRORPAGES_HEADING_NOT_AVAILABLE, | 120 IDS_ERRORPAGES_HEADING_NOT_AVAILABLE, |
| 128 IDS_ERRORPAGES_SUMMARY_CONNECTION_FAILED, | 121 IDS_ERRORPAGES_SUMMARY_CONNECTION_FAILED, |
| 129 SUGGEST_DIAGNOSE_TOOL, | 122 SUGGEST_DIAGNOSE_TOOL, |
| 130 SHOW_BUTTON_RELOAD, | 123 SHOW_BUTTON_RELOAD, |
| 131 }, | 124 }, |
| 132 {net::ERR_NAME_NOT_RESOLVED, | 125 {net::ERR_NAME_NOT_RESOLVED, |
| 133 IDS_ERRORPAGES_TITLE_NOT_AVAILABLE, | |
| 134 IDS_ERRORPAGES_HEADING_NOT_AVAILABLE, | 126 IDS_ERRORPAGES_HEADING_NOT_AVAILABLE, |
| 135 IDS_ERRORPAGES_SUMMARY_NAME_NOT_RESOLVED, | 127 IDS_ERRORPAGES_SUMMARY_NAME_NOT_RESOLVED, |
| 136 SUGGEST_CHECK_CONNECTION | SUGGEST_DNS_CONFIG | SUGGEST_FIREWALL_CONFIG | | 128 SUGGEST_CHECK_CONNECTION | SUGGEST_DNS_CONFIG | SUGGEST_FIREWALL_CONFIG | |
| 137 SUGGEST_PROXY_CONFIG | SUGGEST_DIAGNOSE_TOOL, | 129 SUGGEST_PROXY_CONFIG | SUGGEST_DIAGNOSE_TOOL, |
| 138 SHOW_BUTTON_RELOAD, | 130 SHOW_BUTTON_RELOAD, |
| 139 }, | 131 }, |
| 140 {net::ERR_ICANN_NAME_COLLISION, | 132 {net::ERR_ICANN_NAME_COLLISION, |
| 141 IDS_ERRORPAGES_TITLE_NOT_AVAILABLE, | |
| 142 IDS_ERRORPAGES_HEADING_NOT_AVAILABLE, | 133 IDS_ERRORPAGES_HEADING_NOT_AVAILABLE, |
| 143 IDS_ERRORPAGES_SUMMARY_ICANN_NAME_COLLISION, | 134 IDS_ERRORPAGES_SUMMARY_ICANN_NAME_COLLISION, |
| 144 SUGGEST_NONE, | 135 SUGGEST_NONE, |
| 145 SHOW_NO_BUTTONS, | 136 SHOW_NO_BUTTONS, |
| 146 }, | 137 }, |
| 147 {net::ERR_ADDRESS_UNREACHABLE, | 138 {net::ERR_ADDRESS_UNREACHABLE, |
| 148 IDS_ERRORPAGES_TITLE_NOT_AVAILABLE, | |
| 149 IDS_ERRORPAGES_HEADING_NOT_AVAILABLE, | 139 IDS_ERRORPAGES_HEADING_NOT_AVAILABLE, |
| 150 IDS_ERRORPAGES_SUMMARY_ADDRESS_UNREACHABLE, | 140 IDS_ERRORPAGES_SUMMARY_ADDRESS_UNREACHABLE, |
| 151 SUGGEST_DIAGNOSE_TOOL, | 141 SUGGEST_DIAGNOSE_TOOL, |
| 152 SHOW_BUTTON_RELOAD, | 142 SHOW_BUTTON_RELOAD, |
| 153 }, | 143 }, |
| 154 {net::ERR_NETWORK_ACCESS_DENIED, | 144 {net::ERR_NETWORK_ACCESS_DENIED, |
| 155 IDS_ERRORPAGES_TITLE_NOT_AVAILABLE, | |
| 156 IDS_ERRORPAGES_HEADING_NETWORK_ACCESS_DENIED, | 145 IDS_ERRORPAGES_HEADING_NETWORK_ACCESS_DENIED, |
| 157 IDS_ERRORPAGES_SUMMARY_NETWORK_ACCESS_DENIED, | 146 IDS_ERRORPAGES_SUMMARY_NETWORK_ACCESS_DENIED, |
| 158 SUGGEST_CHECK_CONNECTION | SUGGEST_FIREWALL_CONFIG | | 147 SUGGEST_CHECK_CONNECTION | SUGGEST_FIREWALL_CONFIG | |
| 159 SUGGEST_ANTIVIRUS_CONFIG | SUGGEST_DIAGNOSE_TOOL, | 148 SUGGEST_ANTIVIRUS_CONFIG | SUGGEST_DIAGNOSE_TOOL, |
| 160 SHOW_NO_BUTTONS, | 149 SHOW_NO_BUTTONS, |
| 161 }, | 150 }, |
| 162 {net::ERR_PROXY_CONNECTION_FAILED, | 151 {net::ERR_PROXY_CONNECTION_FAILED, |
| 163 IDS_ERRORPAGES_TITLE_NOT_AVAILABLE, | |
| 164 IDS_ERRORPAGES_HEADING_INTERNET_DISCONNECTED, | 152 IDS_ERRORPAGES_HEADING_INTERNET_DISCONNECTED, |
| 165 IDS_ERRORPAGES_SUMMARY_PROXY_CONNECTION_FAILED, | 153 IDS_ERRORPAGES_SUMMARY_PROXY_CONNECTION_FAILED, |
| 166 SUGGEST_PROXY_CONFIG | SUGGEST_CONTACT_ADMINISTRATOR | SUGGEST_DIAGNOSE_TOOL, | 154 SUGGEST_PROXY_CONFIG | SUGGEST_CONTACT_ADMINISTRATOR | SUGGEST_DIAGNOSE_TOOL, |
| 167 SHOW_NO_BUTTONS, | 155 SHOW_NO_BUTTONS, |
| 168 }, | 156 }, |
| 169 {net::ERR_INTERNET_DISCONNECTED, | 157 {net::ERR_INTERNET_DISCONNECTED, |
| 170 IDS_ERRORPAGES_TITLE_NOT_AVAILABLE, | |
| 171 IDS_ERRORPAGES_HEADING_INTERNET_DISCONNECTED, | 158 IDS_ERRORPAGES_HEADING_INTERNET_DISCONNECTED, |
| 172 IDS_ERRORPAGES_HEADING_INTERNET_DISCONNECTED, | 159 IDS_ERRORPAGES_HEADING_INTERNET_DISCONNECTED, |
| 173 SUGGEST_OFFLINE_CHECKS | SUGGEST_DIAGNOSE_TOOL, | 160 SUGGEST_OFFLINE_CHECKS | SUGGEST_DIAGNOSE_TOOL, |
| 174 SHOW_NO_BUTTONS, | 161 SHOW_NO_BUTTONS, |
| 175 }, | 162 }, |
| 176 {net::ERR_FILE_NOT_FOUND, | 163 {net::ERR_FILE_NOT_FOUND, |
| 177 IDS_ERRORPAGES_TITLE_LOAD_FAILED, | |
| 178 IDS_ERRORPAGES_HEADING_FILE_NOT_FOUND, | 164 IDS_ERRORPAGES_HEADING_FILE_NOT_FOUND, |
| 179 IDS_ERRORPAGES_SUMMARY_FILE_NOT_FOUND, | 165 IDS_ERRORPAGES_SUMMARY_FILE_NOT_FOUND, |
| 180 SUGGEST_NONE, | 166 SUGGEST_NONE, |
| 181 SHOW_NO_BUTTONS, | 167 SHOW_NO_BUTTONS, |
| 182 }, | 168 }, |
| 183 {net::ERR_CACHE_MISS, | 169 {net::ERR_CACHE_MISS, |
| 184 IDS_ERRORPAGES_TITLE_LOAD_FAILED, | |
| 185 IDS_ERRORPAGES_HEADING_CACHE_READ_FAILURE, | 170 IDS_ERRORPAGES_HEADING_CACHE_READ_FAILURE, |
| 186 IDS_ERRORPAGES_SUMMARY_CACHE_READ_FAILURE, | 171 IDS_ERRORPAGES_SUMMARY_CACHE_READ_FAILURE, |
| 187 SUGGEST_NONE, | 172 SUGGEST_NONE, |
| 188 SHOW_BUTTON_RELOAD, | 173 SHOW_BUTTON_RELOAD, |
| 189 }, | 174 }, |
| 190 {net::ERR_CACHE_READ_FAILURE, | 175 {net::ERR_CACHE_READ_FAILURE, |
| 191 IDS_ERRORPAGES_TITLE_LOAD_FAILED, | |
| 192 IDS_ERRORPAGES_HEADING_CACHE_READ_FAILURE, | 176 IDS_ERRORPAGES_HEADING_CACHE_READ_FAILURE, |
| 193 IDS_ERRORPAGES_SUMMARY_CACHE_READ_FAILURE, | 177 IDS_ERRORPAGES_SUMMARY_CACHE_READ_FAILURE, |
| 194 SUGGEST_NONE, | 178 SUGGEST_NONE, |
| 195 SHOW_BUTTON_RELOAD, | 179 SHOW_BUTTON_RELOAD, |
| 196 }, | 180 }, |
| 197 {net::ERR_NETWORK_IO_SUSPENDED, | 181 {net::ERR_NETWORK_IO_SUSPENDED, |
| 198 IDS_ERRORPAGES_TITLE_LOAD_FAILED, | |
| 199 IDS_ERRORPAGES_HEADING_CONNECTION_INTERRUPTED, | 182 IDS_ERRORPAGES_HEADING_CONNECTION_INTERRUPTED, |
| 200 IDS_ERRORPAGES_SUMMARY_NETWORK_IO_SUSPENDED, | 183 IDS_ERRORPAGES_SUMMARY_NETWORK_IO_SUSPENDED, |
| 201 SUGGEST_NONE, | 184 SUGGEST_NONE, |
| 202 SHOW_BUTTON_RELOAD, | 185 SHOW_BUTTON_RELOAD, |
| 203 }, | 186 }, |
| 204 {net::ERR_TOO_MANY_REDIRECTS, | 187 {net::ERR_TOO_MANY_REDIRECTS, |
| 205 IDS_ERRORPAGES_TITLE_LOAD_FAILED, | |
| 206 IDS_ERRORPAGES_HEADING_PAGE_NOT_WORKING, | 188 IDS_ERRORPAGES_HEADING_PAGE_NOT_WORKING, |
| 207 IDS_ERRORPAGES_SUMMARY_TOO_MANY_REDIRECTS, | 189 IDS_ERRORPAGES_SUMMARY_TOO_MANY_REDIRECTS, |
| 208 SUGGEST_LEARNMORE, | 190 SUGGEST_LEARNMORE, |
| 209 SHOW_BUTTON_RELOAD, | 191 SHOW_BUTTON_RELOAD, |
| 210 }, | 192 }, |
| 211 {net::ERR_EMPTY_RESPONSE, | 193 {net::ERR_EMPTY_RESPONSE, |
| 212 IDS_ERRORPAGES_TITLE_LOAD_FAILED, | |
| 213 IDS_ERRORPAGES_HEADING_PAGE_NOT_WORKING, | 194 IDS_ERRORPAGES_HEADING_PAGE_NOT_WORKING, |
| 214 IDS_ERRORPAGES_SUMMARY_EMPTY_RESPONSE, | 195 IDS_ERRORPAGES_SUMMARY_EMPTY_RESPONSE, |
| 215 SUGGEST_NONE, | 196 SUGGEST_NONE, |
| 216 SHOW_BUTTON_RELOAD, | 197 SHOW_BUTTON_RELOAD, |
| 217 }, | 198 }, |
| 218 {net::ERR_RESPONSE_HEADERS_MULTIPLE_CONTENT_LENGTH, | 199 {net::ERR_RESPONSE_HEADERS_MULTIPLE_CONTENT_LENGTH, |
| 219 IDS_ERRORPAGES_TITLE_LOAD_FAILED, | |
| 220 IDS_ERRORPAGES_HEADING_PAGE_NOT_WORKING, | 200 IDS_ERRORPAGES_HEADING_PAGE_NOT_WORKING, |
| 221 IDS_ERRORPAGES_SUMMARY_INVALID_RESPONSE, | 201 IDS_ERRORPAGES_SUMMARY_INVALID_RESPONSE, |
| 222 SUGGEST_NONE, | 202 SUGGEST_NONE, |
| 223 SHOW_BUTTON_RELOAD, | 203 SHOW_BUTTON_RELOAD, |
| 224 }, | 204 }, |
| 225 {net::ERR_RESPONSE_HEADERS_MULTIPLE_CONTENT_DISPOSITION, | 205 {net::ERR_RESPONSE_HEADERS_MULTIPLE_CONTENT_DISPOSITION, |
| 226 IDS_ERRORPAGES_TITLE_LOAD_FAILED, | |
| 227 IDS_ERRORPAGES_HEADING_PAGE_NOT_WORKING, | 206 IDS_ERRORPAGES_HEADING_PAGE_NOT_WORKING, |
| 228 IDS_ERRORPAGES_SUMMARY_INVALID_RESPONSE, | 207 IDS_ERRORPAGES_SUMMARY_INVALID_RESPONSE, |
| 229 SUGGEST_NONE, | 208 SUGGEST_NONE, |
| 230 SHOW_BUTTON_RELOAD, | 209 SHOW_BUTTON_RELOAD, |
| 231 }, | 210 }, |
| 232 {net::ERR_RESPONSE_HEADERS_MULTIPLE_LOCATION, | 211 {net::ERR_RESPONSE_HEADERS_MULTIPLE_LOCATION, |
| 233 IDS_ERRORPAGES_TITLE_LOAD_FAILED, | |
| 234 IDS_ERRORPAGES_HEADING_PAGE_NOT_WORKING, | 212 IDS_ERRORPAGES_HEADING_PAGE_NOT_WORKING, |
| 235 IDS_ERRORPAGES_SUMMARY_INVALID_RESPONSE, | 213 IDS_ERRORPAGES_SUMMARY_INVALID_RESPONSE, |
| 236 SUGGEST_NONE, | 214 SUGGEST_NONE, |
| 237 SHOW_BUTTON_RELOAD, | 215 SHOW_BUTTON_RELOAD, |
| 238 }, | 216 }, |
| 239 {net::ERR_INVALID_HTTP_RESPONSE, | 217 {net::ERR_INVALID_HTTP_RESPONSE, |
| 240 IDS_ERRORPAGES_TITLE_LOAD_FAILED, | |
| 241 IDS_ERRORPAGES_HEADING_PAGE_NOT_WORKING, | 218 IDS_ERRORPAGES_HEADING_PAGE_NOT_WORKING, |
| 242 IDS_ERRORPAGES_SUMMARY_INVALID_RESPONSE, | 219 IDS_ERRORPAGES_SUMMARY_INVALID_RESPONSE, |
| 243 SUGGEST_NONE, | 220 SUGGEST_NONE, |
| 244 SHOW_BUTTON_RELOAD, | 221 SHOW_BUTTON_RELOAD, |
| 245 }, | 222 }, |
| 246 {net::ERR_CONTENT_LENGTH_MISMATCH, | 223 {net::ERR_CONTENT_LENGTH_MISMATCH, |
| 247 IDS_ERRORPAGES_TITLE_NOT_AVAILABLE, | |
| 248 IDS_ERRORPAGES_HEADING_PAGE_NOT_WORKING, | 224 IDS_ERRORPAGES_HEADING_PAGE_NOT_WORKING, |
| 249 IDS_ERRORPAGES_SUMMARY_CONNECTION_CLOSED, | 225 IDS_ERRORPAGES_SUMMARY_CONNECTION_CLOSED, |
| 250 SUGGEST_NONE, | 226 SUGGEST_NONE, |
| 251 SHOW_BUTTON_RELOAD, | 227 SHOW_BUTTON_RELOAD, |
| 252 }, | 228 }, |
| 253 {net::ERR_INCOMPLETE_CHUNKED_ENCODING, | 229 {net::ERR_INCOMPLETE_CHUNKED_ENCODING, |
| 254 IDS_ERRORPAGES_TITLE_NOT_AVAILABLE, | |
| 255 IDS_ERRORPAGES_HEADING_PAGE_NOT_WORKING, | 230 IDS_ERRORPAGES_HEADING_PAGE_NOT_WORKING, |
| 256 IDS_ERRORPAGES_SUMMARY_CONNECTION_CLOSED, | 231 IDS_ERRORPAGES_SUMMARY_CONNECTION_CLOSED, |
| 257 SUGGEST_NONE, | 232 SUGGEST_NONE, |
| 258 SHOW_BUTTON_RELOAD, | 233 SHOW_BUTTON_RELOAD, |
| 259 }, | 234 }, |
| 260 {net::ERR_SSL_PROTOCOL_ERROR, | 235 {net::ERR_SSL_PROTOCOL_ERROR, |
| 261 IDS_ERRORPAGES_TITLE_LOAD_FAILED, | |
| 262 IDS_ERRORPAGES_HEADING_INSECURE_CONNECTION, | 236 IDS_ERRORPAGES_HEADING_INSECURE_CONNECTION, |
| 263 IDS_ERRORPAGES_SUMMARY_INVALID_RESPONSE, | 237 IDS_ERRORPAGES_SUMMARY_INVALID_RESPONSE, |
| 264 SUGGEST_DIAGNOSE_TOOL, | 238 SUGGEST_DIAGNOSE_TOOL, |
| 265 SHOW_BUTTON_RELOAD, | 239 SHOW_BUTTON_RELOAD, |
| 266 }, | 240 }, |
| 267 {net::ERR_BAD_SSL_CLIENT_AUTH_CERT, | 241 {net::ERR_BAD_SSL_CLIENT_AUTH_CERT, |
| 268 IDS_ERRORPAGES_TITLE_LOAD_FAILED, | |
| 269 IDS_ERRORPAGES_HEADING_INSECURE_CONNECTION, | 242 IDS_ERRORPAGES_HEADING_INSECURE_CONNECTION, |
| 270 IDS_ERRORPAGES_SUMMARY_BAD_SSL_CLIENT_AUTH_CERT, | 243 IDS_ERRORPAGES_SUMMARY_BAD_SSL_CLIENT_AUTH_CERT, |
| 271 SUGGEST_CONTACT_ADMINISTRATOR, | 244 SUGGEST_CONTACT_ADMINISTRATOR, |
| 272 SHOW_NO_BUTTONS, | 245 SHOW_NO_BUTTONS, |
| 273 }, | 246 }, |
| 274 {net::ERR_SSL_WEAK_SERVER_EPHEMERAL_DH_KEY, | 247 {net::ERR_SSL_WEAK_SERVER_EPHEMERAL_DH_KEY, |
| 275 IDS_ERRORPAGES_TITLE_LOAD_FAILED, | |
| 276 IDS_ERRORPAGES_HEADING_INSECURE_CONNECTION, | 248 IDS_ERRORPAGES_HEADING_INSECURE_CONNECTION, |
| 277 IDS_ERRORPAGES_SUMMARY_SSL_SECURITY_ERROR, | 249 IDS_ERRORPAGES_SUMMARY_SSL_SECURITY_ERROR, |
| 278 SUGGEST_LEARNMORE, | 250 SUGGEST_LEARNMORE, |
| 279 SHOW_NO_BUTTONS, | 251 SHOW_NO_BUTTONS, |
| 280 }, | 252 }, |
| 281 {net::ERR_SSL_PINNED_KEY_NOT_IN_CERT_CHAIN, | 253 {net::ERR_SSL_PINNED_KEY_NOT_IN_CERT_CHAIN, |
| 282 IDS_ERRORPAGES_TITLE_LOAD_FAILED, | |
| 283 IDS_ERRORPAGES_HEADING_INSECURE_CONNECTION, | 254 IDS_ERRORPAGES_HEADING_INSECURE_CONNECTION, |
| 284 IDS_CERT_ERROR_SUMMARY_PINNING_FAILURE_DETAILS, | 255 IDS_CERT_ERROR_SUMMARY_PINNING_FAILURE_DETAILS, |
| 285 SUGGEST_NONE, | 256 SUGGEST_NONE, |
| 286 SHOW_NO_BUTTONS, | 257 SHOW_NO_BUTTONS, |
| 287 }, | 258 }, |
| 288 {net::ERR_TEMPORARILY_THROTTLED, | 259 {net::ERR_TEMPORARILY_THROTTLED, |
| 289 IDS_ERRORPAGES_TITLE_ACCESS_DENIED, | |
| 290 IDS_ERRORPAGES_HEADING_NOT_AVAILABLE, | 260 IDS_ERRORPAGES_HEADING_NOT_AVAILABLE, |
| 291 IDS_ERRORPAGES_SUMMARY_NOT_AVAILABLE, | 261 IDS_ERRORPAGES_SUMMARY_NOT_AVAILABLE, |
| 292 SUGGEST_DISABLE_EXTENSION, | 262 SUGGEST_DISABLE_EXTENSION, |
| 293 SHOW_NO_BUTTONS, | 263 SHOW_NO_BUTTONS, |
| 294 }, | 264 }, |
| 295 {net::ERR_BLOCKED_BY_CLIENT, | 265 {net::ERR_BLOCKED_BY_CLIENT, |
| 296 IDS_ERRORPAGES_TITLE_BLOCKED, | |
| 297 IDS_ERRORPAGES_HEADING_BLOCKED, | 266 IDS_ERRORPAGES_HEADING_BLOCKED, |
| 298 IDS_ERRORPAGES_SUMMARY_BLOCKED_BY_EXTENSION, | 267 IDS_ERRORPAGES_SUMMARY_BLOCKED_BY_EXTENSION, |
| 299 SUGGEST_DISABLE_EXTENSION, | 268 SUGGEST_DISABLE_EXTENSION, |
| 300 SHOW_BUTTON_RELOAD, | 269 SHOW_BUTTON_RELOAD, |
| 301 }, | 270 }, |
| 302 {net::ERR_NETWORK_CHANGED, | 271 {net::ERR_NETWORK_CHANGED, |
| 303 IDS_ERRORPAGES_TITLE_LOAD_FAILED, | |
| 304 IDS_ERRORPAGES_HEADING_CONNECTION_INTERRUPTED, | 272 IDS_ERRORPAGES_HEADING_CONNECTION_INTERRUPTED, |
| 305 IDS_ERRORPAGES_SUMMARY_NETWORK_CHANGED, | 273 IDS_ERRORPAGES_SUMMARY_NETWORK_CHANGED, |
| 306 SUGGEST_NONE, | 274 SUGGEST_NONE, |
| 307 SHOW_BUTTON_RELOAD, | 275 SHOW_BUTTON_RELOAD, |
| 308 }, | 276 }, |
| 309 {net::ERR_BLOCKED_BY_ADMINISTRATOR, | 277 {net::ERR_BLOCKED_BY_ADMINISTRATOR, |
| 310 IDS_ERRORPAGES_TITLE_BLOCKED, | |
| 311 IDS_ERRORPAGES_HEADING_BLOCKED, | 278 IDS_ERRORPAGES_HEADING_BLOCKED, |
| 312 IDS_ERRORPAGES_SUMMARY_BLOCKED_BY_ADMINISTRATOR, | 279 IDS_ERRORPAGES_SUMMARY_BLOCKED_BY_ADMINISTRATOR, |
| 313 SUGGEST_CONTACT_ADMINISTRATOR, | 280 SUGGEST_CONTACT_ADMINISTRATOR, |
| 314 SHOW_NO_BUTTONS, | 281 SHOW_NO_BUTTONS, |
| 315 }, | 282 }, |
| 316 {net::ERR_BLOCKED_ENROLLMENT_CHECK_PENDING, | 283 {net::ERR_BLOCKED_ENROLLMENT_CHECK_PENDING, |
| 317 IDS_ERRORPAGES_TITLE_BLOCKED, | |
| 318 IDS_ERRORPAGES_HEADING_INTERNET_DISCONNECTED, | 284 IDS_ERRORPAGES_HEADING_INTERNET_DISCONNECTED, |
| 319 IDS_ERRORPAGES_SUMMARY_BLOCKED_ENROLLMENT_CHECK_PENDING, | 285 IDS_ERRORPAGES_SUMMARY_BLOCKED_ENROLLMENT_CHECK_PENDING, |
| 320 SUGGEST_COMPLETE_SETUP, | 286 SUGGEST_COMPLETE_SETUP, |
| 321 SHOW_NO_BUTTONS, | 287 SHOW_NO_BUTTONS, |
| 322 }, | 288 }, |
| 323 {net::ERR_SSL_FALLBACK_BEYOND_MINIMUM_VERSION, | 289 {net::ERR_SSL_FALLBACK_BEYOND_MINIMUM_VERSION, |
| 324 IDS_ERRORPAGES_TITLE_LOAD_FAILED, | |
| 325 IDS_ERRORPAGES_HEADING_INSECURE_CONNECTION, | 290 IDS_ERRORPAGES_HEADING_INSECURE_CONNECTION, |
| 326 IDS_ERRORPAGES_SUMMARY_INVALID_RESPONSE, | 291 IDS_ERRORPAGES_SUMMARY_INVALID_RESPONSE, |
| 327 SUGGEST_NONE, | 292 SUGGEST_NONE, |
| 328 SHOW_NO_BUTTONS, | 293 SHOW_NO_BUTTONS, |
| 329 }, | 294 }, |
| 330 {net::ERR_SSL_VERSION_OR_CIPHER_MISMATCH, | 295 {net::ERR_SSL_VERSION_OR_CIPHER_MISMATCH, |
| 331 IDS_ERRORPAGES_TITLE_LOAD_FAILED, | |
| 332 IDS_ERRORPAGES_HEADING_INSECURE_CONNECTION, | 296 IDS_ERRORPAGES_HEADING_INSECURE_CONNECTION, |
| 333 IDS_ERRORPAGES_SUMMARY_SSL_VERSION_OR_CIPHER_MISMATCH, | 297 IDS_ERRORPAGES_SUMMARY_SSL_VERSION_OR_CIPHER_MISMATCH, |
| 334 SUGGEST_UNSUPPORTED_CIPHER, | 298 SUGGEST_UNSUPPORTED_CIPHER, |
| 335 SHOW_NO_BUTTONS, | 299 SHOW_NO_BUTTONS, |
| 336 }, | 300 }, |
| 337 {net::ERR_SSL_OBSOLETE_CIPHER, | 301 {net::ERR_SSL_OBSOLETE_CIPHER, |
| 338 IDS_ERRORPAGES_TITLE_LOAD_FAILED, | |
| 339 IDS_ERRORPAGES_HEADING_INSECURE_CONNECTION, | 302 IDS_ERRORPAGES_HEADING_INSECURE_CONNECTION, |
| 340 IDS_ERRORPAGES_SUMMARY_SSL_VERSION_OR_CIPHER_MISMATCH, | 303 IDS_ERRORPAGES_SUMMARY_SSL_VERSION_OR_CIPHER_MISMATCH, |
| 341 SUGGEST_UNSUPPORTED_CIPHER, | 304 SUGGEST_UNSUPPORTED_CIPHER, |
| 342 SHOW_NO_BUTTONS, | 305 SHOW_NO_BUTTONS, |
| 343 }, | 306 }, |
| 344 {net::ERR_TEMPORARY_BACKOFF, | 307 {net::ERR_TEMPORARY_BACKOFF, |
| 345 IDS_ERRORPAGES_TITLE_ACCESS_DENIED, | |
| 346 IDS_ERRORPAGES_HEADING_ACCESS_DENIED, | 308 IDS_ERRORPAGES_HEADING_ACCESS_DENIED, |
| 347 IDS_ERRORPAGES_SUMMARY_TEMPORARY_BACKOFF, | 309 IDS_ERRORPAGES_SUMMARY_TEMPORARY_BACKOFF, |
| 348 SUGGEST_NONE, | 310 SUGGEST_NONE, |
| 349 SHOW_NO_BUTTONS, | 311 SHOW_NO_BUTTONS, |
| 350 }, | 312 }, |
| 351 {net::ERR_SSL_SERVER_CERT_BAD_FORMAT, | 313 {net::ERR_SSL_SERVER_CERT_BAD_FORMAT, |
| 352 IDS_ERRORPAGES_TITLE_LOAD_FAILED, | |
| 353 IDS_ERRORPAGES_HEADING_INSECURE_CONNECTION, | 314 IDS_ERRORPAGES_HEADING_INSECURE_CONNECTION, |
| 354 IDS_ERRORPAGES_SUMMARY_SSL_SECURITY_ERROR, | 315 IDS_ERRORPAGES_SUMMARY_SSL_SECURITY_ERROR, |
| 355 SUGGEST_NONE, | 316 SUGGEST_NONE, |
| 356 SHOW_NO_BUTTONS, | 317 SHOW_NO_BUTTONS, |
| 357 }, | 318 }, |
| 358 }; | 319 }; |
| 359 | 320 |
| 360 // Special error page to be used in the case of navigating back to a page | 321 // Special error page to be used in the case of navigating back to a page |
| 361 // generated by a POST. LocalizedError::HasStrings expects this net error code | 322 // generated by a POST. LocalizedError::HasStrings expects this net error code |
| 362 // to also appear in the array above. | 323 // to also appear in the array above. |
| 363 const LocalizedErrorMap repost_error = { | 324 const LocalizedErrorMap repost_error = { |
| 364 net::ERR_CACHE_MISS, | 325 net::ERR_CACHE_MISS, |
| 365 IDS_ERRORPAGES_TITLE_NOT_AVAILABLE, | |
| 366 IDS_HTTP_POST_WARNING_TITLE, | 326 IDS_HTTP_POST_WARNING_TITLE, |
| 367 IDS_ERRORPAGES_HTTP_POST_WARNING, | 327 IDS_ERRORPAGES_HTTP_POST_WARNING, |
| 368 SUGGEST_REPOST_RELOAD, | 328 SUGGEST_REPOST_RELOAD, |
| 369 SHOW_NO_BUTTONS, | 329 SHOW_NO_BUTTONS, |
| 370 }; | 330 }; |
| 371 | 331 |
| 372 const LocalizedErrorMap http_error_options[] = { | 332 const LocalizedErrorMap http_error_options[] = { |
| 373 { | 333 { |
| 374 403, IDS_ERRORPAGES_TITLE_ACCESS_DENIED, | 334 403, IDS_ERRORPAGES_HEADING_ACCESS_DENIED, |
| 375 IDS_ERRORPAGES_HEADING_ACCESS_DENIED, IDS_ERRORPAGES_SUMMARY_FORBIDDEN, | 335 IDS_ERRORPAGES_SUMMARY_FORBIDDEN, SUGGEST_NONE, SHOW_BUTTON_RELOAD, |
| 336 }, | |
| 337 { | |
| 338 404, IDS_ERRORPAGES_HEADING_NOT_FOUND, IDS_ERRORPAGES_SUMMARY_NOT_FOUND, | |
| 376 SUGGEST_NONE, SHOW_BUTTON_RELOAD, | 339 SUGGEST_NONE, SHOW_BUTTON_RELOAD, |
| 377 }, | 340 }, |
| 378 { | 341 { |
| 379 404, IDS_ERRORPAGES_TITLE_NOT_FOUND, IDS_ERRORPAGES_HEADING_NOT_FOUND, | 342 410, IDS_ERRORPAGES_HEADING_NOT_FOUND, IDS_ERRORPAGES_SUMMARY_GONE, |
| 380 IDS_ERRORPAGES_SUMMARY_NOT_FOUND, SUGGEST_NONE, SHOW_BUTTON_RELOAD, | 343 SUGGEST_NONE, SHOW_NO_BUTTONS, |
| 381 }, | |
| 382 { | |
| 383 410, IDS_ERRORPAGES_TITLE_NOT_FOUND, IDS_ERRORPAGES_HEADING_NOT_FOUND, | |
| 384 IDS_ERRORPAGES_SUMMARY_GONE, SUGGEST_NONE, SHOW_NO_BUTTONS, | |
| 385 }, | 344 }, |
| 386 | 345 |
| 387 { | 346 { |
| 388 500, IDS_ERRORPAGES_TITLE_LOAD_FAILED, | 347 500, IDS_ERRORPAGES_HEADING_PAGE_NOT_WORKING, |
| 389 IDS_ERRORPAGES_HEADING_PAGE_NOT_WORKING, | |
| 390 IDS_ERRORPAGES_SUMMARY_WEBSITE_CANNOT_HANDLE_REQUEST, SUGGEST_NONE, | 348 IDS_ERRORPAGES_SUMMARY_WEBSITE_CANNOT_HANDLE_REQUEST, SUGGEST_NONE, |
| 391 SHOW_BUTTON_RELOAD, | 349 SHOW_BUTTON_RELOAD, |
| 392 }, | 350 }, |
| 393 { | 351 { |
| 394 501, IDS_ERRORPAGES_TITLE_LOAD_FAILED, | 352 501, IDS_ERRORPAGES_HEADING_PAGE_NOT_WORKING, |
| 395 IDS_ERRORPAGES_HEADING_PAGE_NOT_WORKING, | |
| 396 IDS_ERRORPAGES_SUMMARY_WEBSITE_CANNOT_HANDLE_REQUEST, SUGGEST_NONE, | 353 IDS_ERRORPAGES_SUMMARY_WEBSITE_CANNOT_HANDLE_REQUEST, SUGGEST_NONE, |
| 397 SHOW_NO_BUTTONS, | 354 SHOW_NO_BUTTONS, |
| 398 }, | 355 }, |
| 399 { | 356 { |
| 400 502, IDS_ERRORPAGES_TITLE_LOAD_FAILED, | 357 502, IDS_ERRORPAGES_HEADING_PAGE_NOT_WORKING, |
| 401 IDS_ERRORPAGES_HEADING_PAGE_NOT_WORKING, | |
| 402 IDS_ERRORPAGES_SUMMARY_WEBSITE_CANNOT_HANDLE_REQUEST, SUGGEST_NONE, | 358 IDS_ERRORPAGES_SUMMARY_WEBSITE_CANNOT_HANDLE_REQUEST, SUGGEST_NONE, |
| 403 SHOW_BUTTON_RELOAD, | 359 SHOW_BUTTON_RELOAD, |
| 404 }, | 360 }, |
| 405 { | 361 { |
| 406 503, IDS_ERRORPAGES_TITLE_LOAD_FAILED, | 362 503, IDS_ERRORPAGES_HEADING_PAGE_NOT_WORKING, |
| 407 IDS_ERRORPAGES_HEADING_PAGE_NOT_WORKING, | |
| 408 IDS_ERRORPAGES_SUMMARY_WEBSITE_CANNOT_HANDLE_REQUEST, SUGGEST_NONE, | 363 IDS_ERRORPAGES_SUMMARY_WEBSITE_CANNOT_HANDLE_REQUEST, SUGGEST_NONE, |
| 409 SHOW_BUTTON_RELOAD, | 364 SHOW_BUTTON_RELOAD, |
| 410 }, | 365 }, |
| 411 { | 366 { |
| 412 504, IDS_ERRORPAGES_TITLE_LOAD_FAILED, | 367 504, IDS_ERRORPAGES_HEADING_PAGE_NOT_WORKING, |
| 413 IDS_ERRORPAGES_HEADING_PAGE_NOT_WORKING, | |
| 414 IDS_ERRORPAGES_SUMMARY_GATEWAY_TIMEOUT, SUGGEST_NONE, | 368 IDS_ERRORPAGES_SUMMARY_GATEWAY_TIMEOUT, SUGGEST_NONE, |
| 415 SHOW_BUTTON_RELOAD, | 369 SHOW_BUTTON_RELOAD, |
| 416 }, | 370 }, |
| 417 }; | 371 }; |
| 418 | 372 |
| 419 const LocalizedErrorMap dns_probe_error_options[] = { | 373 const LocalizedErrorMap dns_probe_error_options[] = { |
| 420 {error_page::DNS_PROBE_POSSIBLE, | 374 {error_page::DNS_PROBE_POSSIBLE, |
| 421 IDS_ERRORPAGES_TITLE_NOT_AVAILABLE, | |
| 422 IDS_ERRORPAGES_HEADING_NOT_AVAILABLE, | 375 IDS_ERRORPAGES_HEADING_NOT_AVAILABLE, |
| 423 IDS_ERRORPAGES_SUMMARY_DNS_PROBE_RUNNING, | 376 IDS_ERRORPAGES_SUMMARY_DNS_PROBE_RUNNING, |
| 424 SUGGEST_DIAGNOSE_TOOL, | 377 SUGGEST_DIAGNOSE_TOOL, |
| 425 SHOW_BUTTON_RELOAD, | 378 SHOW_BUTTON_RELOAD, |
| 426 }, | 379 }, |
| 427 | 380 |
| 428 // DNS_PROBE_NOT_RUN is not here; NetErrorHelper will restore the original | 381 // DNS_PROBE_NOT_RUN is not here; NetErrorHelper will restore the original |
| 429 // error, which might be one of several DNS-related errors. | 382 // error, which might be one of several DNS-related errors. |
| 430 | 383 |
| 431 {error_page::DNS_PROBE_STARTED, | 384 {error_page::DNS_PROBE_STARTED, |
| 432 IDS_ERRORPAGES_TITLE_NOT_AVAILABLE, | |
| 433 IDS_ERRORPAGES_HEADING_NOT_AVAILABLE, | 385 IDS_ERRORPAGES_HEADING_NOT_AVAILABLE, |
| 434 IDS_ERRORPAGES_SUMMARY_DNS_PROBE_RUNNING, | 386 IDS_ERRORPAGES_SUMMARY_DNS_PROBE_RUNNING, |
| 435 // Include SUGGEST_RELOAD so the More button doesn't jump when we update. | 387 // Include SUGGEST_RELOAD so the More button doesn't jump when we update. |
| 436 SUGGEST_DIAGNOSE_TOOL, | 388 SUGGEST_DIAGNOSE_TOOL, |
| 437 SHOW_BUTTON_RELOAD, | 389 SHOW_BUTTON_RELOAD, |
| 438 }, | 390 }, |
| 439 | 391 |
| 440 // DNS_PROBE_FINISHED_UNKNOWN is not here; NetErrorHelper will restore the | 392 // DNS_PROBE_FINISHED_UNKNOWN is not here; NetErrorHelper will restore the |
| 441 // original error, which might be one of several DNS-related errors. | 393 // original error, which might be one of several DNS-related errors. |
| 442 | 394 |
| 443 {error_page::DNS_PROBE_FINISHED_NO_INTERNET, | 395 {error_page::DNS_PROBE_FINISHED_NO_INTERNET, |
| 444 IDS_ERRORPAGES_TITLE_NOT_AVAILABLE, | |
| 445 IDS_ERRORPAGES_HEADING_INTERNET_DISCONNECTED, | 396 IDS_ERRORPAGES_HEADING_INTERNET_DISCONNECTED, |
| 446 IDS_ERRORPAGES_HEADING_INTERNET_DISCONNECTED, | 397 IDS_ERRORPAGES_HEADING_INTERNET_DISCONNECTED, |
| 447 SUGGEST_OFFLINE_CHECKS | SUGGEST_DIAGNOSE_TOOL, | 398 SUGGEST_OFFLINE_CHECKS | SUGGEST_DIAGNOSE_TOOL, |
| 448 SHOW_NO_BUTTONS, | 399 SHOW_NO_BUTTONS, |
| 449 }, | 400 }, |
| 450 {error_page::DNS_PROBE_FINISHED_BAD_CONFIG, | 401 {error_page::DNS_PROBE_FINISHED_BAD_CONFIG, |
| 451 IDS_ERRORPAGES_TITLE_NOT_AVAILABLE, | |
| 452 IDS_ERRORPAGES_HEADING_NOT_AVAILABLE, | 402 IDS_ERRORPAGES_HEADING_NOT_AVAILABLE, |
| 453 IDS_ERRORPAGES_SUMMARY_NAME_NOT_RESOLVED, | 403 IDS_ERRORPAGES_SUMMARY_NAME_NOT_RESOLVED, |
| 454 SUGGEST_DNS_CONFIG | SUGGEST_FIREWALL_CONFIG | SUGGEST_PROXY_CONFIG | | 404 SUGGEST_DNS_CONFIG | SUGGEST_FIREWALL_CONFIG | SUGGEST_PROXY_CONFIG | |
| 455 SUGGEST_DIAGNOSE_TOOL, | 405 SUGGEST_DIAGNOSE_TOOL, |
| 456 SHOW_BUTTON_RELOAD, | 406 SHOW_BUTTON_RELOAD, |
| 457 }, | 407 }, |
| 458 {error_page::DNS_PROBE_FINISHED_NXDOMAIN, | 408 {error_page::DNS_PROBE_FINISHED_NXDOMAIN, |
| 459 IDS_ERRORPAGES_TITLE_NOT_AVAILABLE, | |
| 460 IDS_ERRORPAGES_HEADING_NOT_AVAILABLE, | 409 IDS_ERRORPAGES_HEADING_NOT_AVAILABLE, |
| 461 IDS_ERRORPAGES_SUMMARY_NAME_NOT_RESOLVED, | 410 IDS_ERRORPAGES_SUMMARY_NAME_NOT_RESOLVED, |
| 462 SUGGEST_DIAGNOSE_TOOL, | 411 SUGGEST_DIAGNOSE_TOOL, |
| 463 SHOW_BUTTON_RELOAD, | 412 SHOW_BUTTON_RELOAD, |
| 464 }, | 413 }, |
| 465 }; | 414 }; |
| 466 | 415 |
| 467 const LocalizedErrorMap* FindErrorMapInArray(const LocalizedErrorMap* maps, | 416 const LocalizedErrorMap* FindErrorMapInArray(const LocalizedErrorMap* maps, |
| 468 size_t num_maps, | 417 size_t num_maps, |
| 469 int error_code) { | 418 int error_code) { |
| (...skipping 403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 873 bool has_offline_pages, | 822 bool has_offline_pages, |
| 874 const std::string& locale, | 823 const std::string& locale, |
| 875 std::unique_ptr<error_page::ErrorPageParams> params, | 824 std::unique_ptr<error_page::ErrorPageParams> params, |
| 876 base::DictionaryValue* error_strings) { | 825 base::DictionaryValue* error_strings) { |
| 877 webui::SetLoadTimeDataDefaults(locale, error_strings); | 826 webui::SetLoadTimeDataDefaults(locale, error_strings); |
| 878 | 827 |
| 879 // Grab the strings and settings that depend on the error type. Init | 828 // Grab the strings and settings that depend on the error type. Init |
| 880 // options with default values. | 829 // options with default values. |
| 881 LocalizedErrorMap options = { | 830 LocalizedErrorMap options = { |
| 882 0, | 831 0, |
| 883 IDS_ERRORPAGES_TITLE_NOT_AVAILABLE, | |
| 884 IDS_ERRORPAGES_HEADING_NOT_AVAILABLE, | 832 IDS_ERRORPAGES_HEADING_NOT_AVAILABLE, |
| 885 IDS_ERRORPAGES_SUMMARY_NOT_AVAILABLE, | 833 IDS_ERRORPAGES_SUMMARY_NOT_AVAILABLE, |
| 886 SUGGEST_NONE, | 834 SUGGEST_NONE, |
| 887 SHOW_NO_BUTTONS, | 835 SHOW_NO_BUTTONS, |
| 888 }; | 836 }; |
| 889 | 837 |
| 890 const LocalizedErrorMap* error_map = LookupErrorMap(error_domain, error_code, | 838 const LocalizedErrorMap* error_map = LookupErrorMap(error_domain, error_code, |
| 891 is_post); | 839 is_post); |
| 892 if (error_map) | 840 if (error_map) |
| 893 options = *error_map; | 841 options = *error_map; |
| 894 | 842 |
| 895 // If we got "access denied" but the url was a file URL, then we say it was a | 843 // If we got "access denied" but the url was a file URL, then we say it was a |
| 896 // file instead of just using the "not available" default message. Just adding | 844 // file instead of just using the "not available" default message. Just adding |
| 897 // ERR_ACCESS_DENIED to the map isn't sufficient, since that message may be | 845 // ERR_ACCESS_DENIED to the map isn't sufficient, since that message may be |
| 898 // generated by some OSs when the operation doesn't involve a file URL. | 846 // generated by some OSs when the operation doesn't involve a file URL. |
| 899 if (error_domain == net::kErrorDomain && | 847 if (error_domain == net::kErrorDomain && |
| 900 error_code == net::ERR_ACCESS_DENIED && | 848 error_code == net::ERR_ACCESS_DENIED && |
| 901 failed_url.scheme() == "file") { | 849 failed_url.scheme() == "file") { |
| 902 options.title_resource_id = IDS_ERRORPAGES_TITLE_ACCESS_DENIED; | |
| 903 options.heading_resource_id = IDS_ERRORPAGES_HEADING_FILE_ACCESS_DENIED; | 850 options.heading_resource_id = IDS_ERRORPAGES_HEADING_FILE_ACCESS_DENIED; |
| 904 options.summary_resource_id = IDS_ERRORPAGES_SUMMARY_FILE_ACCESS_DENIED; | 851 options.summary_resource_id = IDS_ERRORPAGES_SUMMARY_FILE_ACCESS_DENIED; |
| 905 options.suggestions = SUGGEST_NONE; | 852 options.suggestions = SUGGEST_NONE; |
| 906 options.buttons = SHOW_BUTTON_RELOAD; | 853 options.buttons = SHOW_BUTTON_RELOAD; |
| 907 } | 854 } |
| 908 | 855 |
| 909 base::string16 failed_url_string(url_formatter::FormatUrl( | 856 base::string16 failed_url_string(url_formatter::FormatUrl( |
| 910 failed_url, url_formatter::kFormatUrlOmitNothing, | 857 failed_url, url_formatter::kFormatUrlOmitNothing, |
| 911 net::UnescapeRule::NORMAL, nullptr, nullptr, nullptr)); | 858 net::UnescapeRule::NORMAL, nullptr, nullptr, nullptr)); |
| 912 // URLs are always LTR. | 859 // URLs are always LTR. |
| 913 if (base::i18n::IsRTL()) | 860 if (base::i18n::IsRTL()) |
| 914 base::i18n::WrapStringWithLTRFormatting(&failed_url_string); | 861 base::i18n::WrapStringWithLTRFormatting(&failed_url_string); |
| 915 error_strings->SetString("title", | 862 |
| 916 l10n_util::GetStringFUTF16(options.title_resource_id, failed_url_string)); | 863 base::string16 host_name(url_formatter::IDNToUnicode(failed_url.host())); |
| 864 error_strings->SetString("title", host_name); | |
|
mmenke
2016/08/05 15:03:43
Should use the full spec() if !failed_url().Scheme
edwardjung
2016/08/08 14:05:52
Changed it to do a scheme check.
https / broken h
| |
| 917 std::string icon_class = GetIconClassForError(error_domain, error_code); | 865 std::string icon_class = GetIconClassForError(error_domain, error_code); |
| 918 error_strings->SetString("iconClass", icon_class); | 866 error_strings->SetString("iconClass", icon_class); |
| 919 | 867 |
| 920 base::string16 host_name(url_formatter::IDNToUnicode(failed_url.host())); | |
| 921 | |
| 922 base::DictionaryValue* heading = new base::DictionaryValue; | 868 base::DictionaryValue* heading = new base::DictionaryValue; |
| 923 heading->SetString("msg", | 869 heading->SetString("msg", |
| 924 l10n_util::GetStringUTF16(options.heading_resource_id)); | 870 l10n_util::GetStringUTF16(options.heading_resource_id)); |
| 925 heading->SetString("hostName", host_name); | 871 heading->SetString("hostName", host_name); |
| 926 error_strings->Set("heading", heading); | 872 error_strings->Set("heading", heading); |
| 927 | 873 |
| 928 base::DictionaryValue* summary = new base::DictionaryValue; | 874 base::DictionaryValue* summary = new base::DictionaryValue; |
| 929 | 875 |
| 930 // Set summary message under the heading. | 876 // Set summary message under the heading. |
| 931 summary->SetString( | 877 summary->SetString( |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1072 | 1018 |
| 1073 bool LocalizedError::HasStrings(const std::string& error_domain, | 1019 bool LocalizedError::HasStrings(const std::string& error_domain, |
| 1074 int error_code) { | 1020 int error_code) { |
| 1075 // Whether or not the there are strings for an error does not depend on | 1021 // Whether or not the there are strings for an error does not depend on |
| 1076 // whether or not the page was be generated by a POST, so just claim it was | 1022 // whether or not the page was be generated by a POST, so just claim it was |
| 1077 // not. | 1023 // not. |
| 1078 return LookupErrorMap(error_domain, error_code, /*is_post=*/false) != nullptr; | 1024 return LookupErrorMap(error_domain, error_code, /*is_post=*/false) != nullptr; |
| 1079 } | 1025 } |
| 1080 | 1026 |
| 1081 } // namespace error_page | 1027 } // namespace error_page |
| OLD | NEW |