summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierre Rossi <pierre.rossi@digia.com>2014-07-01 18:38:59 +0200
committerPierre Rossi <pierre.rossi@gmail.com>2014-07-30 21:44:07 +0200
commitb40f4e1cc18f65716e455152d347d9a35f49e7de (patch)
tree6fe51b0e038601f404c69ba206441ddb196df9fb
parent0c80763a1dd1b58d85d37207f4d783ffcf799b36 (diff)
downloadqtwebengine-chromium-b40f4e1cc18f65716e455152d347d9a35f49e7de.tar.gz
<chromium> Make localized_error work for us
Essentially cutting away the unnecessary part that depends on extensions. Change-Id: I8adbc77dca393ab8480e9cdea3c5c953b52c8aef Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
-rw-r--r--chromium/chrome/common/localized_error.cc14
-rw-r--r--chromium/chrome/common/localized_error.h2
2 files changed, 16 insertions, 0 deletions
diff --git a/chromium/chrome/common/localized_error.cc b/chromium/chrome/common/localized_error.cc
index 4a90c898c4b..60f6108029d 100644
--- a/chromium/chrome/common/localized_error.cc
+++ b/chromium/chrome/common/localized_error.cc
@@ -11,10 +11,12 @@
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
#include "base/values.h"
+#if !defined(TOOLKIT_QT)
#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/extensions/manifest_handlers/icons_handler.h"
+#endif // !defined(TOOLKIT_QT)
#include "chrome/common/net/net_error_info.h"
#include "grit/chromium_strings.h"
#include "grit/generated_resources.h"
@@ -30,6 +32,11 @@
#include "base/win/windows_version.h"
#endif
+#if defined(TOOLKIT_QT)
+// Used to fetch the application name
+#include "web_engine_library_info.h"
+#endif
+
using blink::WebURLError;
// Some error pages have no details.
@@ -552,7 +559,11 @@ void LocalizedError::GetStrings(int error_code,
summary->SetString("hostName", net::IDNToUnicode(failed_url.host(),
accept_languages));
summary->SetString("productName",
+#if !defined(TOOLKIT_QT)
l10n_util::GetStringUTF16(IDS_PRODUCT_NAME));
+#else
+ WebEngineLibraryInfo::getApplicationName());
+#endif
error_strings->SetString(
"more", l10n_util::GetStringUTF16(IDS_ERRORPAGES_BUTTON_MORE));
@@ -787,6 +798,8 @@ bool LocalizedError::HasStrings(const std::string& error_domain,
return LookupErrorMap(error_domain, error_code, /*is_post=*/false) != NULL;
}
+
+#if !defined(TOOLKIT_QT)
void LocalizedError::GetAppErrorStrings(
const GURL& display_url,
const extensions::Extension* app,
@@ -826,3 +839,4 @@ void LocalizedError::GetAppErrorStrings(
error_strings->Set("suggestionsLearnMore", suggest_learn_more);
#endif // defined(OS_CHROMEOS)
}
+#endif // !defined(TOOLKIT_QT)
diff --git a/chromium/chrome/common/localized_error.h b/chromium/chrome/common/localized_error.h
index a68407fada5..401adf2026d 100644
--- a/chromium/chrome/common/localized_error.h
+++ b/chromium/chrome/common/localized_error.h
@@ -47,9 +47,11 @@ class LocalizedError {
// on HTTP errors, like 404 or connection reset, but using information from
// the associated |app| in order to make the error page look like it's more
// part of the app.
+#if !defined(TOOLKIT_QT)
static void GetAppErrorStrings(const GURL& display_url,
const extensions::Extension* app,
base::DictionaryValue* error_strings);
+#endif // !defined(TOOLKIT_QT)
static const char kHttpErrorDomain[];