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

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: Made code changes as per comments. Created 10 years, 1 month 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/tab_contents/tab_contents.cc
diff --git a/chrome/browser/tab_contents/tab_contents.cc b/chrome/browser/tab_contents/tab_contents.cc
index 91995c7829025d3a802fc3a1db9d96bb80c85db2..917512e4223f9439ce6c7ef8873be6eb3f7ce7c4 100644
--- a/chrome/browser/tab_contents/tab_contents.cc
+++ b/chrome/browser/tab_contents/tab_contents.cc
@@ -61,6 +61,7 @@
#include "chrome/browser/plugin_installer.h"
#include "chrome/browser/prefs/pref_service.h"
#include "chrome/browser/printing/print_view_manager.h"
+#include "chrome/browser/printing/print_preview_tab_controller.h"
Lei Zhang 2010/11/12 23:17:18 nit: (again) alphabetical order
kmadhusu 2010/11/13 00:05:59 Done.
#include "chrome/browser/profile.h"
#include "chrome/browser/renderer_host/render_process_host.h"
#include "chrome/browser/renderer_host/render_view_host.h"
@@ -1353,8 +1354,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() {

Powered by Google App Engine
This is Rietveld 408576698