summaryrefslogtreecommitdiffstats
path: root/src/core/renderer/content_renderer_client_qt.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/renderer/content_renderer_client_qt.cpp')
-rw-r--r--src/core/renderer/content_renderer_client_qt.cpp34
1 files changed, 23 insertions, 11 deletions
diff --git a/src/core/renderer/content_renderer_client_qt.cpp b/src/core/renderer/content_renderer_client_qt.cpp
index bfc5c389f..e1333144a 100644
--- a/src/core/renderer/content_renderer_client_qt.cpp
+++ b/src/core/renderer/content_renderer_client_qt.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/legal
+** Copyright (C) 2015 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -10,15 +10,15 @@
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPLv3 included in the
-** packaging of this file. Please review the following information to
+** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
** will be met: https://www.gnu.org/licenses/lgpl.html.
**
@@ -26,7 +26,7 @@
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 2.0 or later as published by the Free
** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
+** the packaging of this file. Please review the following information to
** ensure the GNU General Public License version 2.0 requirements will be
** met: http://www.gnu.org/licenses/gpl-2.0.html.
**
@@ -38,6 +38,7 @@
#include "base/strings/utf_string_conversions.h"
#include "chrome/common/localized_error.h"
+#include "components/error_page/common/error_page_params.h"
#include "components/visitedlink/renderer/visitedlink_slave.h"
#include "content/public/renderer/render_frame.h"
#include "content/public/renderer/render_thread.h"
@@ -47,12 +48,16 @@
#include "third_party/WebKit/public/platform/WebURLRequest.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/base/webui/jstemplate_builder.h"
-#include "webkit/common/webpreferences.h"
+#include "content/public/common/web_preferences.h"
+#include "renderer/web_channel_ipc_transport.h"
#include "renderer/qt_render_view_observer.h"
+#include "renderer/user_script_controller.h"
#include "grit/renderer_resources.h"
+namespace QtWebEngineCore {
+
static const char kHttpErrorDomain[] = "http";
ContentRendererClientQt::ContentRendererClientQt()
@@ -65,14 +70,19 @@ ContentRendererClientQt::~ContentRendererClientQt()
void ContentRendererClientQt::RenderThreadStarted()
{
+ content::RenderThread *renderThread = content::RenderThread::Get();
+ renderThread->RegisterExtension(WebChannelIPCTransport::getV8Extension());
m_visitedLinkSlave.reset(new visitedlink::VisitedLinkSlave);
- content::RenderThread::Get()->AddObserver(m_visitedLinkSlave.data());
+ renderThread->AddObserver(m_visitedLinkSlave.data());
+ renderThread->AddObserver(UserScriptController::instance());
}
void ContentRendererClientQt::RenderViewCreated(content::RenderView* render_view)
{
- // RenderViewObserver destroys itself with its RenderView.
+ // RenderViewObservers destroy themselves with their RenderView.
new QtRenderViewObserver(render_view);
+ new WebChannelIPCTransport(render_view);
+ UserScriptController::instance()->renderViewCreated(render_view);
}
bool ContentRendererClientQt::HasErrorPage(int httpStatusCode, std::string *errorDomain)
@@ -107,7 +117,7 @@ void ContentRendererClientQt::GetNavigationErrorStrings(content::RenderView* ren
// NetErrorHelper::GetErrorStringsForDnsProbe, but that one is harder to untangle.
LocalizedError::GetStrings(error.reason, error.domain.utf8(), error.unreachableURL, isPost
, error.staleCopyInCache && !isPost, locale, renderView->GetAcceptLanguages()
- , scoped_ptr<LocalizedError::ErrorPageParams>(), &errorStrings);
+ , scoped_ptr<error_page::ErrorPageParams>(), &errorStrings);
resourceId = IDR_NET_ERROR_HTML;
@@ -131,3 +141,5 @@ bool ContentRendererClientQt::IsLinkVisited(unsigned long long linkHash)
{
return m_visitedLinkSlave->IsVisited(linkHash);
}
+
+} // namespace