| 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 #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/environment.h" | 9 #include "base/environment.h" |
| 10 #include "base/file_path.h" | 10 #include "base/file_path.h" |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 found = true; | 68 found = true; |
| 69 break; | 69 break; |
| 70 } | 70 } |
| 71 } | 71 } |
| 72 if (!found) | 72 if (!found) |
| 73 return false; | 73 return false; |
| 74 std::vector<std::string> argv; | 74 std::vector<std::string> argv; |
| 75 for (size_t i = 0; command[i]; ++i) | 75 for (size_t i = 0; command[i]; ++i) |
| 76 argv.push_back(command[i]); | 76 argv.push_back(command[i]); |
| 77 base::ProcessHandle handle; | 77 base::ProcessHandle handle; |
| 78 base::LaunchOptions options; | 78 if (!base::LaunchProcess(argv, base::LaunchOptions(), &handle)) { |
| 79 options.process_handle = &handle; | |
| 80 if (!base::LaunchProcess(argv, options)) { | |
| 81 LOG(ERROR) << "StartProxyConfigUtil failed to start " << command[0]; | 79 LOG(ERROR) << "StartProxyConfigUtil failed to start " << command[0]; |
| 82 return false; | 80 return false; |
| 83 } | 81 } |
| 84 ProcessWatcher::EnsureProcessGetsReaped(handle); | 82 ProcessWatcher::EnsureProcessGetsReaped(handle); |
| 85 return true; | 83 return true; |
| 86 } | 84 } |
| 87 | 85 |
| 88 // Detect, and if possible, start the appropriate proxy config utility. On | 86 // Detect, and if possible, start the appropriate proxy config utility. On |
| 89 // failure to do so, show the Linux proxy config URL in a new tab instead. | 87 // failure to do so, show the Linux proxy config URL in a new tab instead. |
| 90 void DetectAndStartProxyConfigUtil(TabContents* tab_contents) { | 88 void DetectAndStartProxyConfigUtil(TabContents* tab_contents) { |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 | 127 |
| 130 } // anonymous namespace | 128 } // anonymous namespace |
| 131 | 129 |
| 132 void AdvancedOptionsUtilities::ShowNetworkProxySettings( | 130 void AdvancedOptionsUtilities::ShowNetworkProxySettings( |
| 133 TabContents* tab_contents) { | 131 TabContents* tab_contents) { |
| 134 BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, | 132 BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, |
| 135 NewRunnableFunction(&DetectAndStartProxyConfigUtil, tab_contents)); | 133 NewRunnableFunction(&DetectAndStartProxyConfigUtil, tab_contents)); |
| 136 } | 134 } |
| 137 | 135 |
| 138 #endif // !defined(OS_CHROMEOS) | 136 #endif // !defined(OS_CHROMEOS) |
| OLD | NEW |