summaryrefslogtreecommitdiffstats
path: root/src/core/content_browser_client_qt.cpp
diff options
context:
space:
mode:
authorKirill Burtsev <kirill.burtsev@qt.io>2021-06-24 20:57:21 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2021-07-21 19:15:33 +0000
commit90888e4835f80f278c612a2e7d5797e915767f56 (patch)
tree78cdebb3a1619f3e130d4b401db6e86809da1311 /src/core/content_browser_client_qt.cpp
parentb9d99df607648953e4d0a97a04eaabdbe0d10c3b (diff)
WebEngineNavigationRequest: add accept/reject and deprecate setAction
Match naming with others and use accept/reject methods to handle request. Also, allow to use request object after call scope in QML. [ChangeLog][QWebEngineQuick][WebEngineNavigationRequest] setAction(action) is deprecated in favor of new accept/reject methods Change-Id: I83252370e2e83017008f6951f98b7ecad119e232 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> (cherry picked from commit 13254e7950a032ebbeb11b1cf54b850c8326fb30) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src/core/content_browser_client_qt.cpp')
-rw-r--r--src/core/content_browser_client_qt.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/core/content_browser_client_qt.cpp b/src/core/content_browser_client_qt.cpp
index bb349bf43..f580e6f77 100644
--- a/src/core/content_browser_client_qt.cpp
+++ b/src/core/content_browser_client_qt.cpp
@@ -818,7 +818,7 @@ static bool navigationThrottleCallback(content::WebContents *source,
if (!view->client())
return false;
- int navigationRequestAction = WebContentsAdapterClient::AcceptRequest;
+ bool navigationAccepted = true;
WebContentsAdapterClient *client =
WebContentsViewQt::from(static_cast<content::WebContentsImpl *>(source)->GetView())->client();
@@ -832,9 +832,9 @@ static bool navigationThrottleCallback(content::WebContents *source,
client->navigationRequested(pageTransitionToNavigationType(transition_type),
toQt(params.url()),
- navigationRequestAction,
+ navigationAccepted,
params.is_main_frame());
- return navigationRequestAction == static_cast<int>(WebContentsAdapterClient::IgnoreRequest);
+ return !navigationAccepted;
}
std::vector<std::unique_ptr<content::NavigationThrottle>> ContentBrowserClientQt::CreateThrottlesForNavigation(