| Index: chrome/browser/printing/printer_manager_dialog_linux.cc
|
| diff --git a/chrome/browser/printing/printer_manager_dialog_linux.cc b/chrome/browser/printing/printer_manager_dialog_linux.cc
|
| index 48b891dd811462a6001eee262284760ee0715d7d..29ee3f353556071f7f187bce2512e6a711ecda73 100644
|
| --- a/chrome/browser/printing/printer_manager_dialog_linux.cc
|
| +++ b/chrome/browser/printing/printer_manager_dialog_linux.cc
|
| @@ -30,28 +30,11 @@ const char* const kSystemConfigPrinterCommand[] = {"system-config-printer",
|
| const char* const kGnomeControlCenterPrintersCommand[] = {
|
| "gnome-control-center", "printers", nullptr};
|
|
|
| -bool CommandExists(const char* command) {
|
| - std::unique_ptr<base::Environment> env(base::Environment::Create());
|
| - std::string path;
|
| - if (!env->GetVar("PATH", &path)) {
|
| - LOG(ERROR) << "No $PATH variable. Assuming no " << command << ".";
|
| - return false;
|
| - }
|
| -
|
| - for (const base::StringPiece& cur_path :
|
| - base::SplitStringPiece(path, ":", base::KEEP_WHITESPACE,
|
| - base::SPLIT_WANT_NONEMPTY)) {
|
| - base::FilePath file(cur_path);
|
| - if (base::PathExists(file.Append(command)))
|
| - return true;
|
| - }
|
| - return false;
|
| -}
|
| -
|
| // Returns true if the dialog was opened successfully.
|
| bool OpenPrinterConfigDialog(const char* const* command) {
|
| DCHECK(command);
|
| - if (!CommandExists(*command))
|
| + std::unique_ptr<base::Environment> env(base::Environment::Create());
|
| + if (!base::ExecutableExistsInPath(env.get(), *command))
|
| return false;
|
| std::vector<std::string> argv;
|
| while (*command)
|
|
|