Index: chrome/browser/ui/browser_commands.cc |
diff --git a/chrome/browser/ui/browser_commands.cc b/chrome/browser/ui/browser_commands.cc |
index 43dd39ed7830b9ee9eaef2eb68bf45bba7d05564..8e0963153ede4fbbef77d8d2dc31d96fcc8c0771 100644 |
--- a/chrome/browser/ui/browser_commands.cc |
+++ b/chrome/browser/ui/browser_commands.cc |
@@ -95,9 +95,9 @@ |
#endif |
#if defined(ENABLE_PRINTING) |
+#include "chrome/browser/printing/print_view_manager.h" |
#if defined(ENABLE_FULL_PRINTING) |
#include "chrome/browser/printing/print_preview_dialog_controller.h" |
-#include "chrome/browser/printing/print_view_manager.h" |
#else |
#include "chrome/browser/printing/print_view_manager_basic.h" |
#endif // defined(ENABLE_FULL_PRINTING) |
@@ -857,15 +857,20 @@ void ShowWebsiteSettings(Browser* browser, |
void Print(Browser* browser) { |
#if defined(ENABLE_PRINTING) |
WebContents* contents = browser->tab_strip_model()->GetActiveWebContents(); |
-#if defined(ENABLE_FULL_PRINTING) |
printing::PrintViewManager* print_view_manager = |
printing::PrintViewManager::FromWebContents(contents); |
- print_view_manager->PrintPreviewNow(false); |
-#else |
- printing::PrintViewManagerBasic* print_view_manager = |
- printing::PrintViewManagerBasic::FromWebContents(contents); |
+ |
+#if defined(ENABLE_FULL_PRINTING) |
+ if (!browser->profile()->GetPrefs()->GetBoolean(prefs::kPrintPreviewDisabled)) { |
Lei Zhang
2014/09/24 17:53:42
nit: over 80 char / line
Vitaly Buka (NO REVIEWS)
2014/09/24 18:07:03
Done.
|
+ print_view_manager->PrintPreviewNow(false); |
+ return; |
+ } |
+#endif // ENABLE_FULL_PRINTING |
+ |
+#if !defined(DISABLE_BASIC_PRINTING) |
print_view_manager->PrintNow(); |
-#endif // defined(ENABLE_FULL_PRINTING) |
+#endif // DISABLE_BASIC_PRINTING |
+ |
#endif // defined(ENABLE_PRINTING) |
} |