| Index: chrome/browser/platform_util_linux.cc
|
| diff --git a/chrome/browser/platform_util_linux.cc b/chrome/browser/platform_util_linux.cc
|
| index f003769c8bc4ca972b9f50c99a114b3388115084..859d8114e08a83ce582371a958008e594c217865 100644
|
| --- a/chrome/browser/platform_util_linux.cc
|
| +++ b/chrome/browser/platform_util_linux.cc
|
| @@ -15,7 +15,9 @@ using content::BrowserThread;
|
|
|
| namespace {
|
|
|
| -void XDGUtil(const std::string& util, const std::string& arg) {
|
| +void XDGUtil(const std::string& util,
|
| + const std::string& arg,
|
| + base::ProcessHandle* process_handle) {
|
| std::vector<std::string> argv;
|
| argv.push_back(util);
|
| argv.push_back(arg);
|
| @@ -39,16 +41,20 @@ void XDGUtil(const std::string& util, const std::string& arg) {
|
| base::ProcessHandle handle;
|
| base::LaunchOptions options;
|
| options.environ = &env;
|
| - if (base::LaunchProcess(argv, options, &handle))
|
| - base::EnsureProcessGetsReaped(handle);
|
| + if (base::LaunchProcess(argv, options, &handle)) {
|
| + if (process_handle)
|
| + *process_handle = handle;
|
| + else
|
| + base::EnsureProcessGetsReaped(handle);
|
| + }
|
| }
|
|
|
| -void XDGOpen(const std::string& path) {
|
| - XDGUtil("xdg-open", path);
|
| +void XDGOpen(const std::string& path, base::ProcessHandle* process_handle) {
|
| + XDGUtil("xdg-open", path, process_handle);
|
| }
|
|
|
| void XDGEmail(const std::string& email) {
|
| - XDGUtil("xdg-email", email);
|
| + XDGUtil("xdg-email", email, NULL);
|
| }
|
|
|
| // TODO(estade): It would be nice to be able to select the file in the file
|
| @@ -59,7 +65,7 @@ void ShowItemInFolderOnFileThread(const FilePath& full_path) {
|
| if (!file_util::DirectoryExists(dir))
|
| return;
|
|
|
| - XDGOpen(dir.value());
|
| + XDGOpen(dir.value(), base::kNullProcessHandle);
|
| }
|
|
|
| } // namespace
|
| @@ -72,17 +78,17 @@ void ShowItemInFolder(const FilePath& full_path) {
|
| base::Bind(&ShowItemInFolderOnFileThread, full_path));
|
| }
|
|
|
| -void OpenItem(const FilePath& full_path) {
|
| +void OpenItem(const FilePath& full_path, base::ProcessHandle* process_handle) {
|
| DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
|
| BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE,
|
| - base::Bind(&XDGOpen, full_path.value()));
|
| + base::Bind(&XDGOpen, full_path.value(), process_handle));
|
| }
|
|
|
| void OpenExternal(const GURL& url) {
|
| if (url.SchemeIs("mailto"))
|
| XDGEmail(url.spec());
|
| else
|
| - XDGOpen(url.spec());
|
| + XDGOpen(url.spec(), base::kNullProcessHandle);
|
| }
|
|
|
| } // namespace platform_util
|
|
|