Use OOPIF printing for extension/app pages
Some extension/app pages are hosted by guest views, which means they
have nested web contents. This CL checks nested web contents and always
use the outer contents to handle print requests so the entire content
can be printed correctly.
BUG=819583, 447941
Change-Id: I6b45f4867d13cf5141476a7e748e8c0e5d3b0996
Reviewed-on: https://chromium-review.googlesource.com/969949
Commit-Queue: Wei Li <[email protected]>
Reviewed-by: Alex Moshchuk <[email protected]>
Reviewed-by: Lei Zhang <[email protected]>
Cr-Commit-Position: refs/heads/master@{#545077}
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index d6e1ece..7e2efeb 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -4068,6 +4068,16 @@
const gfx::Rect& rect,
int document_cookie,
RenderFrameHost* subframe_host) {
+ auto* outer_contents = GetOuterWebContents();
+ if (outer_contents) {
+ // When an extension or app page is printed, the content should be
+ // composited with outer content, so the outer contents should handle the
+ // print request.
+ outer_contents->PrintCrossProcessSubframe(rect, document_cookie,
+ subframe_host);
+ return;
+ }
+
// If there is no delegate such as in tests or during deletion, do nothing.
if (!delegate_)
return;