| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_view_manager_base.h" | 5 #include "chrome/browser/printing/print_view_manager_base.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
| 11 #include "base/bind.h" | 11 #include "base/bind.h" |
| 12 #include "base/location.h" | 12 #include "base/location.h" |
| 13 #include "base/run_loop.h" |
| 13 #include "base/single_thread_task_runner.h" | 14 #include "base/single_thread_task_runner.h" |
| 14 #include "base/strings/utf_string_conversions.h" | 15 #include "base/strings/utf_string_conversions.h" |
| 15 #include "base/threading/thread_task_runner_handle.h" | 16 #include "base/threading/thread_task_runner_handle.h" |
| 16 #include "base/timer/timer.h" | 17 #include "base/timer/timer.h" |
| 17 #include "build/build_config.h" | 18 #include "build/build_config.h" |
| 18 #include "chrome/browser/browser_process.h" | 19 #include "chrome/browser/browser_process.h" |
| 19 #include "chrome/browser/chrome_notification_types.h" | 20 #include "chrome/browser/chrome_notification_types.h" |
| 20 #include "chrome/browser/printing/print_job.h" | 21 #include "chrome/browser/printing/print_job.h" |
| 21 #include "chrome/browser/printing/print_job_manager.h" | 22 #include "chrome/browser/printing/print_job_manager.h" |
| 22 #include "chrome/browser/printing/printer_query.h" | 23 #include "chrome/browser/printing/printer_query.h" |
| (...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 447 quit_timer.Start( | 448 quit_timer.Start( |
| 448 FROM_HERE, TimeDelta::FromMilliseconds(kPrinterSettingsTimeout), | 449 FROM_HERE, TimeDelta::FromMilliseconds(kPrinterSettingsTimeout), |
| 449 base::MessageLoop::current(), &base::MessageLoop::QuitWhenIdle); | 450 base::MessageLoop::current(), &base::MessageLoop::QuitWhenIdle); |
| 450 | 451 |
| 451 inside_inner_message_loop_ = true; | 452 inside_inner_message_loop_ = true; |
| 452 | 453 |
| 453 // Need to enable recursive task. | 454 // Need to enable recursive task. |
| 454 { | 455 { |
| 455 base::MessageLoop::ScopedNestableTaskAllower allow( | 456 base::MessageLoop::ScopedNestableTaskAllower allow( |
| 456 base::MessageLoop::current()); | 457 base::MessageLoop::current()); |
| 457 base::MessageLoop::current()->Run(); | 458 base::RunLoop().Run(); |
| 458 } | 459 } |
| 459 | 460 |
| 460 bool success = true; | 461 bool success = true; |
| 461 if (inside_inner_message_loop_) { | 462 if (inside_inner_message_loop_) { |
| 462 // Ok we timed out. That's sad. | 463 // Ok we timed out. That's sad. |
| 463 inside_inner_message_loop_ = false; | 464 inside_inner_message_loop_ = false; |
| 464 success = false; | 465 success = false; |
| 465 } | 466 } |
| 466 | 467 |
| 467 return success; | 468 return success; |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 521 scoped_refptr<PrinterQuery> printer_query; | 522 scoped_refptr<PrinterQuery> printer_query; |
| 522 printer_query = queue_->PopPrinterQuery(cookie); | 523 printer_query = queue_->PopPrinterQuery(cookie); |
| 523 if (!printer_query.get()) | 524 if (!printer_query.get()) |
| 524 return; | 525 return; |
| 525 BrowserThread::PostTask( | 526 BrowserThread::PostTask( |
| 526 BrowserThread::IO, FROM_HERE, | 527 BrowserThread::IO, FROM_HERE, |
| 527 base::Bind(&PrinterQuery::StopWorker, printer_query.get())); | 528 base::Bind(&PrinterQuery::StopWorker, printer_query.get())); |
| 528 } | 529 } |
| 529 | 530 |
| 530 } // namespace printing | 531 } // namespace printing |
| OLD | NEW |