diff options
Diffstat (limited to 'src/webenginequick/api/qquickwebengineview_p_p.h')
-rw-r--r-- | src/webenginequick/api/qquickwebengineview_p_p.h | 107 |
1 files changed, 22 insertions, 85 deletions
diff --git a/src/webenginequick/api/qquickwebengineview_p_p.h b/src/webenginequick/api/qquickwebengineview_p_p.h index 4647d671e..cf4da7c40 100644 --- a/src/webenginequick/api/qquickwebengineview_p_p.h +++ b/src/webenginequick/api/qquickwebengineview_p_p.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 #ifndef QQUICKWEBENGINEVIEW_P_P_H #define QQUICKWEBENGINEVIEW_P_P_H @@ -51,9 +15,11 @@ // We mean it. // +#include "qquickwebenginetouchhandle_p.h" #include "qquickwebengineview_p.h" #include "render_view_context_menu_qt.h" #include "touch_handle_drawable_client.h" +#include "ui_delegates_manager_p.h" #include "web_contents_adapter_client.h" #include <QtCore/qcompilerdetection.h> @@ -61,10 +27,9 @@ #include <QtCore/qscopedpointer.h> #include <QtCore/qsharedpointer.h> #include <QtCore/qstring.h> -#include <QtGui/qaccessibleobject.h> namespace QtWebEngineCore { -class RenderWidgetHostViewQtDelegateQuick; +class RenderWidgetHostViewQtDelegateItem; class TouchSelectionMenuController; class UIDelegatesManager; class WebContentsAdapter; @@ -72,7 +37,6 @@ class WebContentsAdapter; QT_BEGIN_NAMESPACE class QQmlComponent; -class QQuickWebEngineFaviconProvider; class QQuickWebEngineScriptCollection; class QQuickWebEngineSettings; class QQuickWebEngineView; @@ -80,7 +44,7 @@ class QWebEngineContextMenuRequest; class QWebEngineFindTextResult; class QWebEngineHistory; -class Q_WEBENGINEQUICK_PRIVATE_EXPORT QQuickWebEngineViewPrivate : public QtWebEngineCore::WebContentsAdapterClient +class Q_WEBENGINEQUICK_EXPORT QQuickWebEngineViewPrivate : public QtWebEngineCore::WebContentsAdapterClient { public: Q_DECLARE_PUBLIC(QQuickWebEngineView) @@ -103,6 +67,7 @@ public: void loadProgressChanged(int progress) override; void didUpdateTargetURL(const QUrl&) override; void selectionChanged() override; + void zoomUpdateIsNeeded() override; void recentlyAudibleChanged(bool recentlyAudible) override; void renderProcessPidChanged(qint64 pid) override; QRectF viewportRect() const override; @@ -122,9 +87,10 @@ public: void requestFullScreenMode(const QUrl &origin, bool fullscreen) override; bool isFullScreenMode() const override; void contextMenuRequested(QWebEngineContextMenuRequest *request) override; - void navigationRequested(int navigationType, const QUrl &url, bool &accepted, bool isMainFrame) override; + void navigationRequested(int navigationType, const QUrl &url, bool &accepted, bool isMainFrame, bool hasFrameData) override; void javascriptDialog(QSharedPointer<QtWebEngineCore::JavaScriptDialogController>) override; void runFileChooser(QSharedPointer<QtWebEngineCore::FilePickerController>) override; + void desktopMediaRequested(QtWebEngineCore::DesktopMediaController *) override; void showColorDialog(QSharedPointer<QtWebEngineCore::ColorChooserController>) override; void didRunJavaScript(quint64, const QVariant&) override; void didFetchDocumentMarkup(quint64, const QString&) override { } @@ -136,8 +102,8 @@ public: void authenticationRequired(QSharedPointer<QtWebEngineCore::AuthenticationDialogController>) override; void runMediaAccessPermissionRequest(const QUrl &securityOrigin, MediaRequestFlags requestFlags) override; void runMouseLockPermissionRequest(const QUrl &securityOrigin) override; - void runQuotaRequest(QWebEngineQuotaRequest) override; void runRegisterProtocolHandlerRequest(QWebEngineRegisterProtocolHandlerRequest) override; + void runFileSystemAccessRequest(QWebEngineFileSystemAccessRequest) override; QObject *accessibilityParentObject() override; QWebEngineSettings *webEngineSettings() const override; void allowCertificateError(const QWebEngineCertificateError &error) override; @@ -153,7 +119,7 @@ public: QObject *dragSource() const override; bool isEnabled() const override; void setToolTip(const QString &toolTipText) override; - QtWebEngineCore::TouchHandleDrawableClient *createTouchHandle(const QMap<int, QImage> &images) override; + QtWebEngineCore::TouchHandleDrawableDelegate *createTouchHandleDelegate(const QMap<int, QImage> &images) override; void showTouchSelectionMenu(QtWebEngineCore::TouchSelectionMenuController *, const QRect &, const QSize &) override; void hideTouchSelectionMenu() override; const QObject *holdingQObject() const override; @@ -163,6 +129,11 @@ public: QtWebEngineCore::WebContentsAdapter *webContentsAdapter() override; void printRequested() override; void findTextFinished(const QWebEngineFindTextResult &result) override; + void showAutofillPopup(QtWebEngineCore::AutofillPopupController *controller, + const QRect &bounds, bool autoselectFirstSuggestion) override; + void hideAutofillPopup() override; + void showWebAuthDialog(QWebEngineWebAuthUxRequest *request) override; + void updateAction(QQuickWebEngineView::WebAction) const; bool adoptWebContents(QtWebEngineCore::WebContentsAdapter *webContents); void setProfile(QQuickWebEngineProfile *profile); @@ -170,9 +141,9 @@ public: void ensureContentsAdapter(); void setFullScreenMode(bool); - static void bindViewAndWidget(QQuickWebEngineView *view, QtWebEngineCore::RenderWidgetHostViewQtDelegateQuick *widget); - void widgetChanged(QtWebEngineCore::RenderWidgetHostViewQtDelegateQuick *oldWidget, - QtWebEngineCore::RenderWidgetHostViewQtDelegateQuick *newWidget); + static void bindViewAndDelegateItem(QQuickWebEngineViewPrivate *viewPrivate, QtWebEngineCore::RenderWidgetHostViewQtDelegateItem *delegateItem); + void delegateItemChanged(QtWebEngineCore::RenderWidgetHostViewQtDelegateItem *oldDelegateItem, + QtWebEngineCore::RenderWidgetHostViewQtDelegateItem *newDelegateItem); QQuickWebEngineProfile *m_profile; QSharedPointer<QtWebEngineCore::WebContentsAdapter> adapter; @@ -186,8 +157,6 @@ public: bool m_fullscreenMode; bool isLoading; bool m_activeFocusOnPress; - bool m_navigationActionTriggered; - qreal devicePixelRatio; QMap<quint64, QJSValue> m_callbacks; QQmlWebChannel *m_webChannel; QPointer<QQuickWebEngineView> inspectedView; @@ -196,9 +165,10 @@ public: bool m_defaultAudioMuted; bool m_isBeingAdopted; mutable QQuickWebEngineAction *actions[QQuickWebEngineView::WebActionCount]; - QtWebEngineCore::RenderWidgetHostViewQtDelegateQuick *widget = nullptr; + QtWebEngineCore::RenderWidgetHostViewQtDelegateItem *delegateItem = nullptr; bool profileInitialized() const; + QQuickWebEngineScriptCollection *getUserScripts(); private: QScopedPointer<QtWebEngineCore::UIDelegatesManager> m_uIDelegatesManager; @@ -207,28 +177,8 @@ private: bool m_profileInitialized; QWebEngineContextMenuRequest *m_contextMenuRequest; QScopedPointer<QQuickWebEngineScriptCollection> m_scriptCollection; - QQuickWebEngineFaviconProvider *m_faviconProvider = nullptr; -}; - -#ifndef QT_NO_ACCESSIBILITY -class QQuickWebEngineViewAccessible : public QAccessibleObject -{ -public: - QQuickWebEngineViewAccessible(QQuickWebEngineView *o); - bool isValid() const override; - QAccessibleInterface *parent() const override; - QAccessibleInterface *focusChild() const override; - int childCount() const override; - QAccessibleInterface *child(int index) const override; - int indexOfChild(const QAccessibleInterface*) const override; - QString text(QAccessible::Text) const override; - QAccessible::Role role() const override; - QAccessible::State state() const override; - -private: - QQuickWebEngineView *engineView() const { return static_cast<QQuickWebEngineView*>(object()); } + QQmlComponent *m_touchHandleDelegate; }; -#endif // QT_NO_ACCESSIBILITY class QQuickContextMenuBuilder : public QtWebEngineCore::RenderViewContextMenuQt { @@ -248,19 +198,6 @@ private: QObject *m_menu; }; -class Q_WEBENGINEQUICK_PRIVATE_EXPORT QQuickWebEngineTouchHandle : public QtWebEngineCore::TouchHandleDrawableClient { -public: - QQuickWebEngineTouchHandle(QtWebEngineCore::UIDelegatesManager *ui, const QMap<int, QImage> &images); - - void setImage(int orientation) override; - void setBounds(const QRect &bounds) override; - void setVisible(bool visible) override; - void setOpacity(float opacity) override; - -private: - QScopedPointer<QQuickItem> m_item; -}; - QT_END_NAMESPACE #endif // QQUICKWEBENGINEVIEW_P_P_H |