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

Unified Diff: chrome/browser/printing/printing_message_filter.cc

Issue 10836330: Rasterize page before printing. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 4 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
« no previous file with comments | « no previous file | chrome/common/chrome_switches.h » ('j') | chrome/common/chrome_switches.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/printing/printing_message_filter.cc
diff --git a/chrome/browser/printing/printing_message_filter.cc b/chrome/browser/printing/printing_message_filter.cc
index c5250805c731b1e75ce67c2ff2b1ebd70bf73c80..bf72b357fd87dcddd69cdf428ef052f864f3b93f 100644
--- a/chrome/browser/printing/printing_message_filter.cc
+++ b/chrome/browser/printing/printing_message_filter.cc
@@ -7,7 +7,10 @@
#include <string>
#include "base/bind.h"
+#include "base/command_line.h"
#include "base/process_util.h"
+#include "base/string_number_conversions.h"
+#include "chrome/common/chrome_switches.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/printing/printer_query.h"
#include "chrome/browser/printing/print_job_manager.h"
@@ -72,6 +75,22 @@ void RenderParamsFromPrintSettings(const printing::PrintSettings& settings,
params->selection_only = settings.selection_only;
params->supports_alpha_blend = settings.supports_alpha_blend();
+ const CommandLine* cmdline = CommandLine::ForCurrentProcess();
+ if (cmdline) {
+ if (cmdline->HasSwitch(switches::kPrintRaster))
+ params->raster_type = PrintMsg_Print_Params::RASTER_ALL;
+ else if (cmdline->HasSwitch(switches::kPrintRasterPlugins))
+ params->raster_type = PrintMsg_Print_Params::RASTER_PLUGINS;
Albert Bodenhamer 2012/08/20 18:18:10 Do we need different modes? Is there a need to ha
Vitaly Buka (NO REVIEWS) 2012/08/21 19:40:54 Done.
+ else
+ params->raster_type = PrintMsg_Print_Params::RASTER_NONE;
+ int raster_size = 0;
+ if (base::StringToInt(cmdline->GetSwitchValueASCII(switches::kPrintRasterSize),
Albert Bodenhamer 2012/08/20 18:18:10 Line len
Vitaly Buka (NO REVIEWS) 2012/08/21 19:40:54 Done.
+ &raster_size) &&
+ raster_size > 0) {
+ params->raster_size = raster_size;
Albert Bodenhamer 2012/08/20 18:18:10 I'm reluctant to make the size settable. Can we c
Vitaly Buka (NO REVIEWS) 2012/08/21 19:40:54 Done.
+ }
+ }
+
params->display_header_footer = settings.display_header_footer;
if (!settings.display_header_footer)
return;
« no previous file with comments | « no previous file | chrome/common/chrome_switches.h » ('j') | chrome/common/chrome_switches.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698