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

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

Issue 603253003: Revert of Restored disable print preview policy. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 8c61e68d5eff7f343ecbecb8400f4c96d3425f69..43dd39ed7830b9ee9eaef2eb68bf45bba7d05564 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,21 +857,15 @@
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);
-
-#if defined(ENABLE_FULL_PRINTING)
- if (!browser->profile()->GetPrefs()->GetBoolean(
- prefs::kPrintPreviewDisabled)) {
- print_view_manager->PrintPreviewNow(false);
- return;
- }
-#endif // ENABLE_FULL_PRINTING
-
-#if !defined(DISABLE_BASIC_PRINTING)
+ print_view_manager->PrintPreviewNow(false);
+#else
+ printing::PrintViewManagerBasic* print_view_manager =
+ printing::PrintViewManagerBasic::FromWebContents(contents);
print_view_manager->PrintNow();
-#endif // DISABLE_BASIC_PRINTING
-
+#endif // defined(ENABLE_FULL_PRINTING)
#endif // defined(ENABLE_PRINTING)
}

Powered by Google App Engine
This is Rietveld 408576698