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

Side by Side Diff: chrome/browser/printing/print_job_worker.cc

Issue 118338: Add support for printing selection only flag. This only adds the flag to the ... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/printing/print_job_worker.h ('k') | chrome/browser/printing/print_settings.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/printing/print_job_worker.h" 5 #include "chrome/browser/printing/print_job_worker.h"
6 6
7 #include "base/message_loop.h" 7 #include "base/message_loop.h"
8 #include "chrome/browser/printing/print_job.h" 8 #include "chrome/browser/printing/print_job.h"
9 #include "chrome/browser/printing/printed_document.h" 9 #include "chrome/browser/printing/printed_document.h"
10 #include "chrome/browser/printing/printed_page.h" 10 #include "chrome/browser/printing/printed_page.h"
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 DCHECK_EQ(owner_->message_loop(), MessageLoop::current()); 59 DCHECK_EQ(owner_->message_loop(), MessageLoop::current());
60 } 60 }
61 61
62 void PrintJobWorker::SetNewOwner(PrintJobWorkerOwner* new_owner) { 62 void PrintJobWorker::SetNewOwner(PrintJobWorkerOwner* new_owner) {
63 DCHECK(page_number_ == PageNumber::npos()); 63 DCHECK(page_number_ == PageNumber::npos());
64 owner_ = new_owner; 64 owner_ = new_owner;
65 } 65 }
66 66
67 void PrintJobWorker::GetSettings(bool ask_user_for_settings, 67 void PrintJobWorker::GetSettings(bool ask_user_for_settings,
68 HWND parent_window, 68 HWND parent_window,
69 int document_page_count) { 69 int document_page_count,
70 bool has_selection) {
70 DCHECK_EQ(message_loop(), MessageLoop::current()); 71 DCHECK_EQ(message_loop(), MessageLoop::current());
71 DCHECK_EQ(page_number_, PageNumber::npos()); 72 DCHECK_EQ(page_number_, PageNumber::npos());
72 73
73 // Recursive task processing is needed for the dialog in case it needs to be 74 // Recursive task processing is needed for the dialog in case it needs to be
74 // destroyed by a task. 75 // destroyed by a task.
75 MessageLoop::current()->SetNestableTasksAllowed(true); 76 MessageLoop::current()->SetNestableTasksAllowed(true);
76 77
77 PrintingContext::Result result; 78 PrintingContext::Result result;
78 if (ask_user_for_settings) { 79 if (ask_user_for_settings) {
79 result = printing_context_.AskUserForSettings(parent_window, 80 result = printing_context_.AskUserForSettings(parent_window,
80 document_page_count); 81 document_page_count,
82 has_selection);
81 } else { 83 } else {
82 result = printing_context_.UseDefaultSettings(); 84 result = printing_context_.UseDefaultSettings();
83 } 85 }
84 86
85 // Most PrintingContext functions may start a message loop and process 87 // Most PrintingContext functions may start a message loop and process
86 // message recursively, so disable recursive task processing. 88 // message recursively, so disable recursive task processing.
87 MessageLoop::current()->SetNestableTasksAllowed(false); 89 MessageLoop::current()->SetNestableTasksAllowed(false);
88 90
89 // We can't use OnFailure() here since owner_ may not support notifications. 91 // We can't use OnFailure() here since owner_ may not support notifications.
90 92
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
292 printing::PrintJobWorker* obj) { 294 printing::PrintJobWorker* obj) {
293 DCHECK(!owner_.get()); 295 DCHECK(!owner_.get());
294 owner_ = obj->owner_; 296 owner_ = obj->owner_;
295 } 297 }
296 298
297 void RunnableMethodTraits<printing::PrintJobWorker>::ReleaseCallee( 299 void RunnableMethodTraits<printing::PrintJobWorker>::ReleaseCallee(
298 printing::PrintJobWorker* obj) { 300 printing::PrintJobWorker* obj) {
299 DCHECK_EQ(owner_, obj->owner_); 301 DCHECK_EQ(owner_, obj->owner_);
300 owner_ = NULL; 302 owner_ = NULL;
301 } 303 }
OLDNEW
« no previous file with comments | « chrome/browser/printing/print_job_worker.h ('k') | chrome/browser/printing/print_settings.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698