summaryrefslogtreecommitdiffstats
path: root/src/core/content_browser_client_qt.cpp
diff options
context:
space:
mode:
authorPeter Varga <pvarga@inf.u-szeged.hu>2015-04-22 17:00:09 +0200
committerPeter Varga <pvarga@inf.u-szeged.hu>2015-04-23 07:58:07 +0000
commit611734729f590623455965017567ec7c9db4f9a4 (patch)
treeffc855ce13ab9ce10af4b16541582944fe0027e5 /src/core/content_browser_client_qt.cpp
parentd7ee26965f5fac77e8609c1d812198421023c11c (diff)
Force to use English language for QML auto tests
Moreover, localization setting via QtWebEngine is fixed. System localization setting can be overridden by --lang command line argument. Task-number: QTBUG-45715 Change-Id: I39f3a891e55ee47a57afc394e849ea02b0c76ad5 Reviewed-by: Andras Becsi <andras.becsi@theqtcompany.com> Reviewed-by: Pierre Rossi <pierre.rossi@theqtcompany.com>
Diffstat (limited to 'src/core/content_browser_client_qt.cpp')
-rw-r--r--src/core/content_browser_client_qt.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/core/content_browser_client_qt.cpp b/src/core/content_browser_client_qt.cpp
index 60ca493ca..3d318047b 100644
--- a/src/core/content_browser_client_qt.cpp
+++ b/src/core/content_browser_client_qt.cpp
@@ -48,8 +48,10 @@
#include "content/public/browser/render_view_host.h"
#include "content/public/browser/resource_dispatcher_host.h"
#include "content/public/browser/web_contents.h"
+#include "content/public/common/content_switches.h"
#include "content/public/common/main_function_params.h"
#include "content/public/common/url_constants.h"
+#include "ui/base/ui_base_switches.h"
#include "ui/gfx/screen.h"
#include "ui/gl/gl_context.h"
#include "ui/gl/gl_implementation.h"
@@ -69,6 +71,7 @@
#include "resource_dispatcher_host_delegate_qt.h"
#include "user_script_controller_host.h"
#include "web_contents_delegate_qt.h"
+#include "web_engine_library_info.h"
#include <QGuiApplication>
#include <QLocale>
@@ -441,7 +444,16 @@ content::LocationProvider *ContentBrowserClientQt::OverrideSystemLocationProvide
std::string ContentBrowserClientQt::GetApplicationLocale()
{
- return QLocale().bcp47Name().toStdString();
+ return WebEngineLibraryInfo::getApplicationLocale();
+}
+
+void ContentBrowserClientQt::AppendExtraCommandLineSwitches(base::CommandLine* command_line, int child_process_id)
+{
+ Q_UNUSED(child_process_id);
+
+ std::string processType = command_line->GetSwitchValueASCII(switches::kProcessType);
+ if (processType == switches::kZygoteProcess)
+ command_line->AppendSwitchASCII(switches::kLang, GetApplicationLocale());
}
content::DevToolsManagerDelegate* ContentBrowserClientQt::GetDevToolsManagerDelegate()