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

Unified Diff: chrome/browser/ui/webui/print_preview_handler.cc

Issue 6930034: Print Preview: Print in the background. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: fix build after r84303 Created 9 years, 8 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/webui/print_preview_handler.cc
===================================================================
--- chrome/browser/ui/webui/print_preview_handler.cc (revision 84344)
+++ chrome/browser/ui/webui/print_preview_handler.cc (working copy)
@@ -13,7 +13,9 @@
#include "base/threading/thread_restrictions.h"
#include "base/utf_string_conversions.h"
#include "base/values.h"
+#include "chrome/browser/browser_process.h"
#include "chrome/browser/platform_util.h"
+#include "chrome/browser/printing/background_printing_manager.h"
#include "chrome/browser/printing/printer_manager_dialog.h"
#include "chrome/browser/printing/print_preview_tab_controller.h"
#include "chrome/browser/ui/browser_list.h"
@@ -278,13 +280,13 @@
bool print_to_pdf = false;
settings->GetBoolean(printing::kSettingPrintToPDF, &print_to_pdf);
+ TabContentsWrapper* preview_tab_wrapper =
+ TabContentsWrapper::GetCurrentWrapperForContents(preview_tab());
+
if (print_to_pdf) {
// Pre-populating select file dialog with print job title.
- TabContentsWrapper* wrapper =
- TabContentsWrapper::GetCurrentWrapperForContents(preview_tab());
-
string16 print_job_title_utf16 =
- wrapper->print_view_manager()->RenderSourceName();
+ preview_tab_wrapper->print_view_manager()->RenderSourceName();
#if defined(OS_WIN)
FilePath::StringType print_job_title(print_job_title_utf16);
@@ -299,6 +301,9 @@
SelectFile(default_filename);
} else {
+ g_browser_process->background_printing_manager()->HideTabContents(
+ preview_tab_wrapper);
+
// The PDF being printed contains only the pages that the user selected,
// so ignore the page range and print all pages.
settings->Remove(printing::kSettingPageRange, NULL);

Powered by Google App Engine
This is Rietveld 408576698