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

Unified Diff: chrome/browser/printing/printer_manager_dialog_win.cc

Issue 2965803002: Move more printing code off of the FILE thread. (Closed)
Patch Set: tweak Created 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/printing/printer_manager_dialog_linux.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/printing/printer_manager_dialog_win.cc
diff --git a/chrome/browser/printing/printer_manager_dialog_win.cc b/chrome/browser/printing/printer_manager_dialog_win.cc
index 5e71976ebb12018648da9799cd30191e53526d3e..983dea7ba645b4dc87bebb5951779b5cc02d1102 100644
--- a/chrome/browser/printing/printer_manager_dialog_win.cc
+++ b/chrome/browser/printing/printer_manager_dialog_win.cc
@@ -10,31 +10,31 @@
#include "base/bind.h"
#include "base/files/file_path.h"
#include "base/path_service.h"
+#include "base/task_scheduler/post_task.h"
#include "base/threading/thread.h"
-#include "chrome/browser/browser_process.h"
-#include "content/public/browser/browser_thread.h"
-using content::BrowserThread;
-
-namespace printing {
+namespace {
// A helper callback that opens the printer management dialog.
void OpenPrintersDialogCallback() {
base::FilePath sys_dir;
PathService::Get(base::DIR_SYSTEM, &sys_dir);
- base::FilePath rundll32 = sys_dir.AppendASCII("rundll32.exe");
- base::FilePath shell32dll = sys_dir.AppendASCII("shell32.dll");
+ base::FilePath rundll32 = sys_dir.Append(L"rundll32.exe");
+ base::FilePath shell32dll = sys_dir.Append(L"shell32.dll");
std::wstring args(shell32dll.value());
args.append(L",SHHelpShortcuts_RunDLL PrintersFolder");
- ShellExecute(NULL, L"open", rundll32.value().c_str(), args.c_str(), NULL,
- SW_SHOWNORMAL);
+ ShellExecute(nullptr, L"open", rundll32.value().c_str(), args.c_str(),
+ nullptr, SW_SHOWNORMAL);
}
+} // namespace
+
+namespace printing {
+
void PrinterManagerDialog::ShowPrinterManagerDialog() {
- BrowserThread::PostTask(
- BrowserThread::FILE,
- FROM_HERE,
+ base::PostTaskWithTraits(
+ FROM_HERE, {base::MayBlock(), base::TaskPriority::USER_BLOCKING},
base::Bind(OpenPrintersDialogCallback));
}
« no previous file with comments | « chrome/browser/printing/printer_manager_dialog_linux.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698