OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/printer_manager_dialog.h" | 5 #include "chrome/browser/printing/printer_manager_dialog.h" |
6 | 6 |
7 #include "base/environment.h" | 7 #include "base/environment.h" |
8 #include "base/nix/xdg_util.h" | 8 #include "base/nix/xdg_util.h" |
9 #include "base/process_util.h" | 9 #include "base/process_util.h" |
10 #include "content/browser/browser_thread.h" | 10 #include "content/browser/browser_thread.h" |
(...skipping 29 matching lines...) Expand all Loading... |
40 break; | 40 break; |
41 } | 41 } |
42 | 42 |
43 if (!command) { | 43 if (!command) { |
44 LOG(ERROR) << "Failed to detect the command to open printer config dialog"; | 44 LOG(ERROR) << "Failed to detect the command to open printer config dialog"; |
45 return; | 45 return; |
46 } | 46 } |
47 | 47 |
48 std::vector<std::string> argv; | 48 std::vector<std::string> argv; |
49 argv.push_back(command); | 49 argv.push_back(command); |
50 base::file_handle_mapping_vector no_files; | 50 base::LaunchOptions options; |
51 base::ProcessHandle handle; | 51 base::ProcessHandle handle; |
52 if (!base::LaunchApp(argv, no_files, false, &handle)) { | 52 options.process_handle = &handle; |
| 53 if (!base::LaunchProcess(argv, options)) { |
53 LOG(ERROR) << "Failed to open printer manager dialog "; | 54 LOG(ERROR) << "Failed to open printer manager dialog "; |
54 return; | 55 return; |
55 } | 56 } |
56 ProcessWatcher::EnsureProcessGetsReaped(handle); | 57 ProcessWatcher::EnsureProcessGetsReaped(handle); |
57 } | 58 } |
58 | 59 |
59 } // anonymous namespace | 60 } // anonymous namespace |
60 | 61 |
61 namespace printing { | 62 namespace printing { |
62 | 63 |
63 void PrinterManagerDialog::ShowPrinterManagerDialog() { | 64 void PrinterManagerDialog::ShowPrinterManagerDialog() { |
64 BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, | 65 BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, |
65 NewRunnableFunction(&DetectAndOpenPrinterConfigDialog)); | 66 NewRunnableFunction(&DetectAndOpenPrinterConfigDialog)); |
66 } | 67 } |
67 | 68 |
68 } // namespace printing | 69 } // namespace printing |
OLD | NEW |