Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(212)

Unified Diff: chrome/browser/platform_util_linux.cc

Issue 8851007: WIP / Do not commit (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/platform_util_chromeos.cc ('k') | chrome/browser/platform_util_mac.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « chrome/browser/platform_util_chromeos.cc ('k') | chrome/browser/platform_util_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698