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 556 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
567 if (options.details_resource_id != kErrorPagesNoDetails) { | 567 if (options.details_resource_id != kErrorPagesNoDetails) { |
568 error_strings->SetString( | 568 error_strings->SetString( |
569 "errorDetails", l10n_util::GetStringUTF16(options.details_resource_id)); | 569 "errorDetails", l10n_util::GetStringUTF16(options.details_resource_id)); |
570 } | 570 } |
571 | 571 |
572 string16 error_string; | 572 string16 error_string; |
573 if (error_domain == net::kErrorDomain) { | 573 if (error_domain == net::kErrorDomain) { |
574 // Non-internationalized error string, for debugging Chrome itself. | 574 // Non-internationalized error string, for debugging Chrome itself. |
575 std::string ascii_error_string = net::ErrorToString(error_code); | 575 std::string ascii_error_string = net::ErrorToString(error_code); |
576 // Remove the leading "net::" from the returned string. | 576 // Remove the leading "net::" from the returned string. |
577 RemoveChars(ascii_error_string, "net:", &ascii_error_string); | 577 base::RemoveChars(ascii_error_string, "net:", &ascii_error_string); |
578 error_string = ASCIIToUTF16(ascii_error_string); | 578 error_string = ASCIIToUTF16(ascii_error_string); |
579 } else if (error_domain == chrome_common_net::kDnsProbeErrorDomain) { | 579 } else if (error_domain == chrome_common_net::kDnsProbeErrorDomain) { |
580 std::string ascii_error_string = | 580 std::string ascii_error_string = |
581 chrome_common_net::DnsProbeStatusToString(error_code); | 581 chrome_common_net::DnsProbeStatusToString(error_code); |
582 error_string = ASCIIToUTF16(ascii_error_string); | 582 error_string = ASCIIToUTF16(ascii_error_string); |
583 } else { | 583 } else { |
584 DCHECK_EQ(LocalizedError::kHttpErrorDomain, error_domain); | 584 DCHECK_EQ(LocalizedError::kHttpErrorDomain, error_domain); |
585 error_string = base::IntToString16(error_code); | 585 error_string = base::IntToString16(error_code); |
586 } | 586 } |
587 error_strings->SetString("errorCode", | 587 error_strings->SetString("errorCode", |
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
819 #if defined(OS_CHROMEOS) | 819 #if defined(OS_CHROMEOS) |
820 GURL learn_more_url(kAppWarningLearnMoreUrl); | 820 GURL learn_more_url(kAppWarningLearnMoreUrl); |
821 base::DictionaryValue* suggest_learn_more = new base::DictionaryValue(); | 821 base::DictionaryValue* suggest_learn_more = new base::DictionaryValue(); |
822 suggest_learn_more->SetString("msg", | 822 suggest_learn_more->SetString("msg", |
823 l10n_util::GetStringUTF16( | 823 l10n_util::GetStringUTF16( |
824 IDS_ERRORPAGES_SUGGESTION_LEARNMORE_BODY)); | 824 IDS_ERRORPAGES_SUGGESTION_LEARNMORE_BODY)); |
825 suggest_learn_more->SetString("learnMoreUrl", learn_more_url.spec()); | 825 suggest_learn_more->SetString("learnMoreUrl", learn_more_url.spec()); |
826 error_strings->Set("suggestionsLearnMore", suggest_learn_more); | 826 error_strings->Set("suggestionsLearnMore", suggest_learn_more); |
827 #endif // defined(OS_CHROMEOS) | 827 #endif // defined(OS_CHROMEOS) |
828 } | 828 } |
OLD | NEW |