diff --git content/browser/web_contents/web_contents_view.h content/browser/web_contents/web_contents_view.h index 37cb1dac49610..6e5989c73bf08 100644 --- content/browser/web_contents/web_contents_view.h +++ content/browser/web_contents/web_contents_view.h @@ -26,7 +26,7 @@ struct DropData; // The `WebContentsView` is an interface that is implemented by the platform- // dependent web contents views. The `WebContents` uses this interface to talk // to them. -class WebContentsView { +class CONTENT_EXPORT WebContentsView { public: virtual ~WebContentsView() = default; diff --git extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.cc extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.cc index bd3bb10e2d6b1..0559c97775444 100644 --- extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.cc +++ extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.cc @@ -211,6 +211,8 @@ void MimeHandlerViewGuest::CreateInnerPage( WebContents::CreateParams params(browser_context(), guest_site_instance.get()); params.guest_delegate = this; + if (delegate_) + delegate_->OverrideWebContentsCreateParams(¶ms); std::move(callback).Run(std::move(owned_this), WebContents::CreateWithSessionStorage( params, owner_web_contents() diff --git extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest_delegate.h extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest_delegate.h index 2fb8a60c1f56d..edd275135e60d 100644 --- extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest_delegate.h +++ extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest_delegate.h @@ -7,6 +7,8 @@ #include +#include "content/public/browser/web_contents.h" + namespace content { class BrowserContext; class RenderFrameHost; @@ -26,6 +28,10 @@ class MimeHandlerViewGuestDelegate { virtual ~MimeHandlerViewGuestDelegate() {} + // Provides an opportunity to supply a custom view implementation. + virtual void OverrideWebContentsCreateParams( + content::WebContents::CreateParams* params) {} + // Handles context menu, or returns false if unhandled. // // The `render_frame_host` represents the frame that requests the context menu