| 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 548501954cb7c15af88d8d04045eca5b99970d72..8c94d071acd5023df2b07108aaf54140fba870e3 100644
|
| --- a/chrome/browser/printing/printer_manager_dialog_win.cc
|
| +++ b/chrome/browser/printing/printer_manager_dialog_win.cc
|
| @@ -7,6 +7,7 @@
|
| #include <windows.h>
|
| #include <shellapi.h>
|
|
|
| +#include "base/bind.h"
|
| #include "base/file_path.h"
|
| #include "base/path_service.h"
|
| #include "base/threading/thread.h"
|
| @@ -14,30 +15,22 @@
|
|
|
| namespace printing {
|
|
|
| -// A helper method that opens the printer management dialog.
|
| -class OpenPrintersDialogTask : public Task {
|
| - public:
|
| - OpenPrintersDialogTask() {}
|
| -
|
| - virtual void Run() {
|
| - FilePath sys_dir;
|
| - PathService::Get(base::DIR_SYSTEM, &sys_dir);
|
| - FilePath rundll32 = sys_dir.AppendASCII("rundll32.exe");
|
| - FilePath shell32dll = sys_dir.AppendASCII("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);
|
| - }
|
| -
|
| - private:
|
| - DISALLOW_COPY_AND_ASSIGN(OpenPrintersDialogTask);
|
| -};
|
| +// A helper callback that opens the printer management dialog.
|
| +void OpenPrintersDialogCallback() {
|
| + FilePath sys_dir;
|
| + PathService::Get(base::DIR_SYSTEM, &sys_dir);
|
| + FilePath rundll32 = sys_dir.AppendASCII("rundll32.exe");
|
| + FilePath shell32dll = sys_dir.AppendASCII("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);
|
| +}
|
|
|
| void PrinterManagerDialog::ShowPrinterManagerDialog() {
|
| g_browser_process->file_thread()->message_loop()->PostTask(
|
| - FROM_HERE, new OpenPrintersDialogTask);
|
| + FROM_HERE, base::Bind(OpenPrintersDialogCallback));
|
| }
|
|
|
| } // namespace printing
|
|
|