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 #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 17 matching lines...) Expand all Loading... |
28 | 28 |
29 // In Google Chrome, we do not let GNOME's bug-buddy intercept our crashes. | 29 // In Google Chrome, we do not let GNOME's bug-buddy intercept our crashes. |
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; | |
39 base::ProcessHandle handle; | 38 base::ProcessHandle handle; |
40 base::LaunchOptions options; | 39 base::LaunchOptions options; |
41 options.process_handle = &handle; | |
42 options.environ = &env; | 40 options.environ = &env; |
43 if (base::LaunchProcess(argv, options)) | 41 if (base::LaunchProcess(argv, options, &handle)) |
44 ProcessWatcher::EnsureProcessGetsReaped(handle); | 42 ProcessWatcher::EnsureProcessGetsReaped(handle); |
45 } | 43 } |
46 | 44 |
47 void XDGOpen(const std::string& path) { | 45 void XDGOpen(const std::string& path) { |
48 XDGUtil("xdg-open", path); | 46 XDGUtil("xdg-open", path); |
49 } | 47 } |
50 | 48 |
51 void XDGEmail(const std::string& email) { | 49 void XDGEmail(const std::string& email) { |
52 XDGUtil("xdg-email", email); | 50 XDGUtil("xdg-email", email); |
53 } | 51 } |
(...skipping 18 matching lines...) Expand all Loading... |
72 } | 70 } |
73 | 71 |
74 void OpenExternal(const GURL& url) { | 72 void OpenExternal(const GURL& url) { |
75 if (url.SchemeIs("mailto")) | 73 if (url.SchemeIs("mailto")) |
76 XDGEmail(url.spec()); | 74 XDGEmail(url.spec()); |
77 else | 75 else |
78 XDGOpen(url.spec()); | 76 XDGOpen(url.spec()); |
79 } | 77 } |
80 | 78 |
81 } // namespace platform_util | 79 } // namespace platform_util |
OLD | NEW |