| 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/common/platform_util.h" | 5 #include "chrome/common/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 10 matching lines...) Expand all Loading... |
| 21 argv.push_back("xdg-open"); | 21 argv.push_back("xdg-open"); |
| 22 argv.push_back(path); | 22 argv.push_back(path); |
| 23 | 23 |
| 24 base::environment_vector env; | 24 base::environment_vector env; |
| 25 // xdg-open can fall back on mailcap which eventually might plumb through | 25 // xdg-open can fall back on mailcap which eventually might plumb through |
| 26 // to a command that needs a terminal. Set the environment variable telling | 26 // to a command that needs a terminal. Set the environment variable telling |
| 27 // it that we definitely don't have a terminal available and that it should | 27 // it that we definitely don't have a terminal available and that it should |
| 28 // bring up a new terminal if necessary. See "man mailcap". | 28 // bring up a new terminal if necessary. See "man mailcap". |
| 29 env.push_back(std::make_pair("MM_NOTTTY", "1")); | 29 env.push_back(std::make_pair("MM_NOTTTY", "1")); |
| 30 | 30 |
| 31 // In Google Chrome, we do not let GNOME's bug-buddy intercept our crashes. |
| 32 // However, we do not want this environment variable to propagate to external |
| 33 // applications. See http://crbug.com/24120 |
| 34 char* disable_gnome_bug_buddy = getenv("GNOME_DISABLE_CRASH_DIALOG"); |
| 35 if (disable_gnome_bug_buddy && |
| 36 disable_gnome_bug_buddy == std::string("SET_BY_GOOGLE_CHROME")) { |
| 37 env.push_back(std::make_pair("GNOME_DISABLE_CRASH_DIALOG", "")); |
| 38 } |
| 39 |
| 31 base::file_handle_mapping_vector no_files; | 40 base::file_handle_mapping_vector no_files; |
| 32 base::ProcessHandle handle; | 41 base::ProcessHandle handle; |
| 33 if (base::LaunchApp(argv, env, no_files, false, &handle)) | 42 if (base::LaunchApp(argv, env, no_files, false, &handle)) |
| 34 ProcessWatcher::EnsureProcessGetsReaped(handle); | 43 ProcessWatcher::EnsureProcessGetsReaped(handle); |
| 35 } | 44 } |
| 36 | 45 |
| 37 } // namespace | 46 } // namespace |
| 38 | 47 |
| 39 namespace platform_util { | 48 namespace platform_util { |
| 40 | 49 |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 // do nothing. | 114 // do nothing. |
| 106 } else { | 115 } else { |
| 107 modifier = "unknown"; | 116 modifier = "unknown"; |
| 108 } | 117 } |
| 109 #endif | 118 #endif |
| 110 | 119 |
| 111 return ASCIIToUTF16(modifier); | 120 return ASCIIToUTF16(modifier); |
| 112 } | 121 } |
| 113 | 122 |
| 114 } // namespace platform_util | 123 } // namespace platform_util |
| OLD | NEW |