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