Chromium Code Reviews| 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..acb8167bccf1cbe4d5c6c07b1f4958cc0d686608 100644 |
| --- a/chrome/browser/printing/printer_manager_dialog_win.cc |
| +++ b/chrome/browser/printing/printer_manager_dialog_win.cc |
| @@ -14,30 +14,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(OpenPrintersDialogTask)); |
|
Lei Zhang
2011/11/23 23:34:04
Do you need to #include "base/bind.h" here?
James Hawkins
2011/11/24 00:35:11
Done.
|
| } |
| } // namespace printing |