From 437f9d8f59d8891eb20f3a5b83976b0d1b107464 Mon Sep 17 00:00:00 2001 From: "peter@pcc.me.uk" Date: Tue, 14 Feb 2012 03:58:06 +0000 Subject: GTK: implement "print selection". BUG=83481 TEST=mouse select text from http://en.wikipedia.org/wiki/Main_Page Toolbox -> Print -> Print to File -> Selection -> Print, verify that PDF contains only selection. Toolbox -> Print -> Print to File -> All Pages -> Print, verify that PDF contains all pages. Toolbox -> Print -> Print to File -> Pages: 1 -> Print, verify that PDF contains only page 1. Review URL: http://codereview.chromium.org/9379039 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@121844 0039d316-1c4b-4281-b951-d872f2087c98 --- printing/print_dialog_gtk_interface.h | 3 ++- printing/printing_context_gtk.cc | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'printing') diff --git a/printing/print_dialog_gtk_interface.h b/printing/print_dialog_gtk_interface.h index b63076e..41fafe0 100644 --- a/printing/print_dialog_gtk_interface.h +++ b/printing/print_dialog_gtk_interface.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -32,6 +32,7 @@ class PrintDialogGtkInterface { // Shows the dialog and handles the response with |callback|. Only used when // printing with the native print dialog. virtual void ShowDialog( + bool has_selection, const PrintingContextGtk::PrintSettingsCallback& callback) = 0; // Prints the document named |document_name| contained in |metafile|. diff --git a/printing/printing_context_gtk.cc b/printing/printing_context_gtk.cc index af97906..2e06c02 100644 --- a/printing/printing_context_gtk.cc +++ b/printing/printing_context_gtk.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -62,7 +62,7 @@ void PrintingContextGtk::AskUserForSettings( int max_pages, bool has_selection, const PrintSettingsCallback& callback) { - print_dialog_->ShowDialog(callback); + print_dialog_->ShowDialog(has_selection, callback); } PrintingContext::Result PrintingContextGtk::UseDefaultSettings() { -- cgit v1.1