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

Unified Diff: chrome/browser/ui/browser_commands.cc

Issue 597933002: Restored disable print preview policy. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Wed Sep 24 10:32:18 PDT 2014 Created 6 years, 3 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/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)
}

Powered by Google App Engine
This is Rietveld 408576698