diff options
Diffstat (limited to 'src/core/web_contents_adapter.h')
-rw-r--r-- | src/core/web_contents_adapter.h | 61 |
1 files changed, 22 insertions, 39 deletions
diff --git a/src/core/web_contents_adapter.h b/src/core/web_contents_adapter.h index 26cfa1b64..a5cad8664 100644 --- a/src/core/web_contents_adapter.h +++ b/src/core/web_contents_adapter.h @@ -1,41 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** 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 The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://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.LGPL3 included in the -** 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-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ +// Copyright (C) 2016 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only // // W A R N I N G @@ -59,10 +23,12 @@ #include <QtWebEngineCore/private/qtwebenginecoreglobal_p.h> #include <QtWebEngineCore/qwebenginecontextmenurequest.h> #include <QtWebEngineCore/qwebenginehttprequest.h> +#include <QtWebEngineCore/qwebengineframe.h> #include "web_contents_adapter_client.h" #include <memory> +#include <optional> namespace blink { namespace web_pref { @@ -96,8 +62,11 @@ class ProfileQt; class WebEnginePageHost; class WebChannelIPCTransportHost; -class Q_WEBENGINECORE_PRIVATE_EXPORT WebContentsAdapter : public QEnableSharedFromThis<WebContentsAdapter> { +class Q_WEBENGINECORE_EXPORT WebContentsAdapter : public QEnableSharedFromThis<WebContentsAdapter> { public: + // Sentinel to indicate a frame doesn't exist, for example with `findFrameByName` + static constexpr quint64 kInvalidFrameId = -3; + static QSharedPointer<WebContentsAdapter> createFromSerializedNavigationHistory(QDataStream &input, WebContentsAdapterClient *adapterClient); WebContentsAdapter(); WebContentsAdapter(std::unique_ptr<content::WebContents> webContents); @@ -195,6 +164,7 @@ public: void openDevToolsFrontend(QSharedPointer<WebContentsAdapter> devtoolsFrontend); void closeDevToolsFrontend(); void devToolsFrontendDestroyed(DevToolsFrontendQt *frontend); + QString devToolsId(); void grantMediaAccessPermission(const QUrl &securityOrigin, WebContentsAdapterClient::MediaRequestFlags flags); void grantMouseLockPermission(const QUrl &securityOrigin, bool granted); @@ -208,6 +178,7 @@ public: #if QT_CONFIG(webengine_webchannel) QWebChannel *webChannel() const; void setWebChannel(QWebChannel *, uint worldId); + WebChannelIPCTransportHost *webChannelTransport() { return m_webChannelTransport.get(); } #endif FindTextHelper *findTextHelper(); @@ -235,10 +206,22 @@ public: bool isFindTextInProgress() const; bool hasFocusedFrame() const; void resetSelection(); + void resetTouchSelectionController(); + void changeTextDirection(bool leftToRight); + + quint64 mainFrameId() const; + QString frameName(quint64 id) const; + QString frameHtmlName(quint64 id) const; + QList<quint64> frameChildren(quint64 id) const; + QUrl frameUrl(quint64 id) const; + QSizeF frameSize(quint64 id) const; + std::optional<quint64> findFrameIdByName(const QString &name) const; + bool hasFrame(quint64 id) const; // meant to be used within WebEngineCore only void initialize(content::SiteInstance *site); content::WebContents *webContents() const; + content::WebContents *guestWebContents() const; void updateRecommendedState(); void setRequestInterceptor(QWebEngineUrlRequestInterceptor *interceptor); QWebEngineUrlRequestInterceptor* requestInterceptor() const; |