| OLD | NEW | 
|---|
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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> | 
| 11 #include <sys/types.h> | 11 #include <sys/types.h> | 
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 48   // xdg-settings internally runs xdg-mime, which uses mv to move newly-created | 48   // xdg-settings internally runs xdg-mime, which uses mv to move newly-created | 
| 49   // files on top of originals after making changes to them. In the event that | 49   // files on top of originals after making changes to them. In the event that | 
| 50   // the original files are owned by another user (e.g. root, which can happen | 50   // the original files are owned by another user (e.g. root, which can happen | 
| 51   // if they are updated within sudo), mv will prompt the user to confirm if | 51   // if they are updated within sudo), mv will prompt the user to confirm if | 
| 52   // standard input is a terminal (otherwise it just does it). So make sure it's | 52   // standard input is a terminal (otherwise it just does it). So make sure it's | 
| 53   // not, to avoid locking everything up waiting for mv. | 53   // not, to avoid locking everything up waiting for mv. | 
| 54   *exit_code = EXIT_FAILURE; | 54   *exit_code = EXIT_FAILURE; | 
| 55   int devnull = open("/dev/null", O_RDONLY); | 55   int devnull = open("/dev/null", O_RDONLY); | 
| 56   if (devnull < 0) | 56   if (devnull < 0) | 
| 57     return false; | 57     return false; | 
| 58   base::file_handle_mapping_vector no_stdin; | 58   base::FileHandleMappingVector no_stdin; | 
| 59   no_stdin.push_back(std::make_pair(devnull, STDIN_FILENO)); | 59   no_stdin.push_back(std::make_pair(devnull, STDIN_FILENO)); | 
| 60 | 60 | 
| 61   base::ProcessHandle handle; | 61   base::ProcessHandle handle; | 
| 62   base::LaunchOptions options; | 62   base::LaunchOptions options; | 
| 63   options.fds_to_remap = &no_stdin; | 63   options.fds_to_remap = &no_stdin; | 
| 64   if (!base::LaunchProcess(argv, options, &handle)) { | 64   if (!base::LaunchProcess(argv, options, &handle)) { | 
| 65     close(devnull); | 65     close(devnull); | 
| 66     return false; | 66     return false; | 
| 67   } | 67   } | 
| 68   close(devnull); | 68   close(devnull); | 
| (...skipping 533 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 602       shortcut_info.extension_id, | 602       shortcut_info.extension_id, | 
| 603       shortcut_info.title, | 603       shortcut_info.title, | 
| 604       icon_name); | 604       icon_name); | 
| 605 | 605 | 
| 606   if (shortcut_info.create_on_desktop) | 606   if (shortcut_info.create_on_desktop) | 
| 607     CreateShortcutOnDesktop(shortcut_filename, contents); | 607     CreateShortcutOnDesktop(shortcut_filename, contents); | 
| 608 | 608 | 
| 609   if (shortcut_info.create_in_applications_menu) | 609   if (shortcut_info.create_in_applications_menu) | 
| 610     CreateShortcutInApplicationsMenu(shortcut_filename, contents); | 610     CreateShortcutInApplicationsMenu(shortcut_filename, contents); | 
| 611 } | 611 } | 
| OLD | NEW | 
|---|