Index: chrome/common/localized_error.cc |
diff --git a/chrome/common/localized_error.cc b/chrome/common/localized_error.cc |
index 63f51aa69edf495a7b300c4d214cd3327e5683c1..3d27224b585c88ae085e98248f2837d892a33b78 100644 |
--- a/chrome/common/localized_error.cc |
+++ b/chrome/common/localized_error.cc |
@@ -14,6 +14,7 @@ |
#include "chrome/common/extensions/extension_constants.h" |
#include "chrome/common/extensions/extension_icon_set.h" |
#include "chrome/common/extensions/extension_set.h" |
+#include "chrome/common/net/net_error_info.h" |
#include "googleurl/src/gurl.h" |
#include "grit/chromium_strings.h" |
#include "grit/generated_resources.h" |
@@ -350,6 +351,56 @@ const LocalizedErrorMap http_error_options[] = { |
}, |
}; |
+const LocalizedErrorMap dns_probe_error_options[] = { |
+ {chrome_common_net::DNS_PROBE_ERR_POSSIBLE, |
+ IDS_ERRORPAGES_TITLE_NOT_AVAILABLE, |
+ IDS_ERRORPAGES_HEADING_NOT_AVAILABLE, |
+ IDS_ERRORPAGES_SUMMARY_DNS_PROBE_RUNNING, |
+ IDS_ERRORPAGES_DETAILS_DNS_PROBE_RUNNING, |
+ SUGGEST_NONE, |
+ }, |
+ {chrome_common_net::DNS_PROBE_ERR_RUNNING, |
+ IDS_ERRORPAGES_TITLE_NOT_AVAILABLE, |
+ IDS_ERRORPAGES_HEADING_NOT_AVAILABLE, |
+ IDS_ERRORPAGES_SUMMARY_DNS_PROBE_RUNNING, |
+ IDS_ERRORPAGES_DETAILS_DNS_PROBE_RUNNING, |
+ SUGGEST_NONE, |
+ }, |
+ {chrome_common_net::DNS_PROBE_ERR_FINISHED + |
+ chrome_common_net::DNS_PROBE_UNKNOWN, |
+ IDS_ERRORPAGES_TITLE_NOT_AVAILABLE, |
+ IDS_ERRORPAGES_HEADING_NOT_AVAILABLE, |
+ IDS_ERRORPAGES_SUMMARY_NAME_NOT_RESOLVED, |
+ IDS_ERRORPAGES_DETAILS_NAME_NOT_RESOLVED, |
+ SUGGEST_RELOAD | SUGGEST_CHECK_CONNECTION | SUGGEST_DNS_CONFIG | |
+ SUGGEST_FIREWALL_CONFIG | SUGGEST_PROXY_CONFIG, |
+ }, |
+ {chrome_common_net::DNS_PROBE_ERR_FINISHED + |
+ chrome_common_net::DNS_PROBE_NO_INTERNET, |
+ IDS_ERRORPAGES_TITLE_NOT_AVAILABLE, |
+ IDS_ERRORPAGES_HEADING_NOT_AVAILABLE, |
+ IDS_ERRORPAGES_SUMMARY_INTERNET_DISCONNECTED, |
+ IDS_ERRORPAGES_DETAILS_INTERNET_DISCONNECTED, |
+ SUGGEST_RELOAD | SUGGEST_CHECK_CONNECTION | SUGGEST_FIREWALL_CONFIG, |
+ }, |
+ {chrome_common_net::DNS_PROBE_ERR_FINISHED + |
+ chrome_common_net::DNS_PROBE_BAD_CONFIG, |
+ IDS_ERRORPAGES_TITLE_NOT_AVAILABLE, |
+ IDS_ERRORPAGES_HEADING_NOT_AVAILABLE, |
+ IDS_ERRORPAGES_SUMMARY_NAME_NOT_RESOLVED, |
+ IDS_ERRORPAGES_DETAILS_NAME_NOT_RESOLVED, |
+ SUGGEST_RELOAD | SUGGEST_DNS_CONFIG | SUGGEST_FIREWALL_CONFIG, |
+ }, |
+ {chrome_common_net::DNS_PROBE_ERR_FINISHED + |
+ chrome_common_net::DNS_PROBE_NXDOMAIN, |
+ IDS_ERRORPAGES_TITLE_NOT_AVAILABLE, |
+ IDS_ERRORPAGES_HEADING_NOT_AVAILABLE, |
+ IDS_ERRORPAGES_SUMMARY_NAME_NOT_RESOLVED, |
+ IDS_ERRORPAGES_DETAILS_NAME_NOT_RESOLVED, |
+ SUGGEST_RELOAD | SUGGEST_HOSTNAME, |
+ }, |
+}; |
+ |
const char* HttpErrorToString(int status_code) { |
switch (status_code) { |
case 403: |
@@ -386,6 +437,9 @@ string16 GetErrorDetailsString(const std::string& error_domain, |
} else if (error_domain == LocalizedError::kHttpErrorDomain) { |
error_page_template = IDS_ERRORPAGES_HTTP_DETAILS_TEMPLATE; |
error_string = HttpErrorToString(error_code); |
+ } else if (error_domain == chrome_common_net::kDnsProbeErrorDomain) { |
+ error_page_template = IDS_ERRORPAGES_DETAILS_TEMPLATE; |
+ error_string = chrome_common_net::DnsProbeErrorToString(error_code); |
} else { |
NOTREACHED(); |
return string16(); |
@@ -417,6 +471,10 @@ const LocalizedErrorMap* LookupErrorMap(const std::string& error_domain, |
return FindErrorMapInArray(http_error_options, |
arraysize(http_error_options), |
error_code); |
+ } else if (error_domain == chrome_common_net::kDnsProbeErrorDomain) { |
+ return FindErrorMapInArray(dns_probe_error_options, |
+ arraysize(dns_probe_error_options), |
+ error_code); |
} else { |
NOTREACHED(); |
return NULL; |