Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1973)

Unified Diff: chrome/browser/printing/printing_init.cc

Issue 2920013002: Use pdf compositor service for printing when OOPIF is enabled
Patch Set: rebase Created 3 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/printing/printing_init.cc
diff --git a/chrome/browser/printing/printing_init.cc b/chrome/browser/printing/printing_init.cc
new file mode 100644
index 0000000000000000000000000000000000000000..37562cc1213528caeac0a3c60e2ae6e8e6736a15
--- /dev/null
+++ b/chrome/browser/printing/printing_init.cc
@@ -0,0 +1,30 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/printing/printing_init.h"
+
+#include "components/printing/browser/print_manager_utils.h"
+#include "content/public/browser/web_contents.h"
+#include "printing/features/features.h"
+
+#if BUILDFLAG(ENABLE_PRINT_PREVIEW)
+#include "chrome/browser/printing/print_preview_message_handler.h"
+#include "chrome/browser/printing/print_view_manager.h"
+#else
+#include "chrome/browser/printing/print_view_manager_basic.h"
+#endif // BUILDFLAG(ENABLE_PRINT_PREVIEW)
+
+namespace printing {
+
+void InitializePrinting(content::WebContents* web_contents) {
+#if BUILDFLAG(ENABLE_PRINT_PREVIEW)
+ printing::PrintViewManager::CreateForWebContents(web_contents);
+ printing::PrintPreviewMessageHandler::CreateForWebContents(web_contents);
+#else
+ printing::PrintViewManagerBasic::CreateForWebContents(web_contents);
+#endif // BUILDFLAG(ENABLE_PRINT_PREVIEW)
+ CreateCompositeClientIfNeeded(web_contents);
+}
+
+} // namespace printing

Powered by Google App Engine
This is Rietveld 408576698