Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(543)

Unified Diff: chrome/renderer/localized_error.cc

Issue 8142032: Add error description to the DidFailProvisionalLoad callback. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Created 9 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/renderer/localized_error.cc
diff --git a/chrome/renderer/localized_error.cc b/chrome/renderer/localized_error.cc
index b6e8f7804391af7d93239d51296ccd3aaefd6323..8ff3d18af7854234f19189ae00ab27f0ea2dd4b6 100644
--- a/chrome/renderer/localized_error.cc
+++ b/chrome/renderer/localized_error.cc
@@ -608,6 +608,15 @@ void LocalizedError::GetStrings(const WebKit::WebURLError& error,
}
}
+string16 LocalizedError::GetErrorDetails(const WebKit::WebURLError& error) {
+ const LocalizedErrorMap* error_map =
+ LookupErrorMap(error.domain.utf8(), error.reason);
+ if (error_map)
+ return l10n_util::GetStringUTF16(error_map->details_resource_id);
+ else
+ return l10n_util::GetStringUTF16(IDS_ERRORPAGES_DETAILS_UNKNOWN);
+}
+
bool LocalizedError::HasStrings(const std::string& error_domain,
int error_code) {
return LookupErrorMap(error_domain, error_code) != NULL;

Powered by Google App Engine
This is Rietveld 408576698