| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/printing/printing_init.h" | 5 #include "chrome/browser/printing/printing_init.h" |
| 6 | 6 |
| 7 #include "components/printing/browser/print_manager_utils.h" |
| 7 #include "content/public/browser/web_contents.h" | 8 #include "content/public/browser/web_contents.h" |
| 8 #include "printing/features/features.h" | 9 #include "printing/features/features.h" |
| 9 | 10 |
| 10 #if BUILDFLAG(ENABLE_PRINT_PREVIEW) | 11 #if BUILDFLAG(ENABLE_PRINT_PREVIEW) |
| 11 #include "chrome/browser/printing/print_preview_message_handler.h" | 12 #include "chrome/browser/printing/print_preview_message_handler.h" |
| 12 #include "chrome/browser/printing/print_view_manager.h" | 13 #include "chrome/browser/printing/print_view_manager.h" |
| 13 #else | 14 #else |
| 14 #include "chrome/browser/printing/print_view_manager_basic.h" | 15 #include "chrome/browser/printing/print_view_manager_basic.h" |
| 15 #endif // BUILDFLAG(ENABLE_PRINT_PREVIEW) | 16 #endif // BUILDFLAG(ENABLE_PRINT_PREVIEW) |
| 16 | 17 |
| 17 namespace printing { | 18 namespace printing { |
| 18 | 19 |
| 19 void InitializePrinting(content::WebContents* web_contents) { | 20 void InitializePrinting(content::WebContents* web_contents) { |
| 20 #if BUILDFLAG(ENABLE_PRINT_PREVIEW) | 21 #if BUILDFLAG(ENABLE_PRINT_PREVIEW) |
| 21 printing::PrintViewManager::CreateForWebContents(web_contents); | 22 printing::PrintViewManager::CreateForWebContents(web_contents); |
| 22 printing::PrintPreviewMessageHandler::CreateForWebContents(web_contents); | 23 printing::PrintPreviewMessageHandler::CreateForWebContents(web_contents); |
| 23 #else | 24 #else |
| 24 printing::PrintViewManagerBasic::CreateForWebContents(web_contents); | 25 printing::PrintViewManagerBasic::CreateForWebContents(web_contents); |
| 25 #endif // BUILDFLAG(ENABLE_PRINT_PREVIEW) | 26 #endif // BUILDFLAG(ENABLE_PRINT_PREVIEW) |
| 27 CreateCompositeClientIfNeeded(web_contents); |
| 26 } | 28 } |
| 27 | 29 |
| 28 } // namespace printing | 30 } // namespace printing |
| OLD | NEW |