| 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/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/environment.h" | 8 #include "base/environment.h" |
| 9 #include "base/nix/xdg_util.h" | 9 #include "base/nix/xdg_util.h" |
| 10 #include "base/process_util.h" | 10 #include "base/process_util.h" |
| 11 #include "content/common/process_watcher.h" | |
| 12 #include "content/public/browser/browser_thread.h" | 11 #include "content/public/browser/browser_thread.h" |
| 13 | 12 |
| 14 using base::Environment; | 13 using base::Environment; |
| 15 using content::BrowserThread; | 14 using content::BrowserThread; |
| 16 | 15 |
| 17 namespace { | 16 namespace { |
| 18 | 17 |
| 19 // KDE printer config command ("system-config-printer-kde") causes the | 18 // KDE printer config command ("system-config-printer-kde") causes the |
| 20 // OptionWidget to crash (https://bugs.kde.org/show_bug.cgi?id=271957). | 19 // OptionWidget to crash (https://bugs.kde.org/show_bug.cgi?id=271957). |
| 21 // Therefore, use GNOME printer config command for KDE. | 20 // Therefore, use GNOME printer config command for KDE. |
| (...skipping 25 matching lines...) Expand all Loading... |
| 47 return; | 46 return; |
| 48 } | 47 } |
| 49 | 48 |
| 50 std::vector<std::string> argv; | 49 std::vector<std::string> argv; |
| 51 argv.push_back(command); | 50 argv.push_back(command); |
| 52 base::ProcessHandle handle; | 51 base::ProcessHandle handle; |
| 53 if (!base::LaunchProcess(argv, base::LaunchOptions(), &handle)) { | 52 if (!base::LaunchProcess(argv, base::LaunchOptions(), &handle)) { |
| 54 LOG(ERROR) << "Failed to open printer manager dialog "; | 53 LOG(ERROR) << "Failed to open printer manager dialog "; |
| 55 return; | 54 return; |
| 56 } | 55 } |
| 57 ProcessWatcher::EnsureProcessGetsReaped(handle); | 56 base::EnsureProcessGetsReaped(handle); |
| 58 } | 57 } |
| 59 | 58 |
| 60 } // anonymous namespace | 59 } // anonymous namespace |
| 61 | 60 |
| 62 namespace printing { | 61 namespace printing { |
| 63 | 62 |
| 64 void PrinterManagerDialog::ShowPrinterManagerDialog() { | 63 void PrinterManagerDialog::ShowPrinterManagerDialog() { |
| 65 BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, | 64 BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, |
| 66 base::Bind(&DetectAndOpenPrinterConfigDialog)); | 65 base::Bind(&DetectAndOpenPrinterConfigDialog)); |
| 67 } | 66 } |
| 68 | 67 |
| 69 } // namespace printing | 68 } // namespace printing |
| OLD | NEW |