diff options
author | Andras Becsi <andras.becsi@digia.com> | 2014-07-25 15:53:07 +0200 |
---|---|---|
committer | Andras Becsi <andras.becsi@digia.com> | 2014-08-06 17:20:17 +0200 |
commit | ca30d0374020752d3ac367fdffef88a5c1fe4a48 (patch) | |
tree | d93bb8ca51657febaee379e86c422d91b905a68b /src/core/web_contents_adapter_client.h | |
parent | 7d90b44187cfa8f93df6a6341da41cf8192d18ad (diff) |
Add QQuick API for intercepting navigation requests
Add missing navigationRequested API to be able to intercept
navigation requests. This is useful for ignoring requests
for example in kiosk-like applications that want to restrinct
navigation to a specific url or domain, or want to disable
specific types of navigation requests (e.g. reloading, clicking
links, form submissions).
Change-Id: Ie375e635a3c3566527972d05f5d99b39489c5ca8
Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
Diffstat (limited to 'src/core/web_contents_adapter_client.h')
-rw-r--r-- | src/core/web_contents_adapter_client.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/core/web_contents_adapter_client.h b/src/core/web_contents_adapter_client.h index f8f729f60..2dffb8fb5 100644 --- a/src/core/web_contents_adapter_client.h +++ b/src/core/web_contents_adapter_client.h @@ -110,6 +110,21 @@ public: Save }; + enum NavigationRequestAction { + AcceptRequest, + // Make room in the valid range of the enum for extra actions exposed in Experimental. + IgnoreRequest = 0xFF + }; + + enum NavigationType { + LinkClickedNavigation, + TypedNavigation, + FormSubmittedNavigation, + BackForwardNavigation, + ReloadNavigation, + OtherNavigation + }; + enum JavaScriptConsoleMessageLevel { Info = 0, Warning, @@ -144,6 +159,7 @@ public: virtual void adoptNewWindow(WebContentsAdapter *newWebContents, WindowOpenDisposition disposition, bool userGesture, const QRect & initialGeometry) = 0; virtual void close() = 0; virtual bool contextMenuRequested(const WebEngineContextMenuData&) = 0; + virtual void navigationRequested(int navigationType, const QUrl &url, int &navigationRequestAction, bool isMainFrame) = 0; virtual void requestFullScreen(bool) = 0; virtual bool isFullScreen() const = 0; virtual void javascriptDialog(QSharedPointer<JavaScriptDialogController>) = 0; |