Chromium Code Reviews

Unified Diff: chrome/browser/tab_contents/tab_contents.cc

Issue 4338001: Implement print preview tab controller. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: '' Created 10 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
« no previous file with comments | « chrome/browser/renderer_host/render_view_host.cc ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 b6bc9aed107ae87f601a55bc76df495d911bc83c..2a8c4df4123220ced107cf0bccef5c944309460f 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"
@@ -1351,8 +1352,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() {
« no previous file with comments | « chrome/browser/renderer_host/render_view_host.cc ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine