Index: chrome/browser/tab_contents/tab_contents.cc |
diff --git a/chrome/browser/tab_contents/tab_contents.cc b/chrome/browser/tab_contents/tab_contents.cc |
index d9522e17f7de9b233f66ce3f7d4ee6f51f66a924..6c88b0dac233733d6de5df660c843190e7bc84c5 100644 |
--- a/chrome/browser/tab_contents/tab_contents.cc |
+++ b/chrome/browser/tab_contents/tab_contents.cc |
@@ -59,6 +59,7 @@ |
#include "chrome/browser/platform_util.h" |
#include "chrome/browser/plugin_installer.h" |
#include "chrome/browser/prefs/pref_service.h" |
+#include "chrome/browser/printing/print_preview_tab_controller.h" |
#include "chrome/browser/printing/print_view_manager.h" |
#include "chrome/browser/profile.h" |
#include "chrome/browser/renderer_host/render_process_host.h" |
@@ -1352,8 +1353,14 @@ void TabContents::EmailPageLocation() { |
} |
void TabContents::PrintPreview() { |
- // We don't show the print preview yet, only the print dialog. |
- PrintNow(); |
+ if (CommandLine::ForCurrentProcess()->HasSwitch( |
+ switches::kEnablePrintPreview)) { |
+ if (showing_interstitial_page()) |
+ return; |
+ render_view_host()->PrintPreview(); |
+ } else { |
+ PrintNow(); |
+ } |
} |
bool TabContents::PrintNow() { |