| 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/shell_integration.h" | 5 #include "chrome/browser/shell_integration.h" |
| 6 | 6 |
| 7 #include <fcntl.h> | 7 #include <fcntl.h> |
| 8 #include <glib.h> | 8 #include <glib.h> |
| 9 #include <stdlib.h> | 9 #include <stdlib.h> |
| 10 #include <sys/stat.h> | 10 #include <sys/stat.h> |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 // not, to avoid locking everything up waiting for mv. | 52 // not, to avoid locking everything up waiting for mv. |
| 53 *exit_code = EXIT_FAILURE; | 53 *exit_code = EXIT_FAILURE; |
| 54 int devnull = open("/dev/null", O_RDONLY); | 54 int devnull = open("/dev/null", O_RDONLY); |
| 55 if (devnull < 0) | 55 if (devnull < 0) |
| 56 return false; | 56 return false; |
| 57 base::file_handle_mapping_vector no_stdin; | 57 base::file_handle_mapping_vector no_stdin; |
| 58 no_stdin.push_back(std::make_pair(devnull, STDIN_FILENO)); | 58 no_stdin.push_back(std::make_pair(devnull, STDIN_FILENO)); |
| 59 | 59 |
| 60 base::ProcessHandle handle; | 60 base::ProcessHandle handle; |
| 61 base::LaunchOptions options; | 61 base::LaunchOptions options; |
| 62 options.process_handle = &handle; | |
| 63 options.fds_to_remap = &no_stdin; | 62 options.fds_to_remap = &no_stdin; |
| 64 if (!base::LaunchProcess(argv, options)) { | 63 if (!base::LaunchProcess(argv, options, &handle)) { |
| 65 close(devnull); | 64 close(devnull); |
| 66 return false; | 65 return false; |
| 67 } | 66 } |
| 68 close(devnull); | 67 close(devnull); |
| 69 | 68 |
| 70 return base::WaitForExitCode(handle, exit_code); | 69 return base::WaitForExitCode(handle, exit_code); |
| 71 } | 70 } |
| 72 | 71 |
| 73 std::string CreateShortcutIcon( | 72 std::string CreateShortcutIcon( |
| 74 const ShellIntegration::ShortcutInfo& shortcut_info, | 73 const ShellIntegration::ShortcutInfo& shortcut_info, |
| (...skipping 518 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 593 shortcut_info.extension_id, | 592 shortcut_info.extension_id, |
| 594 shortcut_info.title, | 593 shortcut_info.title, |
| 595 icon_name); | 594 icon_name); |
| 596 | 595 |
| 597 if (shortcut_info.create_on_desktop) | 596 if (shortcut_info.create_on_desktop) |
| 598 CreateShortcutOnDesktop(shortcut_filename, contents); | 597 CreateShortcutOnDesktop(shortcut_filename, contents); |
| 599 | 598 |
| 600 if (shortcut_info.create_in_applications_menu) | 599 if (shortcut_info.create_in_applications_menu) |
| 601 CreateShortcutInApplicationsMenu(shortcut_filename, contents); | 600 CreateShortcutInApplicationsMenu(shortcut_filename, contents); |
| 602 } | 601 } |
| OLD | NEW |