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::LaunchOptions options; | |
51 base::ProcessHandle handle; | 50 base::ProcessHandle handle; |
52 options.process_handle = &handle; | 51 if (!base::LaunchProcess(argv, base::LaunchOptions(), &handle)) { |
53 if (!base::LaunchProcess(argv, options)) { | |
54 LOG(ERROR) << "Failed to open printer manager dialog "; | 52 LOG(ERROR) << "Failed to open printer manager dialog "; |
55 return; | 53 return; |
56 } | 54 } |
57 ProcessWatcher::EnsureProcessGetsReaped(handle); | 55 ProcessWatcher::EnsureProcessGetsReaped(handle); |
58 } | 56 } |
59 | 57 |
60 } // anonymous namespace | 58 } // anonymous namespace |
61 | 59 |
62 namespace printing { | 60 namespace printing { |
63 | 61 |
64 void PrinterManagerDialog::ShowPrinterManagerDialog() { | 62 void PrinterManagerDialog::ShowPrinterManagerDialog() { |
65 BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, | 63 BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, |
66 NewRunnableFunction(&DetectAndOpenPrinterConfigDialog)); | 64 NewRunnableFunction(&DetectAndOpenPrinterConfigDialog)); |
67 } | 65 } |
68 | 66 |
69 } // namespace printing | 67 } // namespace printing |
OLD | NEW |