summaryrefslogtreecommitdiffstats
path: root/src/core/net/plugin_response_interceptor_url_loader_throttle.h
diff options
context:
space:
mode:
authorSzabolcs David <davidsz@inf.u-szeged.hu>2021-02-04 14:48:52 +0100
committerSzabolcs David <davidsz@inf.u-szeged.hu>2021-03-06 08:28:04 +0100
commit8f56ea6806d9a72d4b705da5f6f90fa5a6873567 (patch)
treed4f5d01cde73e34973990ae5a5f3cb271516db15 /src/core/net/plugin_response_interceptor_url_loader_throttle.h
parent84104b7d100553c1550c525759ef6fb4446c31be (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/net/plugin_response_interceptor_url_loader_throttle.h')
-rw-r--r--src/core/net/plugin_response_interceptor_url_loader_throttle.h12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/core/net/plugin_response_interceptor_url_loader_throttle.h b/src/core/net/plugin_response_interceptor_url_loader_throttle.h
index 7b9db6490..205ab25e6 100644
--- a/src/core/net/plugin_response_interceptor_url_loader_throttle.h
+++ b/src/core/net/plugin_response_interceptor_url_loader_throttle.h
@@ -41,11 +41,11 @@
#define PLUGIN_RESPONSE_INTERCEPTOR_URL_LOADER_THROTTLE_H_
#include "base/macros.h"
+#include "base/memory/weak_ptr.h"
#include "third_party/blink/public/common/loader/url_loader_throttle.h"
namespace content {
class BrowserContext;
-class ResourceContext;
}
namespace QtWebEngineCore {
@@ -53,8 +53,6 @@ namespace QtWebEngineCore {
class PluginResponseInterceptorURLLoaderThrottle : public blink::URLLoaderThrottle
{
public:
- PluginResponseInterceptorURLLoaderThrottle(content::ResourceContext *resource_context,
- int resource_type, int frame_tree_node_id);
PluginResponseInterceptorURLLoaderThrottle(content::BrowserContext *browser_context,
int resource_type, int frame_tree_node_id);
~PluginResponseInterceptorURLLoaderThrottle() override = default;
@@ -63,11 +61,17 @@ private:
// content::URLLoaderThrottle overrides;
void WillProcessResponse(const GURL &response_url, network::mojom::URLResponseHead *response_head, bool *defer) override;
- content::ResourceContext *m_resource_context = nullptr;
+ // Resumes loading for an intercepted response. This would give the extension
+ // layer chance to initialize its browser side state.
+ void ResumeLoad();
+
content::BrowserContext *m_browser_context = nullptr;
const int m_resource_type;
const int m_frame_tree_node_id;
+ base::WeakPtrFactory<PluginResponseInterceptorURLLoaderThrottle>
+ weak_factory_{this};
+
DISALLOW_COPY_AND_ASSIGN(PluginResponseInterceptorURLLoaderThrottle);
};