summaryrefslogtreecommitdiffstats
path: root/chrome/renderer/mock_printer.cc
diff options
context:
space:
mode:
authorsverrir@google.com <sverrir@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-08 17:05:21 +0000
committersverrir@google.com <sverrir@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-08 17:05:21 +0000
commitc8ad40c6b02751c1cc942abe4ecaffbf68bfa611 (patch)
treed34b6d63f8a66fb06c3f87ce1914eefb755cf441 /chrome/renderer/mock_printer.cc
parenta91d541c58ad5e3b46309ee279bc569734a22564 (diff)
downloadchromium_src-c8ad40c6b02751c1cc942abe4ecaffbf68bfa611.zip
chromium_src-c8ad40c6b02751c1cc942abe4ecaffbf68bfa611.tar.gz
chromium_src-c8ad40c6b02751c1cc942abe4ecaffbf68bfa611.tar.bz2
Add support for printing selection only flag. This only adds the flag to the IPC and implements the Windows dialog interaction but does not enable this just yet.
BUG=http://crbug.com/1682 TEST=none Review URL: http://codereview.chromium.org/118338 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17867 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer/mock_printer.cc')
-rw-r--r--chrome/renderer/mock_printer.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/chrome/renderer/mock_printer.cc b/chrome/renderer/mock_printer.cc
index 88f9909..1b0dcc5 100644
--- a/chrome/renderer/mock_printer.cc
+++ b/chrome/renderer/mock_printer.cc
@@ -20,6 +20,7 @@ MockPrinter::MockPrinter()
max_shrink_(2.0),
min_shrink_(1.25),
desired_dpi_(72),
+ selection_only_(false),
document_cookie_(-1),
current_document_cookie_(0),
printer_status_(PRINTER_READY),
@@ -49,6 +50,7 @@ void MockPrinter::GetDefaultPrintSettings(ViewMsg_Print_Params* params) {
params->max_shrink = max_shrink_;
params->min_shrink = min_shrink_;
params->desired_dpi = desired_dpi_;
+ params->selection_only = selection_only_;
params->document_cookie = document_cookie_;
params->printable_size.set_width(printable_width_);
params->printable_size.set_height(printable_height_);
@@ -59,12 +61,14 @@ void MockPrinter::SetDefaultPrintSettings(const ViewMsg_Print_Params& params) {
max_shrink_ = params.max_shrink;
min_shrink_ = params.min_shrink;
desired_dpi_ = params.desired_dpi;
+ selection_only_ = params.selection_only;
printable_width_ = params.printable_size.width();
printable_height_ = params.printable_size.height();
}
void MockPrinter::ScriptedPrint(int cookie,
int expected_pages_count,
+ bool has_selection,
ViewMsg_PrintPages_Params* settings) {
// Verify the input parameters.
EXPECT_EQ(document_cookie_, cookie);
@@ -74,6 +78,7 @@ void MockPrinter::ScriptedPrint(int cookie,
settings->params.max_shrink = max_shrink_;
settings->params.min_shrink = min_shrink_;
settings->params.desired_dpi = desired_dpi_;
+ settings->params.selection_only = selection_only_;
settings->params.document_cookie = document_cookie_;
settings->params.printable_size.set_width(printable_width_);
settings->params.printable_size.set_height(printable_height_);