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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 if (file_util::PathExists(file.Append(command[0]))) { | 67 if (file_util::PathExists(file.Append(command[0]))) { |
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::file_handle_mapping_vector no_files; | |
78 base::ProcessHandle handle; | 77 base::ProcessHandle handle; |
79 if (!base::LaunchApp(argv, no_files, false, &handle)) { | 78 base::LaunchOptions options; |
| 79 options.process_handle = &handle; |
| 80 if (!base::LaunchProcess(argv, options)) { |
80 LOG(ERROR) << "StartProxyConfigUtil failed to start " << command[0]; | 81 LOG(ERROR) << "StartProxyConfigUtil failed to start " << command[0]; |
81 return false; | 82 return false; |
82 } | 83 } |
83 ProcessWatcher::EnsureProcessGetsReaped(handle); | 84 ProcessWatcher::EnsureProcessGetsReaped(handle); |
84 return true; | 85 return true; |
85 } | 86 } |
86 | 87 |
87 // Detect, and if possible, start the appropriate proxy config utility. On | 88 // Detect, and if possible, start the appropriate proxy config utility. On |
88 // failure to do so, show the Linux proxy config URL in a new tab instead. | 89 // failure to do so, show the Linux proxy config URL in a new tab instead. |
89 void DetectAndStartProxyConfigUtil(TabContents* tab_contents) { | 90 void DetectAndStartProxyConfigUtil(TabContents* tab_contents) { |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 | 129 |
129 } // anonymous namespace | 130 } // anonymous namespace |
130 | 131 |
131 void AdvancedOptionsUtilities::ShowNetworkProxySettings( | 132 void AdvancedOptionsUtilities::ShowNetworkProxySettings( |
132 TabContents* tab_contents) { | 133 TabContents* tab_contents) { |
133 BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, | 134 BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, |
134 NewRunnableFunction(&DetectAndStartProxyConfigUtil, tab_contents)); | 135 NewRunnableFunction(&DetectAndStartProxyConfigUtil, tab_contents)); |
135 } | 136 } |
136 | 137 |
137 #endif // !defined(OS_CHROMEOS) | 138 #endif // !defined(OS_CHROMEOS) |
OLD | NEW |