alloy: Fix printing of PDF viewer (see issue #3047)

Match the logic for printing::StartPrint() used by Chrome.
This commit is contained in:
Marshall Greenblatt
2022-02-18 11:33:40 -05:00
parent 34800dbe2e
commit 6eedb28faf
6 changed files with 67 additions and 58 deletions

View File

@ -15,7 +15,6 @@
#include "chrome/browser/browser_process.h"
#include "chrome/browser/printing/print_preview_dialog_controller.h"
#include "content/browser/browser_plugin/browser_plugin_embedder.h"
#include "content/browser/browser_plugin/browser_plugin_guest.h"
#include "content/browser/web_contents/web_contents_impl.h"
#include "content/public/browser/browser_context.h"
@ -36,21 +35,6 @@ bool InsertWebContents(std::vector<content::WebContents*>* vector,
} // namespace
content::WebContents* GetFullPageGuestForOwnerContents(
content::WebContents* owner) {
content::WebContentsImpl* owner_impl =
static_cast<content::WebContentsImpl*>(owner);
content::BrowserPluginEmbedder* plugin_embedder =
owner_impl->GetBrowserPluginEmbedder();
if (plugin_embedder) {
content::BrowserPluginGuest* plugin_guest =
plugin_embedder->GetFullPageGuest();
if (plugin_guest)
return plugin_guest->web_contents();
}
return nullptr;
}
void GetAllGuestsForOwnerContents(content::WebContents* owner,
std::vector<content::WebContents*>* guests) {
content::BrowserPluginGuestManager* plugin_guest_manager =