| Index: chrome/browser/printing/print_view_manager.cc
|
| diff --git a/chrome/browser/printing/print_view_manager.cc b/chrome/browser/printing/print_view_manager.cc
|
| index 6afd07b443725b2bb3b55f195554bbb458a5b643..dadead97afbf3135274ded98b3fe7e5d853f4202 100644
|
| --- a/chrome/browser/printing/print_view_manager.cc
|
| +++ b/chrome/browser/printing/print_view_manager.cc
|
| @@ -14,6 +14,7 @@
|
| #include "chrome/browser/printing/print_preview_dialog_controller.h"
|
| #include "chrome/browser/ui/webui/print_preview/print_preview_ui.h"
|
| #include "chrome/common/chrome_content_client.h"
|
| +#include "components/guest_view/browser/guest_view_base.h"
|
| #include "components/printing/common/print_messages.h"
|
| #include "content/public/browser/browser_thread.h"
|
| #include "content/public/browser/plugin_service.h"
|
| @@ -21,6 +22,7 @@
|
| #include "content/public/browser/render_process_host.h"
|
| #include "content/public/browser/web_contents.h"
|
| #include "content/public/common/webplugininfo.h"
|
| +#include "extensions/common/constants.h"
|
| #include "printing/features/features.h"
|
|
|
| using content::BrowserThread;
|
| @@ -127,6 +129,14 @@ void PrintViewManager::PrintPreviewForWebNode() {
|
| if (print_preview_state_ != NOT_PREVIEWING)
|
| return;
|
| print_preview_state_ = USER_INITIATED_PREVIEW;
|
| + // If this is a PDF extension loaded inside a MimeHandlerViewGuest then we are
|
| + // here due to clicking on print button inside the PDF extension. We should
|
| + // use the main frame of the WebContents for print preview.
|
| + if (guest_view::GuestViewBase::FromWebContents(web_contents()) &&
|
| + web_contents()->GetLastCommittedURL().host() ==
|
| + extension_misc::kPdfExtensionId) {
|
| + print_preview_rfh_ = web_contents()->GetMainFrame();
|
| + }
|
| }
|
|
|
| void PrintViewManager::PrintPreviewDone() {
|
|
|