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

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

Issue 2190463008: Add an error page for HTTP 404 error pages without bodies. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Switch runtime test to title1.html Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/test/data/form.html ('k') | extensions/browser/api/runtime/runtime_apitest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "components/error_page/common/localized_error.h" 5 #include "components/error_page/common/localized_error.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <utility> 9 #include <utility>
10 10
(...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after
363 const LocalizedErrorMap repost_error = { 363 const LocalizedErrorMap repost_error = {
364 net::ERR_CACHE_MISS, 364 net::ERR_CACHE_MISS,
365 IDS_ERRORPAGES_TITLE_NOT_AVAILABLE, 365 IDS_ERRORPAGES_TITLE_NOT_AVAILABLE,
366 IDS_HTTP_POST_WARNING_TITLE, 366 IDS_HTTP_POST_WARNING_TITLE,
367 IDS_ERRORPAGES_HTTP_POST_WARNING, 367 IDS_ERRORPAGES_HTTP_POST_WARNING,
368 SUGGEST_REPOST_RELOAD, 368 SUGGEST_REPOST_RELOAD,
369 SHOW_NO_BUTTONS, 369 SHOW_NO_BUTTONS,
370 }; 370 };
371 371
372 const LocalizedErrorMap http_error_options[] = { 372 const LocalizedErrorMap http_error_options[] = {
373 {403, 373 {
374 IDS_ERRORPAGES_TITLE_ACCESS_DENIED, 374 403, IDS_ERRORPAGES_TITLE_ACCESS_DENIED,
375 IDS_ERRORPAGES_HEADING_ACCESS_DENIED, 375 IDS_ERRORPAGES_HEADING_ACCESS_DENIED, IDS_ERRORPAGES_SUMMARY_FORBIDDEN,
376 IDS_ERRORPAGES_SUMMARY_FORBIDDEN, 376 SUGGEST_NONE, SHOW_BUTTON_RELOAD,
377 SUGGEST_NONE, 377 },
378 SHOW_BUTTON_RELOAD, 378 {
379 }, 379 404, IDS_ERRORPAGES_TITLE_NOT_FOUND, IDS_ERRORPAGES_HEADING_NOT_FOUND,
380 {410, 380 IDS_ERRORPAGES_SUMMARY_NOT_FOUND, SUGGEST_NONE, SHOW_BUTTON_RELOAD,
381 IDS_ERRORPAGES_TITLE_NOT_FOUND, 381 },
382 IDS_ERRORPAGES_HEADING_NOT_FOUND, 382 {
383 IDS_ERRORPAGES_SUMMARY_GONE, 383 410, IDS_ERRORPAGES_TITLE_NOT_FOUND, IDS_ERRORPAGES_HEADING_NOT_FOUND,
384 SUGGEST_NONE, 384 IDS_ERRORPAGES_SUMMARY_GONE, SUGGEST_NONE, SHOW_NO_BUTTONS,
385 SHOW_NO_BUTTONS, 385 },
386 },
387 386
388 {500, 387 {
389 IDS_ERRORPAGES_TITLE_LOAD_FAILED, 388 500, IDS_ERRORPAGES_TITLE_LOAD_FAILED,
390 IDS_ERRORPAGES_HEADING_PAGE_NOT_WORKING, 389 IDS_ERRORPAGES_HEADING_PAGE_NOT_WORKING,
391 IDS_ERRORPAGES_SUMMARY_WEBSITE_CANNOT_HANDLE_REQUEST, 390 IDS_ERRORPAGES_SUMMARY_WEBSITE_CANNOT_HANDLE_REQUEST, SUGGEST_NONE,
392 SUGGEST_NONE, 391 SHOW_BUTTON_RELOAD,
393 SHOW_BUTTON_RELOAD, 392 },
394 }, 393 {
395 {501, 394 501, IDS_ERRORPAGES_TITLE_LOAD_FAILED,
396 IDS_ERRORPAGES_TITLE_LOAD_FAILED, 395 IDS_ERRORPAGES_HEADING_PAGE_NOT_WORKING,
397 IDS_ERRORPAGES_HEADING_PAGE_NOT_WORKING, 396 IDS_ERRORPAGES_SUMMARY_WEBSITE_CANNOT_HANDLE_REQUEST, SUGGEST_NONE,
398 IDS_ERRORPAGES_SUMMARY_WEBSITE_CANNOT_HANDLE_REQUEST, 397 SHOW_NO_BUTTONS,
399 SUGGEST_NONE, 398 },
400 SHOW_NO_BUTTONS, 399 {
401 }, 400 502, IDS_ERRORPAGES_TITLE_LOAD_FAILED,
402 {502, 401 IDS_ERRORPAGES_HEADING_PAGE_NOT_WORKING,
403 IDS_ERRORPAGES_TITLE_LOAD_FAILED, 402 IDS_ERRORPAGES_SUMMARY_WEBSITE_CANNOT_HANDLE_REQUEST, SUGGEST_NONE,
404 IDS_ERRORPAGES_HEADING_PAGE_NOT_WORKING, 403 SHOW_BUTTON_RELOAD,
405 IDS_ERRORPAGES_SUMMARY_WEBSITE_CANNOT_HANDLE_REQUEST, 404 },
406 SUGGEST_NONE, 405 {
407 SHOW_BUTTON_RELOAD, 406 503, IDS_ERRORPAGES_TITLE_LOAD_FAILED,
408 }, 407 IDS_ERRORPAGES_HEADING_PAGE_NOT_WORKING,
409 {503, 408 IDS_ERRORPAGES_SUMMARY_WEBSITE_CANNOT_HANDLE_REQUEST, SUGGEST_NONE,
410 IDS_ERRORPAGES_TITLE_LOAD_FAILED, 409 SHOW_BUTTON_RELOAD,
411 IDS_ERRORPAGES_HEADING_PAGE_NOT_WORKING, 410 },
412 IDS_ERRORPAGES_SUMMARY_WEBSITE_CANNOT_HANDLE_REQUEST, 411 {
413 SUGGEST_NONE, 412 504, IDS_ERRORPAGES_TITLE_LOAD_FAILED,
414 SHOW_BUTTON_RELOAD, 413 IDS_ERRORPAGES_HEADING_PAGE_NOT_WORKING,
415 }, 414 IDS_ERRORPAGES_SUMMARY_GATEWAY_TIMEOUT, SUGGEST_NONE,
416 {504, 415 SHOW_BUTTON_RELOAD,
417 IDS_ERRORPAGES_TITLE_LOAD_FAILED, 416 },
418 IDS_ERRORPAGES_HEADING_PAGE_NOT_WORKING,
419 IDS_ERRORPAGES_SUMMARY_GATEWAY_TIMEOUT,
420 SUGGEST_NONE,
421 SHOW_BUTTON_RELOAD,
422 },
423 }; 417 };
424 418
425 const LocalizedErrorMap dns_probe_error_options[] = { 419 const LocalizedErrorMap dns_probe_error_options[] = {
426 {error_page::DNS_PROBE_POSSIBLE, 420 {error_page::DNS_PROBE_POSSIBLE,
427 IDS_ERRORPAGES_TITLE_NOT_AVAILABLE, 421 IDS_ERRORPAGES_TITLE_NOT_AVAILABLE,
428 IDS_ERRORPAGES_HEADING_NOT_AVAILABLE, 422 IDS_ERRORPAGES_HEADING_NOT_AVAILABLE,
429 IDS_ERRORPAGES_SUMMARY_DNS_PROBE_RUNNING, 423 IDS_ERRORPAGES_SUMMARY_DNS_PROBE_RUNNING,
430 SUGGEST_DIAGNOSE_TOOL, 424 SUGGEST_DIAGNOSE_TOOL,
431 SHOW_BUTTON_RELOAD, 425 SHOW_BUTTON_RELOAD,
432 }, 426 },
(...skipping 645 matching lines...) Expand 10 before | Expand all | Expand 10 after
1078 1072
1079 bool LocalizedError::HasStrings(const std::string& error_domain, 1073 bool LocalizedError::HasStrings(const std::string& error_domain,
1080 int error_code) { 1074 int error_code) {
1081 // 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
1082 // 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
1083 // not. 1077 // not.
1084 return LookupErrorMap(error_domain, error_code, /*is_post=*/false) != nullptr; 1078 return LookupErrorMap(error_domain, error_code, /*is_post=*/false) != nullptr;
1085 } 1079 }
1086 1080
1087 } // namespace error_page 1081 } // namespace error_page
OLDNEW
« no previous file with comments | « chrome/test/data/form.html ('k') | extensions/browser/api/runtime/runtime_apitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698