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 "chrome/common/localized_error.h" | 5 #include "chrome/common/localized_error.h" |
6 | 6 |
7 #include "base/i18n/rtl.h" | 7 #include "base/i18n/rtl.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/strings/string16.h" | 9 #include "base/strings/string16.h" |
10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
(...skipping 541 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
552 l10n_util::GetStringFUTF16(options.title_resource_id, failed_url_string)); | 552 l10n_util::GetStringFUTF16(options.title_resource_id, failed_url_string)); |
553 error_strings->SetString("heading", | 553 error_strings->SetString("heading", |
554 l10n_util::GetStringUTF16(options.heading_resource_id)); | 554 l10n_util::GetStringUTF16(options.heading_resource_id)); |
555 | 555 |
556 std::string icon_class = GetIconClassForError(error_domain, error_code); | 556 std::string icon_class = GetIconClassForError(error_domain, error_code); |
557 error_strings->SetString("iconClass", icon_class); | 557 error_strings->SetString("iconClass", icon_class); |
558 | 558 |
559 base::DictionaryValue* summary = new base::DictionaryValue; | 559 base::DictionaryValue* summary = new base::DictionaryValue; |
560 | 560 |
561 // For offline show a summary message underneath the heading. | 561 // For offline show a summary message underneath the heading. |
562 if (error_code == net::ERR_INTERNET_DISCONNECTED) { | 562 if (error_code == net::ERR_INTERNET_DISCONNECTED || |
| 563 error_code == chrome_common_net::DNS_PROBE_FINISHED_NO_INTERNET) { |
563 error_strings->SetString("primaryParagraph", | 564 error_strings->SetString("primaryParagraph", |
564 l10n_util::GetStringUTF16(options.summary_resource_id)); | 565 l10n_util::GetStringUTF16(options.summary_resource_id)); |
565 } else { | 566 } else { |
566 // Set summary message in the details. | 567 // Set summary message in the details. |
567 summary->SetString("msg", | 568 summary->SetString("msg", |
568 l10n_util::GetStringUTF16(options.summary_resource_id)); | 569 l10n_util::GetStringUTF16(options.summary_resource_id)); |
569 } | 570 } |
570 summary->SetString("failedUrl", failed_url_string); | 571 summary->SetString("failedUrl", failed_url_string); |
571 summary->SetString("hostName", net::IDNToUnicode(failed_url.host(), | 572 summary->SetString("hostName", net::IDNToUnicode(failed_url.host(), |
572 accept_languages)); | 573 accept_languages)); |
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
874 #if defined(OS_CHROMEOS) | 875 #if defined(OS_CHROMEOS) |
875 GURL learn_more_url(kAppWarningLearnMoreUrl); | 876 GURL learn_more_url(kAppWarningLearnMoreUrl); |
876 base::DictionaryValue* suggest_learn_more = new base::DictionaryValue(); | 877 base::DictionaryValue* suggest_learn_more = new base::DictionaryValue(); |
877 suggest_learn_more->SetString("msg", | 878 suggest_learn_more->SetString("msg", |
878 l10n_util::GetStringUTF16( | 879 l10n_util::GetStringUTF16( |
879 IDS_ERRORPAGES_SUGGESTION_LEARNMORE_BODY)); | 880 IDS_ERRORPAGES_SUGGESTION_LEARNMORE_BODY)); |
880 suggest_learn_more->SetString("learnMoreUrl", learn_more_url.spec()); | 881 suggest_learn_more->SetString("learnMoreUrl", learn_more_url.spec()); |
881 error_strings->Set("suggestionsLearnMore", suggest_learn_more); | 882 error_strings->Set("suggestionsLearnMore", suggest_learn_more); |
882 #endif // defined(OS_CHROMEOS) | 883 #endif // defined(OS_CHROMEOS) |
883 } | 884 } |
OLD | NEW |