| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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::Process process = base::LaunchProcess(argv, base::LaunchOptions()); | 95 base::Process process = base::LaunchProcess(argv, base::LaunchOptions()); |
| 96 if (!process.IsValid()) { | 96 if (!process.IsValid()) { |
| 97 LOG(ERROR) << "StartProxyConfigUtil failed to start " << command[0]; | 97 LOG(ERROR) << "StartProxyConfigUtil failed to start " << command[0]; |
| 98 return false; | 98 return false; |
| 99 } | 99 } |
| 100 base::EnsureProcessGetsReaped(process.pid()); | 100 base::EnsureProcessGetsReaped(process.Pid()); |
| 101 return true; | 101 return true; |
| 102 } | 102 } |
| 103 | 103 |
| 104 // Detect, and if possible, start the appropriate proxy config utility. On | 104 // Detect, and if possible, start the appropriate proxy config utility. On |
| 105 // failure to do so, show the Linux proxy config URL in a new tab instead. | 105 // failure to do so, show the Linux proxy config URL in a new tab instead. |
| 106 void DetectAndStartProxyConfigUtil(int render_process_id, | 106 void DetectAndStartProxyConfigUtil(int render_process_id, |
| 107 int render_view_id) { | 107 int render_view_id) { |
| 108 DCHECK_CURRENTLY_ON(BrowserThread::FILE); | 108 DCHECK_CURRENTLY_ON(BrowserThread::FILE); |
| 109 scoped_ptr<base::Environment> env(base::Environment::Create()); | 109 scoped_ptr<base::Environment> env(base::Environment::Create()); |
| 110 | 110 |
| (...skipping 39 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 |