summaryrefslogtreecommitdiffstats
path: root/src/core/content_main_delegate_qt.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/content_main_delegate_qt.cpp')
-rw-r--r--src/core/content_main_delegate_qt.cpp21
1 files changed, 17 insertions, 4 deletions
diff --git a/src/core/content_main_delegate_qt.cpp b/src/core/content_main_delegate_qt.cpp
index 2811d5545..dc32bb8c1 100644
--- a/src/core/content_main_delegate_qt.cpp
+++ b/src/core/content_main_delegate_qt.cpp
@@ -40,17 +40,18 @@
#include "content_main_delegate_qt.h"
#include "base/command_line.h"
-#include <base/i18n/rtl.h>
+#include "base/i18n/rtl.h"
#include "base/logging.h"
#include "base/path_service.h"
#include "base/strings/string_number_conversions.h"
-#include <chrome/grit/generated_resources.h>
+#include "chrome/grit/generated_resources.h"
+#include "content/public/browser/browser_main_runner.h"
#include "content/public/common/content_paths.h"
#include "content/public/common/content_switches.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/ui_base_paths.h"
#include "ui/base/resource/resource_bundle.h"
-#include <ui/base/webui/jstemplate_builder.h>
+#include "ui/base/webui/jstemplate_builder.h"
#include "net/grit/net_resources.h"
#include "net/base/net_module.h"
#include "services/service_manager/sandbox/switches.h"
@@ -59,6 +60,7 @@
#include "content_client_qt.h"
#include "renderer/content_renderer_client_qt.h"
#include "type_conversion.h"
+#include "web_engine_context.h"
#include "web_engine_library_info.h"
#if defined(ARCH_CPU_ARM_FAMILY) && (defined(OS_ANDROID) || defined(OS_LINUX))
@@ -71,6 +73,10 @@
#include <QtCore/qcoreapplication.h>
+namespace content {
+ContentClient *GetContentClient();
+}
+
namespace QtWebEngineCore {
// The logic of this function is based on chrome/common/net/net_resource_provider.cc
@@ -167,6 +173,12 @@ content::ContentBrowserClient *ContentMainDelegateQt::CreateContentBrowserClient
return m_browserClient.get();
}
+content::ContentGpuClient *ContentMainDelegateQt::CreateContentGpuClient()
+{
+ m_gpuClient.reset(new ContentGpuClientQt);
+ return m_gpuClient.get();
+}
+
content::ContentRendererClient *ContentMainDelegateQt::CreateContentRendererClient()
{
#if defined(OS_LINUX)
@@ -221,7 +233,8 @@ bool ContentMainDelegateQt::BasicStartupComplete(int *exit_code)
#if QT_CONFIG(webengine_spellchecker)
SafeOverridePath(base::DIR_APP_DICTIONARIES, WebEngineLibraryInfo::getPath(base::DIR_APP_DICTIONARIES));
#endif
- SetContentClient(new ContentClientQt);
+ if (!content::GetContentClient())
+ content::SetContentClient(new ContentClientQt);
url::CustomScheme::LoadSchemes(base::CommandLine::ForCurrentProcess());