Skip to content

Commit b40f4e1

Browse files
Pierre RossielProxy
Pierre Rossi
authored andcommitted
<chromium> Make localized_error work for us
Essentially cutting away the unnecessary part that depends on extensions. Change-Id: I8adbc77dca393ab8480e9cdea3c5c953b52c8aef Reviewed-by: Jocelyn Turcotte <[email protected]>
1 parent 0c80763 commit b40f4e1

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

chromium/chrome/common/localized_error.cc

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,12 @@
1111
#include "base/strings/string_util.h"
1212
#include "base/strings/utf_string_conversions.h"
1313
#include "base/values.h"
14+
#if !defined(TOOLKIT_QT)
1415
#include "chrome/common/extensions/extension_constants.h"
1516
#include "chrome/common/extensions/extension_icon_set.h"
1617
#include "chrome/common/extensions/extension_set.h"
1718
#include "chrome/common/extensions/manifest_handlers/icons_handler.h"
19+
#endif // !defined(TOOLKIT_QT)
1820
#include "chrome/common/net/net_error_info.h"
1921
#include "grit/chromium_strings.h"
2022
#include "grit/generated_resources.h"
@@ -30,6 +32,11 @@
3032
#include "base/win/windows_version.h"
3133
#endif
3234

35+
#if defined(TOOLKIT_QT)
36+
// Used to fetch the application name
37+
#include "web_engine_library_info.h"
38+
#endif
39+
3340
using blink::WebURLError;
3441

3542
// Some error pages have no details.
@@ -552,7 +559,11 @@ void LocalizedError::GetStrings(int error_code,
552559
summary->SetString("hostName", net::IDNToUnicode(failed_url.host(),
553560
accept_languages));
554561
summary->SetString("productName",
562+
#if !defined(TOOLKIT_QT)
555563
l10n_util::GetStringUTF16(IDS_PRODUCT_NAME));
564+
#else
565+
WebEngineLibraryInfo::getApplicationName());
566+
#endif
556567

557568
error_strings->SetString(
558569
"more", l10n_util::GetStringUTF16(IDS_ERRORPAGES_BUTTON_MORE));
@@ -787,6 +798,8 @@ bool LocalizedError::HasStrings(const std::string& error_domain,
787798
return LookupErrorMap(error_domain, error_code, /*is_post=*/false) != NULL;
788799
}
789800

801+
802+
#if !defined(TOOLKIT_QT)
790803
void LocalizedError::GetAppErrorStrings(
791804
const GURL& display_url,
792805
const extensions::Extension* app,
@@ -826,3 +839,4 @@ void LocalizedError::GetAppErrorStrings(
826839
error_strings->Set("suggestionsLearnMore", suggest_learn_more);
827840
#endif // defined(OS_CHROMEOS)
828841
}
842+
#endif // !defined(TOOLKIT_QT)

chromium/chrome/common/localized_error.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,11 @@ class LocalizedError {
4747
// on HTTP errors, like 404 or connection reset, but using information from
4848
// the associated |app| in order to make the error page look like it's more
4949
// part of the app.
50+
#if !defined(TOOLKIT_QT)
5051
static void GetAppErrorStrings(const GURL& display_url,
5152
const extensions::Extension* app,
5253
base::DictionaryValue* error_strings);
54+
#endif // !defined(TOOLKIT_QT)
5355

5456
static const char kHttpErrorDomain[];
5557

0 commit comments

Comments
 (0)