| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #if !defined(OS_CHROMEOS) | 5 #if !defined(OS_CHROMEOS) |
| 6 | 6 |
| 7 #include "chrome/browser/ui/webui/options/advanced_options_utils.h" | 7 #include "chrome/browser/ui/webui/options/advanced_options_utils.h" |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/environment.h" | 10 #include "base/environment.h" |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 std::string path; | 75 std::string path; |
| 76 if (!env->GetVar("PATH", &path)) { | 76 if (!env->GetVar("PATH", &path)) { |
| 77 LOG(ERROR) << "No $PATH variable. Assuming no " << command[0] << "."; | 77 LOG(ERROR) << "No $PATH variable. Assuming no " << command[0] << "."; |
| 78 return false; | 78 return false; |
| 79 } | 79 } |
| 80 std::vector<std::string> paths; | 80 std::vector<std::string> paths; |
| 81 Tokenize(path, ":", &paths); | 81 Tokenize(path, ":", &paths); |
| 82 bool found = false; | 82 bool found = false; |
| 83 for (size_t i = 0; i < paths.size(); ++i) { | 83 for (size_t i = 0; i < paths.size(); ++i) { |
| 84 base::FilePath file(paths[i]); | 84 base::FilePath file(paths[i]); |
| 85 if (file_util::PathExists(file.Append(command[0]))) { | 85 if (base::PathExists(file.Append(command[0]))) { |
| 86 found = true; | 86 found = true; |
| 87 break; | 87 break; |
| 88 } | 88 } |
| 89 } | 89 } |
| 90 if (!found) | 90 if (!found) |
| 91 return false; | 91 return false; |
| 92 std::vector<std::string> argv; | 92 std::vector<std::string> argv; |
| 93 for (size_t i = 0; command[i]; ++i) | 93 for (size_t i = 0; command[i]; ++i) |
| 94 argv.push_back(command[i]); | 94 argv.push_back(command[i]); |
| 95 base::ProcessHandle handle; | 95 base::ProcessHandle handle; |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 WebContents* web_contents) { | 150 WebContents* web_contents) { |
| 151 BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, | 151 BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, |
| 152 base::Bind(&DetectAndStartProxyConfigUtil, | 152 base::Bind(&DetectAndStartProxyConfigUtil, |
| 153 web_contents->GetRenderProcessHost()->GetID(), | 153 web_contents->GetRenderProcessHost()->GetID(), |
| 154 web_contents->GetRenderViewHost()->GetRoutingID())); | 154 web_contents->GetRenderViewHost()->GetRoutingID())); |
| 155 } | 155 } |
| 156 | 156 |
| 157 } // namespace options | 157 } // namespace options |
| 158 | 158 |
| 159 #endif // !defined(OS_CHROMEOS) | 159 #endif // !defined(OS_CHROMEOS) |
| OLD | NEW |