Commit 703f7cce authored by Lei Zhang's avatar Lei Zhang Committed by Commit Bot

Remove unneeded PDF compositor client creation.

The WebContents for the Print Preview dialog does not perform PDF
compositing. Only web pages renderers do.

Also clean up print_manager_utils.h.

Change-Id: I2875858d6c9513a6d920ab8ad9b603e06751ea77
Reviewed-on: https://chromium-review.googlesource.com/1182864
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: default avatarWei Li <weili@chromium.org>
Cr-Commit-Position: refs/heads/master@{#584876}
parent c99df134
......@@ -29,7 +29,6 @@
#include "chrome/common/chrome_paths.h"
#include "chrome/common/url_constants.h"
#include "components/guest_view/browser/guest_view_base.h"
#include "components/printing/browser/print_manager_utils.h"
#include "components/web_modal/web_contents_modal_dialog_host.h"
#include "content/public/browser/host_zoom_map.h"
#include "content/public/browser/navigation_controller.h"
......@@ -377,7 +376,6 @@ WebContents* PrintPreviewDialogController::CreatePrintPreviewDialog(
content::HostZoomMap::Get(preview_dialog->GetSiteInstance())
->SetZoomLevelForHostAndScheme(print_url.scheme(), print_url.host(), 0);
PrintViewManager::CreateForWebContents(preview_dialog);
CreateCompositeClientIfNeeded(preview_dialog);
extensions::ChromeExtensionWebContentsObserver::CreateForWebContents(
preview_dialog);
......
......@@ -4,25 +4,26 @@
#include "components/printing/browser/print_manager_utils.h"
#include "base/command_line.h"
#include "components/printing/browser/features.h"
#include "components/printing/browser/print_composite_client.h"
#include "components/printing/common/print_messages.h"
#include "content/public/browser/site_isolation_policy.h"
#include "content/public/common/content_features.h"
#include "content/public/common/content_switches.h"
#include "printing/print_settings.h"
namespace printing {
namespace {
// A temporary flag which makes supporting both paths for OOPIF and non-OOPIF
// printing easier.
static bool g_oopif_enabled = false;
bool g_oopif_enabled = false;
void SetOopifEnabled() {
g_oopif_enabled = true;
}
} // namespace
bool IsOopifEnabled() {
return g_oopif_enabled;
}
......@@ -36,7 +37,7 @@ void CreateCompositeClientIfNeeded(content::WebContents* web_contents) {
// compositor service by default for printing.
if (content::SiteIsolationPolicy::ShouldPdfCompositorBeEnabledForOopifs() ||
base::FeatureList::IsEnabled(
printing::features::kUsePdfCompositorServiceForPrint)) {
features::kUsePdfCompositorServiceForPrint)) {
PrintCompositeClient::CreateForWebContents(web_contents);
SetOopifEnabled();
}
......
......@@ -15,7 +15,6 @@ namespace printing {
class PrintSettings;
void SetOopifEnabled(bool enabled);
bool IsOopifEnabled();
// Check on the current feature settings to decide whether we need to
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment