Fixing RenderFrameHost::ViewSource() for ExtensionOptionsGuest.
After r512625, various ways of viewing page or frame source end up going through RenderFrameHost::ViewSource which depends on ability to present the view source WebContents to the user via WebContentsDelegate's AddNewContent method. This method was not overriden by ExtensionOptionsGuest, leading to https://crbug.com/796080. This CL fixes https://crbug.com/796080 by overriding ExtensionOptionsGuest::AddNewContent and making it forward the call to the embedder. This CL also adds a regression test for this scenario. Note that by default guest views cannot open new windows - this is blocked (unless the embedder explicitly allows this) and results in "<webview>: A new window was blocked." error message. This CL does not change this - window.open('<url>', '_blank') as well as <a target="_blank"...> in a guest view will continue to be blocked by default. I've tested this manually after temporarily overriding AddNewContent method higher in the class hierarchy - in GuestViewBase. See also https://crbug.com/796080#c7. A follow-up bug has been opened to investigate if AddNewContents method should instead be implemented in the base class of ExtensionOptionsGuest - in GuestViewBase: https://crbug.com/797340. Bug: 796080 Change-Id: I83ece7fc94bbf1005c5e2878159076949c48b076 Tbr: finnur@chromium.org or rdevlin.cronin@chromium.org Reviewed-on: https://chromium-review.googlesource.com/841623 Commit-Queue: Łukasz Anforowicz <lukasza@chromium.org> Reviewed-by:Lucas Gadani <lfg@chromium.org> Cr-Commit-Position: refs/heads/master@{#526041}
Showing
Please register or sign in to comment