diff options
author | Szabolcs David <davidsz@inf.u-szeged.hu> | 2021-02-04 14:48:52 +0100 |
---|---|---|
committer | Szabolcs David <davidsz@inf.u-szeged.hu> | 2021-03-06 08:28:04 +0100 |
commit | 8f56ea6806d9a72d4b705da5f6f90fa5a6873567 (patch) | |
tree | d4f5d01cde73e34973990ae5a5f3cb271516db15 /src/core/web_contents_view_qt.cpp | |
parent | 84104b7d100553c1550c525759ef6fb4446c31be (diff) |
Show PDF viewer in a guest view
This is the basic support of guest views, implemented based
on Chrome.
- Embed PDF as a child frame instead of navigating to its
extension WebUI. Keep the original URL (pointing to the file) to
extend functionality of PDF viewer with URL parameters.
- Make RenderWidgetHostInputEventRouter to work and modify most of
the event forwarding logic to use that. This way WebEngine supports
pages with multiple RenderWidgetHost and guest views can be
interactive with user input.
[ChangeLog] PDF files are opened as embedded objects, WebEngine
will not navigate the content away from the requested file to
present it. PDF viewer can accept URL parameters (e.g. to control
zooming or fitting to view). Also, PDF viewer is interactive
when displayed in a subframe.
Task-number: QTBUG-80463
Task-number: QTBUG-86152
Task-number: QTBUG-90712
Change-Id: Ib1591fbd9a594891cdeace8e9dae0d3cc21a9f8e
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'src/core/web_contents_view_qt.cpp')
-rw-r--r-- | src/core/web_contents_view_qt.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/core/web_contents_view_qt.cpp b/src/core/web_contents_view_qt.cpp index 6c5e76742..900c53829 100644 --- a/src/core/web_contents_view_qt.cpp +++ b/src/core/web_contents_view_qt.cpp @@ -46,7 +46,6 @@ #include "render_widget_host_view_qt.h" #include "touch_selection_controller_client_qt.h" #include "type_conversion.h" -#include "web_contents_adapter_client.h" #include "web_contents_adapter.h" #include "web_engine_context.h" #include "web_contents_delegate_qt.h" @@ -195,7 +194,7 @@ ASSERT_ENUMS_MATCH(WebEngineContextMenuData::CanSelectAll, blink::kCanSelectAll) ASSERT_ENUMS_MATCH(WebEngineContextMenuData::CanTranslate, blink::kCanTranslate) ASSERT_ENUMS_MATCH(WebEngineContextMenuData::CanEditRichly, blink::kCanEditRichly) -static inline WebEngineContextMenuData fromParams(const content::ContextMenuParams ¶ms) +WebEngineContextMenuData WebContentsViewQt::buildContextMenuData(const content::ContextMenuParams ¶ms) { WebEngineContextMenuData ret; ret.setPosition(QPoint(params.x, params.y)); @@ -229,7 +228,7 @@ void WebContentsViewQt::ShowContextMenu(content::RenderFrameHost *, const conten return; } - WebEngineContextMenuData contextMenuData(fromParams(params)); + WebEngineContextMenuData contextMenuData(buildContextMenuData(params)); #if QT_CONFIG(webengine_spellchecker) // Do not use params.spellcheck_enabled, since it is never // correctly initialized for chrome asynchronous spellchecking. |