diff options
author | Jocelyn Turcotte <jocelyn.turcotte@digia.com> | 2014-04-01 10:27:13 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-04-08 14:00:06 +0200 |
commit | 84f31c11b77a62212451cb77adae63219e06de96 (patch) | |
tree | 97d252eee0ee8716d1a7165cd714b0d5b9552ebb /src/webenginewidgets/render_widget_host_view_qt_delegate_webpage.cpp | |
parent | 3cb5203cb7a4bee9a867e8616c23ce635d6a8506 (diff) |
Revert part of the RenderWidgetHostViewQtDelegate refactoring
This reverts parts of commit 9c198939be1ef064d1a2430a4b9991f2fe16f359.
This does keeps the popup fixes and removes support for
QWebEnginePage::setViewportSize and QWebEnginePage::render until
we can evaluate the needs vs the cost of such feature.
Change-Id: I1b55b751d463717b1462393ea8cd353422f8fdbb
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/webenginewidgets/render_widget_host_view_qt_delegate_webpage.cpp')
-rw-r--r-- | src/webenginewidgets/render_widget_host_view_qt_delegate_webpage.cpp | 162 |
1 files changed, 0 insertions, 162 deletions
diff --git a/src/webenginewidgets/render_widget_host_view_qt_delegate_webpage.cpp b/src/webenginewidgets/render_widget_host_view_qt_delegate_webpage.cpp deleted file mode 100644 index e8a3e7d44..000000000 --- a/src/webenginewidgets/render_widget_host_view_qt_delegate_webpage.cpp +++ /dev/null @@ -1,162 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the QtWebEngine module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** 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. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 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 -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "render_widget_host_view_qt_delegate_webpage.h" - -#include "qwebengineview.h" -#include "qwebenginepage.h" -#include "qwebenginepage_p.h" -#include <QtGlobal> -#include <QResizeEvent> -#include <QPainter> -#include <QPaintEvent> -#include <QWindow> -#include <QtWidgets/QApplication> - -RenderWidgetHostViewQtDelegateWebPage::RenderWidgetHostViewQtDelegateWebPage(RenderWidgetHostViewQtDelegateClient *client) - : m_client(client) - , m_page(0) - , m_pagePrivate(0) -{ -} - -void RenderWidgetHostViewQtDelegateWebPage::initAsChild(WebContentsAdapterClient* container) -{ - m_pagePrivate = static_cast<QWebEnginePagePrivate *>(container); - m_pagePrivate->m_rwhvDelegate = this; - m_page = m_pagePrivate->q_func(); - Q_ASSERT(m_page); -} - -QRectF RenderWidgetHostViewQtDelegateWebPage::screenRect() const -{ - if (m_pagePrivate) - return m_pagePrivate->viewportRect(); - // FIXME: figure out what to do with QWebFrame::contentsSize vs. preferedContentsSize - return QRectF(0, 0, 800, 600); -} - -void RenderWidgetHostViewQtDelegateWebPage::setKeyboardFocus() -{ - if (m_page) - m_page->setFocus(); -} - -bool RenderWidgetHostViewQtDelegateWebPage::hasKeyboardFocus() -{ - return m_page && m_page->hasFocus(); -} - -bool RenderWidgetHostViewQtDelegateWebPage::isVisible() const -{ - if (m_page && m_page->view()) - return m_page->view()->isVisible(); - return false; -} - -QWindow* RenderWidgetHostViewQtDelegateWebPage::window() const -{ - if (!m_page || !m_page->view()) - return Q_NULLPTR; - return m_page->view()->window()->windowHandle(); -} - -void RenderWidgetHostViewQtDelegateWebPage::update(const QRect& rect) -{ - if (m_page->view()) - m_page->view()->update(rect); -} - -void RenderWidgetHostViewQtDelegateWebPage::updateCursor(const QCursor &cursor) -{ - if (m_page->view()) - m_page->view()->setCursor(cursor); -} - -void RenderWidgetHostViewQtDelegateWebPage::resize(int width, int height) -{ - Q_UNUSED(width) - Q_UNUSED(height) - QT_NOT_YET_IMPLEMENTED; -} - -void RenderWidgetHostViewQtDelegateWebPage::inputMethodStateChanged(bool editorVisible) -{ - if (qApp->inputMethod()->isVisible() == editorVisible) - return; - - if (m_page && m_page->view()) - m_page->view()->setAttribute(Qt::WA_InputMethodEnabled, editorVisible); - qApp->inputMethod()->update(Qt::ImQueryInput | Qt::ImEnabled | Qt::ImHints); - qApp->inputMethod()->setVisible(editorVisible); -} - -QVariant RenderWidgetHostViewQtDelegateWebPage::inputMethodQuery(Qt::InputMethodQuery query) const -{ - return m_client->inputMethodQuery(query); -} - -bool RenderWidgetHostViewQtDelegateWebPage::supportsHardwareAcceleration() const -{ - return false; -} - -void RenderWidgetHostViewQtDelegateWebPage::setTooltip(const QString &tooltip) -{ - if (m_page && m_page->view()) - m_page->view()->setToolTip(tooltip); -} - -void RenderWidgetHostViewQtDelegateWebPage::paint(QPainter *painter, const QRectF &boundingRect) -{ - m_client->fetchBackingStore(); - m_client->paint(painter, boundingRect); -} - -void RenderWidgetHostViewQtDelegateWebPage::notifyResize() -{ - m_client->notifyResize(); -} - -bool RenderWidgetHostViewQtDelegateWebPage::forwardEvent(QEvent *event) -{ - return m_client->forwardEvent(event); -} |