diff options
-rw-r--r-- | chrome/app/generated_resources.grd | 58 | ||||
-rw-r--r-- | chrome/renderer/localized_error.cc | 54 |
2 files changed, 102 insertions, 10 deletions
diff --git a/chrome/app/generated_resources.grd b/chrome/app/generated_resources.grd index 8cfb0f3..592c6c3 100644 --- a/chrome/app/generated_resources.grd +++ b/chrome/app/generated_resources.grd @@ -5551,6 +5551,9 @@ Keep your key file in a safe place. You will need it to create new versions of y <message name="IDS_ERRORPAGES_TITLE_PROXY_CONNECTION_FAILED" desc="Title of the error page when we can't connect to the proxy server."> Could not connect to the proxy server </message> + <message name="IDS_ERRORPAGES_TITLE_INTERNET_DISCONNECTED" desc="Title of the error page when the network connection failed."> + Could not connect to the internet + </message> <message name="IDS_ERRORPAGES_HEADING_NOT_AVAILABLE" desc="Heading in the error page when we can't connect to a site."> This webpage is not available. </message> @@ -5563,6 +5566,9 @@ Keep your key file in a safe place. You will need it to create new versions of y <message name="IDS_ERRORPAGES_HEADING_PROXY_CONNECTION_FAILED" desc="Heading in the error page when the proxy server connection failed."> Unable to connect to the proxy server. </message> + <message name="IDS_ERRORPAGES_HEADING_INTERNET_DISCONNECTED" desc="Heading of the error page when the network connection failed."> + Unable to connect to the internet. + </message> <message name="IDS_ERRORPAGES_SUMMARY_NOT_AVAILABLE" desc="Summary in the error page when we can't connect to a site."> The webpage at <ph name="URL"><strong jscontent="failedUrl"></strong></ph> might be temporarily down or it may have moved permanently to a new web address. </message> @@ -5615,6 +5621,52 @@ Keep your key file in a safe place. You will need it to create new versions of y </message> </if> + <message name="IDS_ERRORPAGES_SUMMARY_INTERNET_DISCONNECTED" desc="Summary of the error page when the network connection failed, before platform dependent instructions."> + <ph name="PRODUCT_NAME"><span jscontent="productName"></span><ex>Google Chrome</ex></ph> + can’t display the webpage because your computer isn’t connected to the internet. + <ph name="LINE_BREAK"><br /><br /></ph> + You can try to diagnose the problem by taking the following steps: + <ph name="LINE_BREAK"><br /><br /></ph> + <ph name="PLATFORM_TEXT"> + $1<ex>Goto the wrench menu and choose Fix It.</ex> + </ph> + </message> + + <if expr="os == 'darwin'"> + <message name="IDS_ERRORPAGES_SUMMARY_INTERNET_DISCONNECTED_PLATFORM" desc="Summary (platform dependent section) in the error page when the network connection failed. Describes how to get to the network Diagnostics screen under Mac OSX."> + Go to + <ph name="BEGIN_BOLD"><strong></ph> + Applications > System Preferences > Network > Assist me + <ph name="END_BOLD"></strong></ph> + to test your connection. + </message> + </if> + <!-- TODO(mmenke): Add Linux instructions --> + <if expr="os != 'darwin' and os != 'linux2'"> + <message name="IDS_ERRORPAGES_SUMMARY_INTERNET_DISCONNECTED_PLATFORM" desc="Summary (platform dependent section) in the error page when the network connection failed. Describes how to get to the network Diagnostics screen under Windows 7 and later."> + Go to + <ph name="BEGIN_BOLD"><strong></ph> + Start > Control Panel > Network and Internet > Network and Sharing Center > Troubleshoot Problems (at the bottom) > Internet Connections. + <ph name="END_BOLD"></strong></ph> + </message> + <message name="IDS_ERRORPAGES_SUMMARY_INTERNET_DISCONNECTED_PLATFORM_VISTA" desc="Summary (platform dependent section) in the error page when the network connection failed. Describes how to get to the network Diagnostics screen under Windows Vista."> + Go to + <ph name="BEGIN_BOLD"><strong></ph> + Start > Control Panel > Network Connections > New Connection Wizard + <ph name="END_BOLD"></strong></ph> + to test your connection. + </message> + <message name="IDS_ERRORPAGES_SUMMARY_INTERNET_DISCONNECTED_PLATFORM_XP" desc="Summary (platform dependent section) in the error page when the network connection failed. Describes how to get to the network Diagnostics screen under Windows XP."> + Click + <ph name="BEGIN_BOLD"><strong></ph>Start<ph name="END_BOLD"></strong></ph>, + click + <ph name="BEGIN_BOLD"><strong></ph>Run<ph name="END_BOLD"></strong></ph>, + type + <ph name="BEGIN_BOLD"><strong></ph>%windir%\\network diagnostic\\xpnetdiag.exe<ph name="END_BOLD"></strong></ph>, + and then click OK. + </message> + </if> + <message name="IDS_ERRORPAGES_DETAILS_TEMPLATE" desc="On the bottom of the error page text, there is a box that includes extra information for tech savvy users."> Error <ph name="ERROR_NUMBER">$1<ex>5</ex></ph> (<ph name="ERROR_NAME">$2<ex>net::ERR_FILE_NOT_FOUND</ex></ph>): <ph name="ERROR_TEXT">$3<ex>The requested file is not found.</ex></ph> </message> @@ -5631,9 +5683,6 @@ Keep your key file in a safe place. You will need it to create new versions of y <message name="IDS_ERRORPAGES_DETAILS_NAME_NOT_RESOLVED" desc="The error message displayed when a dns look up fails."> The server could not be found. </message> - <message name="IDS_ERRORPAGES_DETAILS_DISCONNECTED" desc="The error message displayed when we have no internet access."> - The Internet connection has been lost. - </message> <message name="IDS_ERRORPAGES_DETAILS_FILE_NOT_FOUND" desc="The error message displayed when a local file can not be found."> The file or directory could not be found. </message> @@ -5643,6 +5692,9 @@ Keep your key file in a safe place. You will need it to create new versions of y <message name="IDS_ERRORPAGES_DETAILS_PROXY_CONNECTION_FAILED" desc="The error message displayed when the proxy server connection failed."> Proxy server connection failed. </message> + <message name="IDS_ERRORPAGES_DETAILS_INTERNET_DISCONNECTED" desc="The error message displayed when we have no internet access."> + The internet connection has been lost. + </message> <message name="IDS_ERRORPAGES_DETAILS_UNKNOWN" desc="The default error message displayed if we don't have a more specific error message."> Unknown error. </message> diff --git a/chrome/renderer/localized_error.cc b/chrome/renderer/localized_error.cc index fa6b70c..203f7b5 100644 --- a/chrome/renderer/localized_error.cc +++ b/chrome/renderer/localized_error.cc @@ -9,6 +9,7 @@ #include "base/logging.h" #include "base/string16.h" #include "base/string_number_conversions.h" +#include "base/sys_info.h" #include "base/utf_string_conversions.h" #include "base/values.h" #include "chrome/renderer/extensions/extension_renderer_info.h" @@ -74,13 +75,6 @@ const LocalizedErrorMap net_error_options[] = { IDS_ERRORPAGES_DETAILS_NAME_NOT_RESOLVED, SUGGEST_RELOAD, }, - {net::ERR_INTERNET_DISCONNECTED, - IDS_ERRORPAGES_TITLE_NOT_AVAILABLE, - IDS_ERRORPAGES_HEADING_NOT_AVAILABLE, - IDS_ERRORPAGES_SUMMARY_NOT_AVAILABLE, - IDS_ERRORPAGES_DETAILS_DISCONNECTED, - SUGGEST_RELOAD, - }, {net::ERR_FILE_NOT_FOUND, IDS_ERRORPAGES_TITLE_NOT_FOUND, IDS_ERRORPAGES_HEADING_NOT_FOUND, @@ -130,6 +124,25 @@ const LocalizedErrorMap net_error_options[] = { IDS_ERRORPAGES_DETAILS_PROXY_CONNECTION_FAILED, SUGGEST_NONE, }, + // TODO(mmenke): Once Linux-specific instructions are added, remove this + // conditional, and the one further down as well. +#if defined(OS_MACOSX) || defined(OS_WIN) + {net::ERR_INTERNET_DISCONNECTED, + IDS_ERRORPAGES_TITLE_INTERNET_DISCONNECTED, + IDS_ERRORPAGES_HEADING_INTERNET_DISCONNECTED, + IDS_ERRORPAGES_SUMMARY_INTERNET_DISCONNECTED, + IDS_ERRORPAGES_DETAILS_INTERNET_DISCONNECTED, + SUGGEST_NONE, + }, +#else + {net::ERR_INTERNET_DISCONNECTED, + IDS_ERRORPAGES_TITLE_NOT_AVAILABLE, + IDS_ERRORPAGES_HEADING_NOT_AVAILABLE, + IDS_ERRORPAGES_SUMMARY_NOT_AVAILABLE, + IDS_ERRORPAGES_DETAILS_INTERNET_DISCONNECTED, + SUGGEST_NONE, + }, +#endif }; const LocalizedErrorMap http_error_options[] = { @@ -348,6 +361,33 @@ void LocalizedError::GetStrings(const WebKit::WebURLError& error, IDS_ERRORPAGES_SUMMARY_PROXY_CONNECTION_FAILED_PLATFORM))); } +#if defined(OS_MACOSX) || defined(OS_WIN) + if (error_domain == net::kErrorDomain && + error_code == net::ERR_INTERNET_DISCONNECTED) { + int platform_string_id = + IDS_ERRORPAGES_SUMMARY_INTERNET_DISCONNECTED_PLATFORM; +#if defined(OS_WIN) + // Different versions of Windows have different instructions. + int32 major_version, minor_version, bugfix_version; + base::SysInfo::OperatingSystemVersionNumbers( + &major_version, &minor_version, &bugfix_version); + if (major_version < 6) { + // XP, XP64, and Server 2003. + platform_string_id = + IDS_ERRORPAGES_SUMMARY_INTERNET_DISCONNECTED_PLATFORM_XP; + } else if (major_version == 6 && minor_version == 0) { + // Vista + platform_string_id = + IDS_ERRORPAGES_SUMMARY_INTERNET_DISCONNECTED_PLATFORM_VISTA; + } +#endif // defined(OS_WIN) + // Suffix the platform dependent portion of the summary section. + summary->SetString("msg", + l10n_util::GetStringFUTF16(options.summary_resource_id, + l10n_util::GetStringUTF16(platform_string_id))); + } +#endif // defined(OS_MACOSX) || defined(OS_WIN) + if (options.suggestions & SUGGEST_RELOAD) { DictionaryValue* suggest_reload = new DictionaryValue; suggest_reload->SetString("msg", |