| OLD | NEW |
| 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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 DCHECK_EQ(message_loop(), MessageLoop::current()); | 70 if (ask_user_for_settings) { |
| 71 // No way to retrieve the ui (browser) message loop. |
| 72 // DCHECK_EQ(ui_message_loop_, MessageLoop::current()); |
| 73 } else { |
| 74 DCHECK_EQ(message_loop(), MessageLoop::current()); |
| 75 } |
| 71 DCHECK_EQ(page_number_, PageNumber::npos()); | 76 DCHECK_EQ(page_number_, PageNumber::npos()); |
| 72 | 77 |
| 73 // Recursive task processing is needed for the dialog in case it needs to be | 78 // Recursive task processing is needed for the dialog in case it needs to be |
| 74 // destroyed by a task. | 79 // destroyed by a task. |
| 75 MessageLoop::current()->SetNestableTasksAllowed(true); | 80 MessageLoop::current()->SetNestableTasksAllowed(true); |
| 76 | 81 |
| 77 PrintingContext::Result result; | 82 PrintingContext::Result result; |
| 78 if (ask_user_for_settings) { | 83 if (ask_user_for_settings) { |
| 79 result = printing_context_.AskUserForSettings(parent_window, | 84 result = printing_context_.AskUserForSettings(parent_window, |
| 80 document_page_count); | 85 document_page_count); |
| (...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 292 printing::PrintJobWorker* obj) { | 297 printing::PrintJobWorker* obj) { |
| 293 DCHECK(!owner_.get()); | 298 DCHECK(!owner_.get()); |
| 294 owner_ = obj->owner_; | 299 owner_ = obj->owner_; |
| 295 } | 300 } |
| 296 | 301 |
| 297 void RunnableMethodTraits<printing::PrintJobWorker>::ReleaseCallee( | 302 void RunnableMethodTraits<printing::PrintJobWorker>::ReleaseCallee( |
| 298 printing::PrintJobWorker* obj) { | 303 printing::PrintJobWorker* obj) { |
| 299 DCHECK_EQ(owner_, obj->owner_); | 304 DCHECK_EQ(owner_, obj->owner_); |
| 300 owner_ = NULL; | 305 owner_ = NULL; |
| 301 } | 306 } |
| OLD | NEW |