| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 #include "chrome/browser/platform_util.h" | 5 #include "chrome/browser/platform_util.h" |
| 6 | 6 |
| 7 #include <gtk/gtk.h> | 7 #include <gtk/gtk.h> |
| 8 | 8 |
| 9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
| 10 #include "base/process_util.h" | 10 #include "base/process_util.h" |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 // However, we do not want this environment variable to propagate to external | 30 // However, we do not want this environment variable to propagate to external |
| 31 // applications. See http://crbug.com/24120 | 31 // applications. See http://crbug.com/24120 |
| 32 char* disable_gnome_bug_buddy = getenv("GNOME_DISABLE_CRASH_DIALOG"); | 32 char* disable_gnome_bug_buddy = getenv("GNOME_DISABLE_CRASH_DIALOG"); |
| 33 if (disable_gnome_bug_buddy && | 33 if (disable_gnome_bug_buddy && |
| 34 disable_gnome_bug_buddy == std::string("SET_BY_GOOGLE_CHROME")) { | 34 disable_gnome_bug_buddy == std::string("SET_BY_GOOGLE_CHROME")) { |
| 35 env.push_back(std::make_pair("GNOME_DISABLE_CRASH_DIALOG", "")); | 35 env.push_back(std::make_pair("GNOME_DISABLE_CRASH_DIALOG", "")); |
| 36 } | 36 } |
| 37 | 37 |
| 38 base::file_handle_mapping_vector no_files; | 38 base::file_handle_mapping_vector no_files; |
| 39 base::ProcessHandle handle; | 39 base::ProcessHandle handle; |
| 40 if (base::LaunchApp(argv, env, no_files, false, &handle)) | 40 base::LaunchOptions options; |
| 41 options.process_handle = &handle; |
| 42 options.environ = &env; |
| 43 if (base::LaunchProcess(argv, options)) |
| 41 ProcessWatcher::EnsureProcessGetsReaped(handle); | 44 ProcessWatcher::EnsureProcessGetsReaped(handle); |
| 42 } | 45 } |
| 43 | 46 |
| 44 void XDGOpen(const std::string& path) { | 47 void XDGOpen(const std::string& path) { |
| 45 XDGUtil("xdg-open", path); | 48 XDGUtil("xdg-open", path); |
| 46 } | 49 } |
| 47 | 50 |
| 48 void XDGEmail(const std::string& email) { | 51 void XDGEmail(const std::string& email) { |
| 49 XDGUtil("xdg-email", email); | 52 XDGUtil("xdg-email", email); |
| 50 } | 53 } |
| (...skipping 18 matching lines...) Expand all Loading... |
| 69 } | 72 } |
| 70 | 73 |
| 71 void OpenExternal(const GURL& url) { | 74 void OpenExternal(const GURL& url) { |
| 72 if (url.SchemeIs("mailto")) | 75 if (url.SchemeIs("mailto")) |
| 73 XDGEmail(url.spec()); | 76 XDGEmail(url.spec()); |
| 74 else | 77 else |
| 75 XDGOpen(url.spec()); | 78 XDGOpen(url.spec()); |
| 76 } | 79 } |
| 77 | 80 |
| 78 } // namespace platform_util | 81 } // namespace platform_util |
| OLD | NEW |