diff options
Diffstat (limited to 'src/core/web_contents_adapter.h')
-rw-r--r-- | src/core/web_contents_adapter.h | 30 |
1 files changed, 27 insertions, 3 deletions
diff --git a/src/core/web_contents_adapter.h b/src/core/web_contents_adapter.h index 79aa68456..ab9ec5b81 100644 --- a/src/core/web_contents_adapter.h +++ b/src/core/web_contents_adapter.h @@ -109,6 +109,14 @@ public: void load(const QWebEngineHttpRequest &request); void setContent(const QByteArray &data, const QString &mimeType, const QUrl &baseUrl); + using LifecycleState = WebContentsAdapterClient::LifecycleState; + LifecycleState lifecycleState() const; + void setLifecycleState(LifecycleState state); + LifecycleState recommendedState() const; + + bool isVisible() const; + void setVisible(bool visible); + bool canGoBack() const; bool canGoForward() const; void stop(); @@ -155,7 +163,7 @@ public: ReferrerPolicy referrerPolicy = ReferrerPolicy::Default); bool isAudioMuted() const; void setAudioMuted(bool mute); - bool recentlyAudible(); + bool recentlyAudible() const; // Must match blink::WebMediaPlayerAction::Type. enum MediaPlayerAction { @@ -171,6 +179,8 @@ public: void inspectElementAt(const QPoint &location); bool hasInspector() const; + bool isInspector() const; + void setInspector(bool inspector); void exitFullScreen(); void requestClose(); void changedFullScreen(); @@ -178,8 +188,6 @@ public: void closeDevToolsFrontend(); void devToolsFrontendDestroyed(DevToolsFrontendQt *frontend); - void wasShown(); - void wasHidden(); void grantMediaAccessPermission(const QUrl &securityOrigin, WebContentsAdapterClient::MediaRequestFlags flags); void runGeolocationRequestCallback(const QUrl &securityOrigin, bool allowed); void grantMouseLockPermission(bool granted); @@ -221,12 +229,25 @@ public: // meant to be used within WebEngineCore only void initialize(content::SiteInstance *site); content::WebContents *webContents() const; + void updateRecommendedState(); private: Q_DISABLE_COPY(WebContentsAdapter) void waitForUpdateDragActionCalled(); bool handleDropDataFileContents(const content::DropData &dropData, QMimeData *mimeData); + void wasShown(); + void wasHidden(); + + LifecycleState determineRecommendedState() const; + + void freeze(); + void unfreeze(); + void discard(); + void undiscard(); + + void initializeRenderPrefs(); + ProfileAdapter *m_profileAdapter; std::unique_ptr<content::WebContents> m_webContents; std::unique_ptr<WebContentsDelegateQt> m_webContentsDelegate; @@ -246,6 +267,9 @@ private: QPointF m_lastDragScreenPos; std::unique_ptr<QTemporaryDir> m_dndTmpDir; DevToolsFrontendQt *m_devToolsFrontend; + LifecycleState m_lifecycleState = LifecycleState::Active; + LifecycleState m_recommendedState = LifecycleState::Active; + bool m_inspector = false; }; } // namespace QtWebEngineCore |