diff options
author | Jocelyn Turcotte <jocelyn.turcotte@digia.com> | 2013-07-26 17:39:58 +0200 |
---|---|---|
committer | Jocelyn Turcotte <jocelyn.turcotte@digia.com> | 2013-07-29 13:52:11 +0200 |
commit | 752008ad6b3e0c9acbd8d927ff6ff06a74a60ba2 (patch) | |
tree | 06e704b24c83fdf015509d28ef54f026dbe80b7c | |
parent | dcfabadeb3ea2fd439b013ef24c41c81780d802a (diff) |
Use command line switch identifiers instead of string constants.
Change-Id: I36007b0c0fbf194df1941e72ae2a93adf5ed6d0b
Reviewed-by: Andras Becsi <andras.becsi@digia.com>
-rw-r--r-- | lib/web_engine_context.cpp | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/lib/web_engine_context.cpp b/lib/web_engine_context.cpp index 0a3f28eb8..2982b2501 100644 --- a/lib/web_engine_context.cpp +++ b/lib/web_engine_context.cpp @@ -53,6 +53,7 @@ #include "content/public/app/content_main_runner.h" #include "content/public/browser/browser_main_runner.h" #include "content/public/common/content_paths.h" +#include "content/public/common/content_switches.h" #include "content/public/common/main_function_params.h" #include "webkit/common/user_agent/user_agent_util.h" @@ -114,23 +115,19 @@ WebEngineContext::WebEngineContext() Q_ASSERT(!sContext); sContext = this; - std::string ua = webkit_glue::BuildUserAgentFromProduct("QtWebEngine/0.1"); - QByteArray userAgentParameter("--user-agent="); - userAgentParameter.append(QString::fromStdString(ua).toUtf8()); - QList<QByteArray> args; Q_FOREACH (const QString& arg, QCoreApplication::arguments()) args << arg.toUtf8(); - args << userAgentParameter; - args << QByteArrayLiteral("--no-sandbox"); - args << QByteArrayLiteral("--disable-plugins"); - const char* argv[args.size()]; for (int i = 0; i < args.size(); ++i) argv[i] = args[i].constData(); - CommandLine::Init(args.size(), argv); + CommandLine* parsedCommandLine = CommandLine::ForCurrentProcess(); + parsedCommandLine->AppendSwitchASCII(switches::kUserAgent, webkit_glue::BuildUserAgentFromProduct("QtWebEngine/0.1")); + parsedCommandLine->AppendSwitch(switches::kNoSandbox); + parsedCommandLine->AppendSwitch(switches::kDisablePlugins); + m_contentRunner->Initialize(0, 0, m_mainDelegate.get()); m_browserRunner->Initialize(content::MainFunctionParams(*CommandLine::ForCurrentProcess())); |