| Index: chrome/browser/printing/printer_manager_dialog_linux.cc
|
| diff --git a/chrome/browser/printing/printer_manager_dialog_linux.cc b/chrome/browser/printing/printer_manager_dialog_linux.cc
|
| index 156dda953d3779a70fe6bd5a6d6a733a682f966b..43736f963311359dc44af2ed075dbed092c2cf17 100644
|
| --- a/chrome/browser/printing/printer_manager_dialog_linux.cc
|
| +++ b/chrome/browser/printing/printer_manager_dialog_linux.cc
|
| @@ -9,15 +9,11 @@
|
| #include "base/bind.h"
|
| #include "base/environment.h"
|
| #include "base/files/file_util.h"
|
| -#include "base/message_loop/message_loop.h"
|
| #include "base/nix/xdg_util.h"
|
| #include "base/process/kill.h"
|
| #include "base/process/launch.h"
|
| -#include "base/strings/string_split.h"
|
| -#include "content/public/browser/browser_thread.h"
|
| -
|
| -using base::Environment;
|
| -using content::BrowserThread;
|
| +#include "base/task_scheduler/post_task.h"
|
| +#include "base/threading/thread_restrictions.h"
|
|
|
| namespace {
|
|
|
| @@ -49,8 +45,8 @@ bool OpenPrinterConfigDialog(const char* const* command) {
|
| // Detect the command based on the deskop environment and open the printer
|
| // manager dialog.
|
| void DetectAndOpenPrinterConfigDialog() {
|
| - DCHECK_CURRENTLY_ON(BrowserThread::FILE);
|
| - std::unique_ptr<Environment> env(Environment::Create());
|
| + base::ThreadRestrictions::AssertIOAllowed();
|
| + std::unique_ptr<base::Environment> env(base::Environment::Create());
|
|
|
| bool opened = false;
|
| switch (base::nix::GetDesktopEnvironment(env.get())) {
|
| @@ -73,13 +69,14 @@ void DetectAndOpenPrinterConfigDialog() {
|
| LOG_IF(ERROR, !opened) << "Failed to open printer manager dialog ";
|
| }
|
|
|
| -} // anonymous namespace
|
| +} // namespace
|
|
|
| namespace printing {
|
|
|
| void PrinterManagerDialog::ShowPrinterManagerDialog() {
|
| - BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE,
|
| - base::BindOnce(&DetectAndOpenPrinterConfigDialog));
|
| + base::PostTaskWithTraits(
|
| + FROM_HERE, {base::MayBlock(), base::TaskPriority::USER_BLOCKING},
|
| + base::BindOnce(&DetectAndOpenPrinterConfigDialog));
|
| }
|
|
|
| } // namespace printing
|
|
|