From 8227045e458705c27ca116a02fd7b9b9a75237ae Mon Sep 17 00:00:00 2001 From: "sverrir@google.com" Date: Fri, 19 Jun 2009 15:58:01 +0000 Subject: Add Print Selection support to Chrome. This change is fairly involved since this means that the printing is done async instead of the fully synchronous mode the normal full page printing is. This means we create an in memory copy of the selected text for printing. This is the next step to move to fully async printing with print frame support. This change also removes the print on demand functionality that was no longer used. BUG=http://crbug.com/1682 TEST=The print dialog on Windows now contains an option to print selection only. Test that with various pages and various selections. Review URL: http://codereview.chromium.org/125082 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18815 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/printing/print_job_worker.cc | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) (limited to 'chrome/browser/printing/print_job_worker.cc') diff --git a/chrome/browser/printing/print_job_worker.cc b/chrome/browser/printing/print_job_worker.cc index 19c2add..af32da0 100644 --- a/chrome/browser/printing/print_job_worker.cc +++ b/chrome/browser/printing/print_job_worker.cc @@ -50,7 +50,7 @@ class PrintJobWorker::NotificationTask : public Task { PrintJobWorker::PrintJobWorker(PrintJobWorkerOwner* owner) : Thread("Printing_Worker"), owner_(owner) { - // The object is created in the UI thread. + // The object is created in the IO thread. DCHECK_EQ(owner_->message_loop(), MessageLoop::current()); } @@ -167,7 +167,7 @@ void PrintJobWorker::OnNewPage() { // Is the page available? scoped_refptr page; if (!document_->GetPage(page_number_.ToInt(), &page)) { - // The page is implictly requested. + // The page is implicitly requested. break; } // The page is there, print it. @@ -192,21 +192,6 @@ void PrintJobWorker::DismissDialog() { printing_context_.DismissDialog(); } -void PrintJobWorker::RequestMissingPages() { - DCHECK_EQ(message_loop(), MessageLoop::current()); - // It may arrive out of order. Don't mind about it. - if (page_number_ != PageNumber::npos()) { - // We are printing. - document_->RequestMissingPages(); - } - NotificationTask* task = new NotificationTask(); - task->Init(owner_, - JobEventDetails::ALL_PAGES_REQUESTED, - document_.get(), - NULL); - owner_->message_loop()->PostTask(FROM_HERE, task); -} - void PrintJobWorker::OnDocumentDone() { DCHECK_EQ(message_loop(), MessageLoop::current()); DCHECK_EQ(page_number_, PageNumber::npos()); -- cgit v1.1