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/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/i18n/rtl.h" | 8 #include "base/i18n/rtl.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/metrics/field_trial.h" | 10 #include "base/metrics/field_trial.h" |
(...skipping 612 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
623 // Non-internationalized error string, for debugging Chrome itself. | 623 // Non-internationalized error string, for debugging Chrome itself. |
624 error_string = base::ASCIIToUTF16(net::ErrorToShortString(error_code)); | 624 error_string = base::ASCIIToUTF16(net::ErrorToShortString(error_code)); |
625 } else if (error_domain == error_page::kDnsProbeErrorDomain) { | 625 } else if (error_domain == error_page::kDnsProbeErrorDomain) { |
626 std::string ascii_error_string = | 626 std::string ascii_error_string = |
627 error_page::DnsProbeStatusToString(error_code); | 627 error_page::DnsProbeStatusToString(error_code); |
628 error_string = base::ASCIIToUTF16(ascii_error_string); | 628 error_string = base::ASCIIToUTF16(ascii_error_string); |
629 } else { | 629 } else { |
630 DCHECK_EQ(LocalizedError::kHttpErrorDomain, error_domain); | 630 DCHECK_EQ(LocalizedError::kHttpErrorDomain, error_domain); |
631 error_string = base::IntToString16(error_code); | 631 error_string = base::IntToString16(error_code); |
632 } | 632 } |
633 error_strings->SetString("errorCode", | 633 error_strings->SetString("errorCode", error_string); |
634 l10n_util::GetStringFUTF16(IDS_ERRORPAGES_ERROR_CODE, error_string)); | |
635 | 634 |
636 // Platform specific information for diagnosing network issues on OSX and | 635 // Platform specific information for diagnosing network issues on OSX and |
637 // Windows. | 636 // Windows. |
638 #if defined(OS_MACOSX) || defined(OS_WIN) | 637 #if defined(OS_MACOSX) || defined(OS_WIN) |
639 if (error_domain == net::kErrorDomain && | 638 if (error_domain == net::kErrorDomain && |
640 error_code == net::ERR_INTERNET_DISCONNECTED) { | 639 error_code == net::ERR_INTERNET_DISCONNECTED) { |
641 int platform_string_id = | 640 int platform_string_id = |
642 IDS_ERRORPAGES_SUMMARY_INTERNET_DISCONNECTED_PLATFORM; | 641 IDS_ERRORPAGES_SUMMARY_INTERNET_DISCONNECTED_PLATFORM; |
643 #if defined(OS_WIN) | 642 #if defined(OS_WIN) |
644 // Different versions of Windows have different instructions. | 643 // Different versions of Windows have different instructions. |
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
924 cache_button->SetString("cacheUrl", cache_url); | 923 cache_button->SetString("cacheUrl", cache_url); |
925 cache_button->SetInteger("trackingId", cache_tracking_id); | 924 cache_button->SetInteger("trackingId", cache_tracking_id); |
926 error_strings->Set("cacheButton", cache_button.release()); | 925 error_strings->Set("cacheButton", cache_button.release()); |
927 | 926 |
928 // Remove the item from suggestions dictionary so that it does not get | 927 // Remove the item from suggestions dictionary so that it does not get |
929 // displayed by the template in the details section. | 928 // displayed by the template in the details section. |
930 suggestions->Remove(0, nullptr); | 929 suggestions->Remove(0, nullptr); |
931 } | 930 } |
932 } | 931 } |
933 } | 932 } |
OLD | NEW |